Plot y1 in x1 with respect to x2 axis

家住魔仙堡 提交于 2019-12-24 06:35:44

问题


I have a data a follows:

y1   x1   x2
125  100   1
130  90    2
136  85    3
143  70    4
145  65    5

I would like to plot it in gnuplot as in the figure.

I used the procedure mentioned here Gnuplot: Plot x2 axis with respect to x1 axis , but it is plotting the x2 differently.


回答1:


Plot your data as usual on the x1 and y1 axes, but place additional labels on the x2-axis with x2tic(3):

set xrange [*:*] reverse
set x2tics
set xtics nomirror
plot 'file.dat' using 2:1:x2tic(3) with linespoints pt 7 notitle

If you don't want a conventional numerical, you could also use both x2tic and xtic:

plot 'file.dat' using 2:1:x2tic(3):xtic(2) with linespoints pt 7 notitle



来源:https://stackoverflow.com/questions/40503307/plot-y1-in-x1-with-respect-to-x2-axis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!