|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Axis labels in EPS figure are outside bounding boxDear all
The below code example produces an eps file containing a simple figure. The resulting eps file is attached. The problem is that the axis labels are cut off, i.e. they are partially outside the bounding box of the figure. What am I doing wrong? What can I do to circumvent this problem? (Octave 3.2.0 on Mac OS X 10.5, gnuplot 4.2 patchlevel 5) --------------- plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); fs = 18; set (gca,'fontsize',fs); xlabel ('x label','fontsize',fs); ylabel ('y label','fontsize',fs); print ('testy.eps','-depsc','-S500,400'); --------------- ---- Matthias Brennwald, Käferholzstrasse 173, CH-8046 Zürich, +41 44 364 17 03 _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Axis labels in EPS figure are outside bounding boxOn Oct 17, 2009, at 4:33 PM, Matthias Brennwald wrote: > Dear all > > The below code example produces an eps file containing a simple > figure. The resulting eps file is attached. The problem is that the > axis labels are cut off, i.e. they are partially outside the > bounding box of the figure. What am I doing wrong? What can I do to > circumvent this problem? > > (Octave 3.2.0 on Mac OS X 10.5, gnuplot 4.2 patchlevel 5) > > --------------- > plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); > fs = 18; > set (gca,'fontsize',fs); > xlabel ('x label','fontsize',fs); > ylabel ('y label','fontsize',fs); > print ('testy.eps','-depsc','-S500,400'); > --------------- > > <testy.eps> Mac OSX 10.6. I see no clipping. Running your script produces the attached eps-file. Upgrading your Octave to a more recent version should fix the problem for you. You can down load 3.2.3 at the link below. http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary Ben _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Axis labels in EPS figure are outside bounding boxI can confirm this issue on a Mac Air running
Mac OS X 10.5 Leopard Octave 3.2.0 gnuplot 4.2 patch level 5 In general, axis labels are cut-off in figures generated running the plot command from Octave. If the data is exported via ------------------------------------ save -ascii plot.dat plotvar; ------------------------------------ where 'plotvar' is a nx2 matrix with the first column the x-data and the second column the y-data, then plotted using gnuplot directly (either via command line or batch file) the plots look just fine. Regards, Bryan 2009/10/17 Matthias Brennwald <matthias@...>: > Dear all > > The below code example produces an eps file containing a simple figure. The > resulting eps file is attached. The problem is that the axis labels are cut > off, i.e. they are partially outside the bounding box of the figure. What am > I doing wrong? What can I do to circumvent this problem? > > (Octave 3.2.0 on Mac OS X 10.5, gnuplot 4.2 patchlevel 5) > > --------------- > plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); > fs = 18; > set (gca,'fontsize',fs); > xlabel ('x label','fontsize',fs); > ylabel ('y label','fontsize',fs); > print ('testy.eps','-depsc','-S500,400'); > --------------- > > > > > ---- > Matthias Brennwald, Käferholzstrasse 173, CH-8046 Zürich, +41 44 364 17 03 > > > _______________________________________________ > Help-octave mailing list > Help-octave@... > https://www-old.cae.wisc.edu/mailman/listinfo/help-octave > > _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Axis labels in EPS figure are outside bounding boxon 10/17/09 2:08 PM, Ben Abbott at bpabbott@... wrote: > > On Oct 17, 2009, at 4:33 PM, Matthias Brennwald wrote: > >> Dear all >> >> The below code example produces an eps file containing a simple >> figure. The resulting eps file is attached. The problem is that the >> axis labels are cut off, i.e. they are partially outside the >> bounding box of the figure. What am I doing wrong? What can I do to >> circumvent this problem? >> >> (Octave 3.2.0 on Mac OS X 10.5, gnuplot 4.2 patchlevel 5) >> >> --------------- >> plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); >> fs = 18; >> set (gca,'fontsize',fs); >> xlabel ('x label','fontsize',fs); >> ylabel ('y label','fontsize',fs); >> print ('testy.eps','-depsc','-S500,400'); >> --------------- >> >> <testy.eps> > > I'm able to run Octave 3.2.2 or the most recent developers sources on > Mac OSX 10.6. I see no clipping. > > Running your script produces the attached eps-file. > > Upgrading your Octave to a more recent version should fix the problem > for you. You can down load 3.2.3 at the link below. > > http://sourceforge.net/projects/octave/files/Octave%20MacOSX%20Binary > > Ben > octave-3.2.2:1> plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); octave-3.2.2:2> fs = 18; octave-3.2.2:3> set (gca,'fontsize',fs); octave-3.2.2:4> xlabel ('x label','fontsize',fs); octave-3.2.2:5> ylabel ('y label','fontsize',fs); Y-label OK but no X-label. Saved as PDF, see attached. Henry _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Axis labels in EPS figure are outside bounding box2009/10/17 Ben Abbott <bpabbott@...>
Dear Ben et al I downloaded Octave 3.2.3 from the above link and installed it. Sure enough, the labels are now fully inside the bounding box. However, the figure is much larger now. To get about the same size as with 3.2.0 I have to change the last line in my above code example to: print ('testy.eps','-depsc','-S320, 250'); With this, the labels are outside the bounding box again... what's going on here? Black magic? Is there another (and more reproducible) way to produce a plot with a given size (height/width) and matching font size? Matthias _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
Re: Axis labels in EPS figure are outside bounding box2009/10/17 Ben Abbott <bpabbott@...>
Dear Ben et al I should read manuals more often. Here's what's wrong with the above example: 1. In the documentaion of print(...), the -SXSIZE,YSIZE option is not listed for EPS. While this option does work somehow, it may not be properly implemented or supported for EPS. So its propably better not to use it. 2. The size of the EPS figure (the bounding box) is determined from the figure's 'paperposition' property (this is also in the print(...) documentation). So, the 'paperposition' property needs to be set as desired (or, alternatively, 'outerposition' might be useful, too). 3. The position of the figure axes within the bounding box can be set with the 'position' property of the axes. So, with this information, I modified my previous example as follows: --------- plot (sin ([0:100]/10)); axis ([0 100 -1.1 1.1]); fs = 18; set (gca,'fontsize',fs); xlabel ('x label','fontsize',fs); ylabel ('y label','fontsize',fs); set (gca,'position',[0.2 0.2 0.7,0.7]); % set bottom-left position, width and height of figure relative to bounding box (=window box) set (gcf,'paperposition',[0 0 3 2]); % paperposition is used to determine size of figure in the file print ('testy2.eps','-depsc'); --------- This does what I need. Maybe this is useful to others, so I thought I'd share it. However, I could not find an explanation of the 'paperposition' property in the manual. I had to guess (which was not very difficult), and it would be nice if it would be included in the manual. Matthias _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
| Free embeddable forum powered by Nabble | Forum Help |