I am making a map with gnuplot. But, I find that the length of X axis is not equal with the Y axis. For example, the length of X from 0 to 10 is 20 pixels while 15 pixels in Y axis from 1 to 10. Can I directly set X and Y axis same in length? Thanks.

  • It seems you mean the unit length of both axes, not the overall length -- at least if I interpret your comment to @fede.evol's answer correct. Please clarify this also in your question. – mpy Feb 19 '14 at 14:42

This sets the unit length of both axes to the same value:

set size ratio -1

Here is an excerpt from the documentation:

set size ratio <r> ...

The meaning of a negative value for <r> is different. If <r>=-1, gnuplot tries to set the scales so that the unit has the same length on both the x and y axes. This is equivalent to set view equal xy. See set view equal. If <r>=-2, the unit on y has twice the length of the unit on x, and so on.


Try with

set size square

This should set the dimension (not scale) of the two axis to be equal.

  • Thank you for your help. I set different range of X and Y axis with 'set xrange [-15:15]; set yrange [-20:20]'. In this case, I can not get the same length X Y axis with 'set size square'. – HXGuo Feb 19 '14 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.