r - 为什么我的 ggplot2 条形图不显示?
问题描述
我正在尝试在 ggplot2 中绘制条形图并遇到问题。
从变量开始
PalList <- c(9, 9009, 906609, 99000099)
PalList1 <- as_tibble(PalList)
Index <- c(1,2,3,4)
PalPlotList <- cbind(Index, PalList)
PPL <- as_tibble(PalPlotList)
并加载 tidyverse library(tidyverse)
,我尝试像这样绘制:
PPL %>%
ggplot(aes(x=PalList)) +
geom_bar()
不管我访问的是 PPL 还是 PalList,我仍然会得到这个结果(轴和标签可能会改变,但图表区域不会改变):
即使这样仍然给出了一个空白的情节,只是现在在经典样式中:
ggplot(PalList1, aes(value)) +
geom_bar() +
theme_classic()
如果我尝试barplot(PalList)
,我会得到预期的结果。但我想要控制ggplot。对于如何解决这个问题,有任何的建议吗?
解决方案
推荐阅读
- c# - 如何判断一个表达式树是否是另一个表达式树的子集
- tensorflow - 序列数据上的 LSTM,预测离散列
- django - 为普通用户复制 django admin
- matlab - Matlab中神经网络训练中的切换类
- symfony - 奏鸣曲管理员列表可编辑与编辑/显示冲突
- python - 在 Django 中根据请求自动添加新的 model_field || DRF
- android - 插入数据后,房间数据库表仍然为空
- microsoft-graph-api - 应用 $filter 选项在 Graph API 中检索具有特定名称的文件夹
- android - Android 找不到微调器的符号变量错误
- kubernetes - Kubernetes 节点详细信息