cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Change size or aspect ratio of ggplot visualizations

tismith1_558848
New Contributor

I understand that plots in R notebooks are captured by a png graphics device. Is there a way to set the size or the aspect ratio of the canvas? I understand that I can resize the rendered .png by dragging the handle in the notebook, but that means I have to set font sizes etc manually so that they render nicely at the smaller size. I'd rather just specify the size of my plot in my code. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions

sdaza
New Contributor III

Try something like this:

options(repr.plot.width=800, repr.plot.height=500)

View solution in original post

2 REPLIES 2

sdaza
New Contributor III

Try something like this:

options(repr.plot.width=800, repr.plot.height=500)

kassandra
New Contributor II

Hi @sdazaโ€‹ , the answer above didn't change the size somehow, or perhaps I was putting it in the wrong place? I entered it in a new cell before the %sql cell with the plot chart.

screen-shot-2020-12-23-at-104359-pm.png 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local communityโ€”sign up today to get started!

Sign Up Now