From: Daniel J S. <dan...@ie...> - 2004-06-05 16:25:17
|
Lutz Maibaum wrote: >Thank you very much for your explanations, Ethan and Hans. It seems that the >"size" setting has very different effects when evaluated by "set multiplot" >and by the plot command. It would be nice if this dual meaning could be >mentioned in the help entry of "set size". > > Lutz > > Since this topic has come up... I've thought for a while that a tutorial of plot layout would be a nice thing. Something that illustrates the view, how size behaves, how coordinates behave, how labels get placed, etc. But I'll put that in the "longterm" bin, i.e., maybe if ever some free time. Anyway, the immediate issue is the difficulty in which to get multiplots laid out in anything but the default manner. I'll give an example to illustrate the frustration. I recently created a plot for which I wanted the following 1) 6 x 1 configuration, i.e., six plots stacked vertically. 2) Tic marks outside the borders because otherwise they would interfere with what is in the plot. 3) All six plots share the same x-axis. Hence, to free up space, I wanted only the bottom plot to have units and tic marks. 4) I wanted just one y-axis label, centered somewhere between the third and fourth plots. OK, it is #3 that really poses the problem. Here is a string of commands that basically captures the ideas I used to lay out the multiplot: set multiplot unset key unset xlabel unset xtics set tics out set size 0.95,0.3 set origin 0.05,0.7 plot sin(x) set origin 0.05,0.4 plot sin(x+0.78540) set origin 0.05,0.0 set xtics nomirror set xlabel "time (s)" set label 1 "amplitude" at screen 0.03,0.53 center rotate front plot sin(x+1.5708) unset multiplot However, I had to do some tweaking of dimensions, but I left that undone here for illustration. If you enter these commands, you'll see what the main issue is. That bottom plot is different in terms of label configuration. The way gnuplot works, when one says "size" it refers to the overall dimension of the plot *including* labels. Hence, that bottom plot comes out smaller than all the rest. No problem, you say. Just issue a different size for the bottom plot, maybe set size 0.95,0.4 Sure, but try it. The trial an error process soon got the best of me. You want the borders to be the same dimension (adjusting "size"), and you want the spacing between plots to be just right (adjusting "origin"), and you want the xlabel to not go too far off the view (adjusting "size" and "origin" again). One could remove the xlabel and instead put another "label 2", but there is still the units and tics. OK, if you've looked at the result of the commands above, you can imagine tweaking things with relative ease to get it to look right. But now try getting things as you want using the "pslatex" terminal. This isn't WYSIWYG, so it is the whole process over again; and this time one has to generate pslatex, compile tex, generate pslatex, compile tex, etc. And you sort of need the X11 layout as a guide. If you compare the layout parameters for proper pslatex layout, the X11 view looks like a mish-mash of overlapping plots and labels. I eventually got what I wanted, and it looks great. But it sure took enough time. Bottom line: can anyone think of a syntax and scheme that would allow better control for this? For example, just as "coordinates" have a "system" reference (i.e., `first`, `second`, `graph` or `screen`) could it be possible for "size" to reference 'border' or 'overall' or something like that. The idea would be for some way to have the borders of your plots be exactly the size you specify. I don't think I'm overlooking anything that would have made life simple here. Thoughts? Dan |