0

I would like to plot the graph a function (say y=x) in the range [-10:10] for both axes. If I write

gnuplot> set xrange [-10:10]
unset tics
set border 3
gnuplot> plot x

I get a graph in which the axes are centered on -10, -10, but I would like to have the axis centered in the origin 0, 0. How can I do this? I've tried by setting

set origin 0, 0

but it doesn't work. Thank you.

1
  • set origin is for placing the origin of a subplot on the screen. i.e. You can use it to shift the placement of the entire plot on the screen. Commented May 31, 2013 at 12:58

1 Answer 1

1

You need to use

 set zeroaxis 

You can change the line type and line width by adding linetype n and/or linewidth n

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

2 Comments

Nice. +1 from me. (you can also change the linestyle using ls n).
Works fine for me too. Setting zeroaxis, border 0, tics axis. Thanks

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.