#186 Allow set axis lengths explicitly

closed-works-for-me
nobody
None
2
2007-08-25
2007-06-12
Anonymous
No

My suggestion is to allow some sort of "set xlength" command (similarly for 'y' and posibly 'z') that would set explicitly the length of an axis (e.g. in cm). The canvas size should then be calculated accordingly to fit the whole figure, including axis labels.

This is badly needed since currently, with the "set term <type> size <X> <Y>" command, figures with varying label sizes (especially in the 'y' axis) produce varying axis lengths. Having figures with different axis lengths in the same manuscript is aesthetically unappealing.

Presently, the only solution I have been able to find is to change e.g. <Y> by trial an error until you get the desired length (or ratio of lengths between the x and y axis lengths).

Josep

PS: Thanks a lot for making gnuplot, it's such a nice tool!

Discussion

  • Ethan Merritt
    Ethan Merritt
    2007-06-13

    • priority: 5 --> 2
     
  • Ethan Merritt
    Ethan Merritt
    2007-06-13

    Logged In: YES
    user_id=235620
    Originator: NO

    I'm not sure I understand what you are asking for, but I think that you can get what you want in 4.3 by using commands such as
    set term <foo> size 10in, 5in # force canvas size in inches
    set lmargin screen 0.1 # force margin 1in from left edge
    set rmargin screen 0.9 # force margin 1in from right edge
    set bmargin screen 0.1 # same for top and bottom
    set tmargin screen 0.9 #

    Now the x axis (lmargin -> rmargin) will be exactly 8 inches and the y axis will be exactly 4 inches. Is that what you want? Of course, if the range of the axis changes from figure to figure you may want to keep the same horizontal or vertical *scale* rather than the same *length*. To do that you would have to explicitly specify the axis xrange and yrange also.

     
  • Logged In: NO

    Ethan,

    Thank you for your reply. You are right. The 'set [lrtb]margin' command allows me to define the axis length precisely. My only comment is then that it may still be useful to have a command to set the axis length explicitly instead of relying on setting both the canvas and the margin. Just for the sake of simplicity.

    Two more things. First, you mention a 4.3 version in your message but in www.gnuplot.info they say 4.2 is the latest release. The comment is relevant because in version 4.2 the option 'screen' in 'set margin' is not recognised, and margin units are characters by default.

    Second, with the epslatex terminal, the position of the y-label that one gets by default by using 'set ylabel y' is way too far from the axis and does not seem to be affected by the margin size. So I have to offset it manually, as in 'set ylabel offset +5,0' to place it closer to the axis and make the plot look nicer. Do you know if this on purpose or a bug?

    Thanks again,
    Josep
    e-mail: josep.sempau@upc.es

     
  • Ethan Merritt
    Ethan Merritt
    2007-07-03

    Logged In: YES
    user_id=235620
    Originator: NO

    Yes, version 4.2 was the most recent release, in March 2007. "Version 4.3" is the ongoing development version in CVS on SourceForge. It will eventually be released as either 4.4 or 5.0. Instructions for building gnuplot from the CVS source code are provided on the web site.

    As to the y axis label, it is affected also by the width of the format used for y-axis tic labels. For example if you do
    set format y ""
    then the y label will be closer to the axis. Of course, then you won't have any tic labels. Other factors include [as I recall] the font size, the tic scale, and the text rotation angles. Anyhow, the program tries to construct a reasonable placement based on what it knows. You may not agree with it, but that's what the "offset" option is for.

     
  • Ethan Merritt
    Ethan Merritt
    2007-08-10

    • status: open --> pending-works-for-me
     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
    • status: pending-works-for-me --> closed-works-for-me