简体   繁体   English

具有对数y比例和负值的图

[英]plot with logarithmic y scale and negative values

I have a set of data with both negative and positive values. 我有一组具有负值和正值的数据。 I would like to present them on a plot with y axis in logarithmic scale. 我想用对数刻度在y轴的图上显示它们。 As some of the values are negative, log="y" doesn't work. 由于某些值是负值,因此log =“ y”不起作用。 How to overcome this? 如何克服呢?

Thank you all for your comments. 谢谢大家的意见。 I've solved the problem by myself: instead of using simple plot() for generating the graph, I've used ggplot2 package with scale_y_log() function to present linear units at logarithmic scale (including negative values). 我自己解决了这个问题:我不是使用简单的plot()来生成图形,而是使用了带有scale_y_log()函数的ggplot2包,以对数刻度(包括负值)显示线性单位。

However, I have one more - similar - question, which can be found here. 但是,我还有一个类似的问题,可以在这里找到

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM