Exchanging the axes in gnuplot

后端 未结 3 1585
陌清茗
陌清茗 2021-01-12 03:06

I have been wondering about this for a while, and it might already be implemented in gnuplot but I haven\'t been able to find info online.

When you have

3条回答
  •  遥遥无期
    2021-01-12 03:39

    From what I have seen, parametric plots are pretty common in order to achieve your needs. If you really hate parametric plots and you have no fear for a VERY ugly solutions, I can give you my method...

    My trick is to use a data file filled with a sequence of numbers. To fit your example, let's make a file sq with a sequence of reals from -10 to 10 :

    seq -10 .5 10 > sq
    

    And then you can do the magic you want using gnuplot :

    plot 'sq' u ($1**2):($1)
    

    And if you uses linux you can also put the command directly in the command line :

    plot '< seq -10 .5 10' u ($1**2):($1)  
    

    I want to add that I'm not proud of this solution and I'd love the "axis y1x1" functionality too.

提交回复
热议问题