Discussion:
How to plot x-axis tics [0 - 10 10 - 0]
(too old to reply)
Abhi Shek
2021-06-04 12:05:16 UTC
Permalink
Hi All,

I would like to have my x-axis tics marked as 0-10 and then again start decrementing from 10 - 0.

For example, the axis should look like below.

"0 2 4 6 8 10 8 6 4 2 0"

Regards,
Abhishek G
Gavin Buxton
2021-06-04 17:43:28 UTC
Permalink
You can make the tics be whatever you want. Here's an example:

set xtics ("low" 0, "medium" 50, "high" 100)

Obviously, you can't have a function that has two x-values, but you could label 12 as "8" and 14 as "6", etc... you would just have to modify your data or function accordingly.

set xtics ("0" 0, "2" 2, "4" 4, "6" 6, "8" 8 "10" 10, "8" 12, "6" 14, "4" 16, "2" 18, "0" 20)

Best


Gavin
Jörg Buchholz
2021-06-07 09:30:15 UTC
Permalink
Post by Abhi Shek
Hi All,
I would like to have my x-axis tics marked as 0-10 and then again start decrementing from 10 - 0.
For example, the axis should look like below.
"0 2 4 6 8 10 8 6 4 2 0"
With "multiplot" you can put two plots side by side. Example below:

reset
set yrange [-1:1]
set y2range [-1:1]
set multiplot layout 1,2
set xrange [0:10]
set rmargin 0
plot sin(x)
set rmargin
set lmargin 0
set xrange [10:0]
unset ytics
set y2tics mirror
plot sin(x)
unset multiplot


Jörg

Loading...