Issue
I'm trying out R with Jupyter Notebook and for some reason the plots are huge. How can I reduce the size of the plot? I tried changing the plot_scale
option via: options(jupyter.plot_scale=.25
) but nothing happened. I've tried other numbers besides .25, but it has no effect.
I also tried
options(repr.plot.width = 1, repr.plot.height = 0.75, repr.plot.res = 100)
as well as options(jupyter.plot_mimetypes = c("text/plain", "image/png" ))
, but both gave the following error:
Error in value[[3L]](cond): invalid graphics state
Traceback:
plot without title
Ideally, I'm looking for a global solution (i.e. one that changes the default plot size, rather than having to individually scale each plot). Any suggestions?
Solution
Try the following:
options(repr.plot.width = 5, repr.plot.height = 5)
x = seq(0,2*pi, length = 50)
y = sin(x)
plot(x,y)
Then compare it to the output from the following in another cell or after restarting the kernel:
options(repr.plot.width = 15, repr.plot.height = 15)
x = seq(0,2*pi, length = 50)
y = sin(x)
plot(x,y)
You should see a difference.
If you set the width and height to you get plot without title
error.
Should be good with 2 or above because ~1.8 or above worked in my tests.
Based on this post.
Answered By - Wayne
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.