程序问答   发布时间:2022-06-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了使用 ggplot 连接点图。与 geom_line 连接大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决使用 ggplot 连接点图。与 geom_line 连接?@H_618_1@ 开发过程中遇到使用 ggplot 连接点图。与 geom_line 连接的问题如何解决?下面主要结合日常开发的经验,给出你关于使用 ggplot 连接点图。与 geom_line 连接的解决方法建议,希望对你解决使用 ggplot 连接点图。与 geom_line 连接有所启发或帮助;

这是我的数据框:

df<-structure(List(category_of_job = structure(1:27,.Label = c("Recepcionist","SecretarIEs","admin","Stock control","Government admin","Payroll & accounts","Human resources","Research admin","Accounts","ParameDics","Childcare","Teaching assistants","Care workers","School crossing","Nurses","Social workers","Teaching & education","MeDical practitioners","Culture & Media","Graphic designers","Arts & media","Designers","Public relations","Web Design","Media professionals","Business & media","Advertising"),class = "factor"),female_year_salary = c(13,15,16,18,25,32,30,23,35,12,13,3,27,45,26,29,34),male_year_salary = c(14,19,21,41,37,14,4,33,36,78,31,34,40)),row.names = c(NA,-27L),class = c("tbl_df","tbl","data.frame"))

我需要使用 geom_line() 中的 ggplot 函数连接这些点。可能吗?

我可以用 geom_segment() 但我不能用 geom_line

有什么帮助吗?

ggplot(df,aes(x = category_of_job,group = category_of_job)) +
  geom_point(aes(y = male_year_salary),color = 'red')+
  geom_point(aes(y = female_year_salary),color = 'blue')

如何用 geom_line 连接红点和蓝点?

解决方法@H_618_1@

也许我们可以用public class BusinessCreatedEventHandler { private readonly IPublisher _publisher; public BusinessCreatedEventHandler(IPublisher publisher) { _publisher = publisher; } public Task Handle(String id,String Name) { var message = new BusinessCreatedEvent { BusinessId = id,BusinessName = name }; _publisher.Publish(messagE); return Task.CompletedTask; } } (来自pivot_longer)改造成'long',然后同时使用tidyrgeom_line

geom_point

-输出

使用 ggplot 连接点图。与 geom_line 连接

大佬总结

以上是大佬教程为你收集整理的使用 ggplot 连接点图。与 geom_line 连接全部内容,希望文章能够帮你解决使用 ggplot 连接点图。与 geom_line 连接所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。