How to plot x-axis tics [0 - 10 10 - 0]

14 views
Skip to first unread message

Abhi Shek

unread,
Jun 4, 2021, 8:05:17 AM6/4/21
to
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

unread,
Jun 4, 2021, 1:43:29 PM6/4/21
to
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

unread,
Jun 7, 2021, 5:30:18 AM6/7/21
to

On 04.06.2021 14:05, Abhi Shek wrote:
> 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
Reply all
Reply to author
Forward
0 new messages