r - R - 使用 ggplot + bbplot 个性化刻度轴刻度
问题描述
大家好,首先感谢您的帮助。
我正在使用 ggplot 和 bbplot 绘制关于利率数据的线图,到目前为止一切都很好,除了我希望 X 轴更详细地显示日期。理想情况下,我想要这样的图像,尽管每年显示也会这样做:
到目前为止,我所取得的是使用以下代码的图像波纹管:
library(readxl)
cetes_14 <- read_excel("cetes.xlsx", sheet = "Hoja2")
View(cetes_14)
#Crear gráfico con ggplot y la ayuda de bbplot y scales
library(ggplot2)
library(bbplot)
library(scales)
cetes14_plot <- ggplot(cetes_14, aes(x = cetes_14$FECHA, y =cetes_14$RENDIMIENTO, colour = cetes_14$PERIODO)) +
geom_line(size = 1) +
scale_fill_brewer(palette="Dark2") +
geom_hline(yintercept = 0, size = 1, colour="#333333")+
bbc_style() +
labs(title="Rendimiento CETES 28,91,182 y 364",
subtitle = "2014-2020")+
scale_y_continuous(breaks = seq(0.0,0.09,0.01),labels = percent)
#Guardar plot y agregar fuente
finalise_plot(plot_name = cetes14_plot,
source = "Fuente: Elaboración propia con datos Banxico")
我曾尝试使用 scale_x_continuous但到目前为止没有任何效果,而且我无法找到另一种解决方案。我希望你能帮助我,谢谢。
解决方案
推荐阅读
- mirth - 如何让 Mirth connectorMessage.getRawData 返回一个字符串?
- java - Spring Boot:NoSuchBeanDefinitionException
- r - 文本调查数据的 R 可视化
- smtp - SubethaSmtp 是否将电子邮件存储在某处?
- c++ - 无法连接到qt中的插槽
- r - 使用蒙特卡洛计算圆面积
- java - org.hibernate.property.access.spi.PropertyAccessException:访问字段时出错 [private java.lang.Integer
- android - Chrome://inspect 显示我的设备,但我无法检查它
- web-applications - PWA 和本地文件系统
- amazon-cloudformation - 您如何在 aws 中为 postgres rds db 正确设置多用户轮换?