|
From: Anthony T. <A.T...@gr...> - 2010-03-24 00:57:45
|
On Tue, 23 Mar 2010 14:57:00 -0700 Ethan Merritt <merritt@u.washington.edu> wrote: | On Monday 22 March 2010 23:34:34 Anthony Thyssen wrote: | > | How to generate a graph image of specific size without labels? | > | | > | that is I what the 'border' of the plot to be the 'border' of the | > | final image that is of specific size. It is vital for including | > | the plot results into other image mosaics. | > | | > | > With suggestions from Daniel J Sebald I am posting the method | > which I used with gnuplot v4.2.3-1 under Fedora 10. | > | > The script broke with a OS version upgrade to gnuplot v4.2.6-1 | > under fedora 12 | > | > | > set terminal png size 340,210 | > unset key | > set format "" | > set xtics ( 75, 150, 225 ) scale 2 | > set ytics ( 0.25, 0.5, 0.75 ) scale 2 | > set xrange [0:300] | > set yrange [0:1] | > | > The 'size' was designed to actually generate a 'graph' that was | > exactly 300x184 pixels in size after it is 'autocroped' using | > ImageMagick. | | Your script is not doing what you stated that you wanted to do. | If you want to guarantee that the plot boundary is a particular | size, you should do that directly. You can't rely on auto-crop | because the size will change depending on at least the font size, | if not the phase of the moon. | Yes I know, that is because I was NOT able to figure out how to get an exact sized image, and had to fudge it. I am not suprised it broke! But that is why I asked the mail list. | If you really have no labels or other plot decorations outside | of the plot borders, then you want: | | set term png size 340,210 | set lmargin at screen 0 | set rmargin at screen 1 | set bmargin at screen 0 | set tmargin at screen 1 | | If for some reason you want to work with some white space around it, | and then later crop to final size: | | set term png size 374,231 # NB: 10% bigger than the final size | set lmargin at screen 0.05 | set rmargin at screen 0.95 | set bmargin at screen 0.05 | set tmargin at screen 0.95 | I remember trying to use the 'margin' settings, but without success. however I'll try again now. -- YES it is now working!!! The first block is what I was needing. Perhaps this should be in the FAQ :-) | > Now both versions generate a image 340x210 pixels but the | > graph area which was 300x184 pixels | > is now under gnuplot v4.2.6-1 producing 292x171 pixels | > | > In another example a gnuplot "png size" of | > was producing 150x89 pixel graph | > is now producing 142x76 | | Right. That method was never reliable. | That's why we added a mechanism for specifying the boundaries | precisely. | It worked, but I didn't think it was reliable. | -- | Ethan A Merritt | Biomolecular Structure Center | University of Washington, Seattle 98195-7742 Anthony Thyssen ( System Programmer ) <A.T...@gr...> -------------------------------------------------------------------------- The warrior didn't speak, for his mouth was full. -- "Kung Fu Panda" -------------------------------------------------------------------------- Anthony's Castle http://www.cit.griffith.edu.au/~anthony/ |