首页 > 解决方案 > 更改“likert”标准文本

问题描述

我不知道如何更改使用 likert 包创建的绘图上的标准文本。

为方便起见,我将只提供示例数据,因为解决方案可能是相同的。

library(likert)

data(pisaitems) 

items28 <- pisaitems[, substr(names(pisaitems), 1, 5) == "ST24Q"] 

l28 <- likert(items28) 

plot(l28)

输出应该如下图所示,我要更改的是“响应”和“百分比”这两个词。

输出

希望你能帮忙!

标签: rplotlikert

解决方案


欢迎来到 SO!我不知道这个likert包,但它的功能似乎plot是基于的ggplot2,所以你可以修改选项ggplot2

plot(l28) +
  labs(
    x = "Another lab",                          # here you manage axis
    y = "My lab"                                # also here ("inverted "because
                                                # it seems plot has coord_flip option)
  ) + guides(fill=guide_legend("My e title"))   # here you manage the title of the legend

在此处输入图像描述


推荐阅读