1

Gnuplot 5 on Raspberry Pi.

How can I duplicate the y-axis text (-1, -0.8 etc) on both the left and the right sides of the graph?

This is the code used to create it:

set key fixed left top vertical Right noreverse enhanced autotitle box lt black linewidth 1.000 dashtype solid
unset parametric
set samples 50, 50
set title "Simple Plots" 
set title  font ",20" textcolor lt -1 norotate
set colorbox vertical origin screen 0.9, 0.2 size screen 0.05, 0.6 front  noinvert bdefault
plot [-10:10] sin(x)

enter image description here

2 Answers 2

2

Probably, the gnuplot intended solution is maybe

reset session
set link y2
set y2tics
plot sin(x)

They2-axis will be linked 1:1 to the y-axis, apparently with the same tic distances and labels. Check help link.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks theozh. Your solution works, and it's an improvement over the previous solution because I don't have to manually scale the right hand text.
1

You can add an y2-axis and give it the same range and tics frequency as your y-axis:

set y2range [-1:1]

set y2tics 0.2 # tells gnuplot to make tics with +0.2 increment

This code should do what you want, but you have to write the range and increment manually. Maybe it is sufficient for you, if not, I'll look for more complex solution.

1 Comment

Thanks very much for that suggestion, when adjusted for my real data it does the job very nicely!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.