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 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group