在gnuplot中绘制两个轴 [英] Plotting two axes in gnuplot
本文介绍了在gnuplot中绘制两个轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在gnuplot中绘制两条曲线,分别具有两个对应的轴,每个轴的比例都不同?
Is it possible to plot two curves, with two corresponding axes in gnuplot, each of which has a different scale?
例如,同一张图中的y=x**2
和y=x**4
(以相同的比例绘制时,它们的差异足以使不舒服".)
For example, y=x**2
and y=x**4
in the same graph (they vary enough to be "uncomfortable" when plotted with the same scale).
推荐答案
您可以自动处理轴,而不必自己缩放轴并保持自动缩放:
You can have the axes handled automatically without you having to scale them yourself and keep auto-scaling:
set terminal jpeg
set output 'graph.jpg'
set xrange [-10:10]
set ytics 10 nomirror tc lt 1
set ylabel '2*x' tc lt 1
set y2tics 20 nomirror tc lt 2
set y2label '4*x' tc lt 2
plot 2*x linetype 1, 4*x linetype 2 axes x1y2
这篇关于在gnuplot中绘制两个轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文