|
From: Anthony T. <A.T...@gr...> - 2010-03-23 06:35:04
|
| Date: Mon, 22 Mar 2010 13:50:29 +1000 | To: gnu...@li... | Subject: How to generate a graph image of specific size without labels? | | 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 it was part of, 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. 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 This naturally breaks my scripts!!! NOTE that I am not generating any title, keys, or other output just the graph itself. Anthony Thyssen ( System Programmer ) <A.T...@gr...> -------------------------------------------------------------------------- "3 billion human lives ended on August 29th, 1997. The survivors of the nuclear fire called the war Judgment Day. They lived only to face a new nightmare, the war against the Machines..." -- "Terminator 2" Movie -------------------------------------------------------------------------- Anthony's Castle http://www.cit.griffith.edu.au/~anthony/ |
|
From: Ethan M. <merritt@u.washington.edu> - 2010-03-23 22:00:34
|
On Monday 22 March 2010 23:34:34 Anthony Thyssen wrote: > > | Date: Mon, 22 Mar 2010 13:50:29 +1000 > | To: gnu...@li... > | Subject: How to generate a graph image of specific size without labels? > | > | 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 it was part of, 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. 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 > 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. hope that helps, Ethan > > This naturally breaks my scripts!!! > > NOTE that I am not generating any title, keys, or other output > just the graph itself. > > > > Anthony Thyssen ( System Programmer ) <A.T...@gr...> > -------------------------------------------------------------------------- > "3 billion human lives ended on August 29th, 1997. The survivors of the > nuclear fire called the war Judgment Day. They lived only to face a new > nightmare, the war against the Machines..." -- "Terminator 2" Movie > -------------------------------------------------------------------------- > Anthony's Castle http://www.cit.griffith.edu.au/~anthony/ > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > gnuplot-beta mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-beta > -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle 98195-7742 |
|
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/ |
|
From: Petr M. <mi...@ph...> - 2010-03-25 21:07:13
|
> | 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 :-) Can you please propose the appropriate text to add? The source code of FAQ is here: http://gnuplot.cvs.sourceforge.net/viewvc/gnuplot/faq/ You can also consider adding an example into the "help margin". --- PM |