#336 set size of graph (i.e. area between axes)

closed-works-for-me
nobody
None
5
2012-07-05
2012-06-27
Chris Gilbreth
No

Hello,

In making multplots, one inconvenience I've been encountering is that "set size" applies to the entire plot, including text labels and margins. This makes it difficult to produces multiplots where the graphs are of identical size. A workaround appears to have been implemented in the form of "set lmargin at graph xxx", which allows one to place the axes of the graph at precise positions on the page. This is helpful, but still requires a lot of fiddling and calculations to make things look nice. If I decide to change the size of the graphs, for instance, I have to change the locations of all the individual axes - quite inconvenient!

I think a very helpful improvement would be to provide a way to set the size of the graphs - e.g. "set graphsize". This would automatically make all the graphs identical in size.

Additionally, it would also be very helpful to allow "set origin" to apply to the graphs too - e.g. "set graphorigin". This would work well in conjuction with "set graphsize".

With these commands, the user could work easily with the sizes and positions of the graphs, which are the principle objects of interest in the output anway. Moreover, they are clearly visible in the output, unlike plot boundaries, which are invisible!

Thanks for the excellent program!

Discussion

  • Ethan Merritt
    Ethan Merritt
    2012-06-28

    Why not define your position in terms of a private scale factor?

    SCALE = foo
    set lmargin at 0.1 * SCALE
    set rmargin at 0.85 * SCALE

    and so on

     
  • Chris Gilbreth
    Chris Gilbreth
    2012-06-29

    Thanks for your response -

    Admittedly something like this occurred to me as I writing the feature request. But the way I thought of it would be

    size = 0.4
    xpos = 0.1
    ypos = 0.1
    set lmargin at screen xpos
    set bmargin at screen ypos
    set rmargin at screen xpos + size
    set tmargin at screen ypos + size

    As a user I wasn't even sure if arithmetic was valid in these expressions (I knew you can use it in functions and plot commands, but I didn't know if set would accept it). So from my perspective this method requires quite a few lines as well as some thought and experimentation, whereas "set graphsize" and "set graphorigin" (or a similar syntax) would be much simpler, and directly express my intent - which I should also think is a very common one.

    I'm not sure how your suggestion works though. Does the "at" keyword work without "screen"? (According to the online help in gnuplot 4.4, "at screen" will work but not "at"). And in your example, SCALE defines the position but not the size.

    What about my statement that "With these commands, the user could work easily with the sizes and positions of the graphs, which are the principle objects of interest in the output anway. Moreover, they are clearly visible in the output, unlike plot boundaries, which are invisible!"

     
  • Ethan Merritt
    Ethan Merritt
    2012-06-29

    I guess I don't understand the distinction you are making between the size of the graph and the size of the plots. Suppose you set SCALE to 0.5. Then if you multiply all references to size or position in your plot commands by SCALE then you will end up with a resulting figure that is half the size of the original. If you similarly multiple linewidths and font sizes by SCALE then they will be scaled to match, which may or may not be what you want.

    Perhaps you could upload or provide a link to an example of the kind of figure you are trying to make? It might help to clarify why the usual multiplot layout commands are not sufficient.

     
  • Ethan Merritt
    Ethan Merritt
    2012-07-05

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