R 制作饼图';s轮廓在有光泽的表面上更平滑
我正在尝试使用R 制作饼图';s轮廓在有光泽的表面上更平滑,r,ggplot2,pie-chart,R,Ggplot2,Pie Chart,我正在尝试使用ggplot2 代码如下: library("ggplot2") library("ggthemes") ## for theme_economist df <- data.frame(origin=c('with','without'),value=c(24536,50456)) pie <- ggplot(df, aes(x = "",y=value, fill = origin))+ geom_bar(width = 1,stat="identit
ggplot2
代码如下:
library("ggplot2")
library("ggthemes") ## for theme_economist
df <- data.frame(origin=c('with','without'),value=c(24536,50456))
pie <- ggplot(df, aes(x = "",y=value, fill = origin))+
geom_bar(width = 1,stat="identity")+
coord_polar(theta = "y",start=pi/3)+
theme_economist()
库(“ggplot2”)
图书馆(“ggthemes”)###为Themes#U经济学家
df要提高屏幕上绘图的分辨率,必须将res
参数设置为其默认值72。这对我来说没有多大意义,但效果很好,分辨率从非常差变为非常好
但是,进一步增加其值可能会导致图像失真。
现在看来,在导出打印对象或将其渲染为闪亮之前,您无法更改打印对象本身的分辨率。我编辑了我的问题,使其切中要害,请您发布/链接到实际图像好吗?当我运行你的代码时,我得到了。你在看什么样的输出,分辨率是多少?我把图像放在一个闪亮的应用程序中,我不知道为什么它看起来没有你的那么好。有没有办法简单地改变ggplot的分辨率?你提到了我发现的分辨率,这似乎基本上是同一个问题,所以它取决于输出你知道用什么方法来显示它吗在Shiny中使用renderPlot()
时分辨率高?