簡體   English   中英

如何使用 ggsave 以提高分辨率來控制 ggplot 的寬度和長度

[英]how to control the width and length of ggplot with increased resolution using ggsave

創建分辨率為 300 dpi 的 ggplot 后,面臨的主要問題是圖形的尺寸。 使用的命令是

p <- ggplot(Rrib, aes(YEAR, CLUSTER)) + 
  geom_tile(aes(fill = SAMPLE_TYPE), colour="black", size = 1.3)+ 
  scale_fill_manual(values = c("BOTH" = "red2", "ENV" = "forestgreen", 
                               "AFP" = "orange", "NONE" = "white"))

ggsave('C:/Users/Nido/Desktop/test.tiff', p, device = "tiff", dpi = 300, 
       width=12, height=16, unit = "in")

使用上述命令,plot 區域中沒有 output。

並通過更改以下命令部分的 position 錯誤是“無法識別“單元”

width=12, height=16, unit = "in"

如何調整圖形的長度和寬度。 您的幫助將不勝感激

嘗試以復數形式使用單位 - 所以units = "in"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM