在 Gnuplot 中以不同间距绘制 y 轴标签
我正在尝试使用 gnuplot 创建条形图。我的要求是我应该能够将 y 轴标记为 0、1、100、10,000(即每个刻度增加 100 倍,1 和 0 之间除外)。另外,这不是对数刻度,因为我希望它从 0 开始。如果您知道如何执行此操作,请告诉我。
I am trying to create a barchart using gnuplot. My requirement is that I should be able to label y-axis as 0, 1, 100, 10,000 (i.e., each tick increases by a factor of 100, except between 1 and 0). Also, this is not log-scale as I want this to start at 0. Let me know if you know how to do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
set xtics
:生成以下图:
http:// marco.uctleg.net/resources/sample_xtics.png
包含以下数据:
编辑:刚刚注意到您要求更改 y 轴。基本上是一样的,我相信你能解决。
You can use
set xtics
:produces the following plot:
http://marco.uctleg.net/resources/sample_xtics.png
with the following data:
EDIT: Just noticed you asked to change the y-axis. It's much the same, I'm sure you can work it out.
Marcog 的答案可能是获得您想要的结果的最佳方法,
但是,如果您不想重新分配 1 表示“0”,2 表示“1”等,
那么你可以尝试一个简单的
方法将抽动设置在你想要的地方,
然后使用设置的格式 y 指定抽动的格式。
例如,
将 tics 以漂亮的指数形式放置(请注意,这种特定格式在 postscript 输出中看起来很漂亮,但在默认的 gnuplot 窗口中却相当丑陋)。
请参阅http://t16web.lanl.gov/Kawano/gnuplot/tics-e。有关设置格式命令的更多信息,请参见 html(页面中间)。
一切顺利
Marcog's answer is probably the best way to get exactly what you want,
However, if you don't want to do the reassignment of 1 means "0", 2 means "1" etc,
then you could try a simple
To set the tics where you want them,
and then use the set format y to specify the format of the tics.
For example
to put the tics in nice exponential form (note this particular formatting looks pretty in postscript output, but rather ugly in the default gnuplot window).
See http://t16web.lanl.gov/Kawano/gnuplot/tics-e.html for more on the set format command (midway down the page).
All the best