R中使用晶格的条形图

编程入门 行业动态 更新时间:2024-10-26 02:28:27
本文介绍了R中使用晶格的条形图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

这是我的代码:

d<-data.frame(column1=rep(Names, each=1),column2=rep(c("one"),1),column3=values) barchart(column3 ~ column1, groups=column2, d, auto.key = list(columns = 1))

我的价值观之一是负面的.在我的图片上,我看到所有的条形都从负值开始,一直增长到它们的值,但是我想看到所有的条形都从0开始(一个条形具有反转方向).

One of my values is negative. On my picture I see all the bars starting from negative values and growing up to their values, but I want to see all the bars starting at 0 (one bar has revers direction).

我该怎么做?

我不确定晶格,其他任何方法都可以.我尝试使用barplot,它以正确的方式绘制,但是我的标签太长,因此当我缩小字体时-由于其样式,我无法阅读anithyng.

I'm not sure about lattice, any other way is ok. I tried barplot, it plots in the right way, but my lables are too long, so when I make the font smaller - I can't read anithyng because of its style.

推荐答案

使用origin自变量:

barchart(column3 ~ column1, groups=column2, d, auto.key = list(columns = 1), origin=0)

更多推荐

R中使用晶格的条形图

本文发布于:2023-07-18 04:32:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141055.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:晶格   条形图

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!