Jay*_*ong 16 plot r jupyter jupyter-notebook
我想知道如何配置Jupyter在R内核中绘制一个较小的数字.
我尝试过使用options(repr.plot.width = 1, repr.plot.height = 0.75, repr.plot.res = 300),但结果有点混乱.它正在改变产生的图R的大小.有没有什么办法可以在Jupyter中直接配置输出图形大小.
换句话说,如何将第一个图中的大小更改为第二个图中的大小,同时不会弄乱图.
小智 7
您需要手动设置刻度大小,标记大小和文本大小。文字大小和刻度大小可以通过theme()功能设置,而标记大小可以通过geom_point()功能设置。
df_1 = data.frame(x=c(5, 6, 7, 8, 9), y = c(200, 225, 250, 270, 310))
options(repr.plot.width = 1, repr.plot.height = 0.75)
ggplot(df_1, aes(x = x, y = y)) + geom_point(size = 0.3) +
theme(text = element_text(size = 3), element_line(size = 0.1))
Run Code Online (Sandbox Code Playgroud)
您应该简单地更改绘图的分辨率。例如,尝试repr.plot.res = 100:
options(repr.plot.width = 1, repr.plot.height = 0.75, repr.plot.res = 100)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5448 次 |
| 最近记录: |