【问题标题】:plot() won't change axis text size using cex.axisplot() 不会使用 cex.axis 更改轴文本大小
【发布时间】:2023-01-27 15:45:42
【问题描述】:

我正在尝试使用 R 中的 likert 包为每个国家/地区绘制一个 1 - 7 的李克特量表,但是 R base plot() 函数不会更改任何文本大小(甚至添加主标题).

我正在生成情节:

p <- likert(summary = data )

plot(p, 
   plot.percents=FALSE, 
   plot.percent.low=FALSE, 
   plot.percent.high=FALSE,
   include.center=TRUE, 
   plot.percent.neutral = FALSE, 
   col = c(brewer.pal(n = 7, name = "RdBu")), 
   cex.axis = 0.5, 
   cex.lab=0.5, 
   main = "title")

产生以下情节: Plot of Countries of the World

所有其他绘图参数都有效,所以我不确定为什么最后 3 个最基本的无效。

【问题讨论】:

    标签: r plot likert


    【解决方案1】:

    我通过使用 theme(axis.text) 来解决这个问题,如下所示:

    plot(p, 
       plot.percents=FALSE, 
       plot.percent.low=FALSE, 
       plot.percent.high=FALSE,
       include.center=TRUE, 
       plot.percent.neutral = FALSE, 
       col = c(brewer.pal(n = 7, name = "RdBu")), 
       main = "title") +
       theme(axis.text=element_text(size=4)
    

    这并没有回答关于为什么 plot() 函数不接受参数的更大问题,因为标题仍然没有显示,但它是一个创可贴解决方案

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-16
      • 2012-02-05
      • 2018-12-26
      • 1970-01-01
      • 2019-09-06
      相关资源
      最近更新 更多