help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: orient tall with fltk


From: Jose
Subject: Re: orient tall with fltk
Date: Tue, 08 May 2012 11:51:08 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.28) Gecko/20120313 Thunderbird/3.1.20

Hi.

I am still a bit lost and I'd like to learn what I am doing wrong. Please, let me know where I make the mistake in my line of thought. Thanks in advance for your patience.

Let me recap, as I might have not been clear with my problem. My goal is to produce a print in pdf (ultimately with pdflatex, and that is why fltk is a must) with small margins, that is: a paper filled with the figure. The orient command can be used for this, as it is supposed to orient the paper and scale the figure to fit the page with a 0.25 inch border.

Using orient with gnuplot works nicely, whereas with fltk it does not, as the figures are not scaled properly to fill the paper.

What somehow works is to adjust manually the sizes of the figure and the paper so that they are the same, making sure that the size fits in the screen. In this sense one can first define the size of the paper first and then adjust the size of the figure or viceversa. For example:

*Adjusting the size of the paper to the size of the figure:
 ----
 clear all;graphics_toolkit fltk;
 plot (rand (3))
 fig_size=get(gcf,'position')(3:4); %in pixels
 paper_size=fig_size/72; %in inches, gives [7.7778 5.2778]
 border = 0;
 set (gcf,'papertype', '<custom>');
 set (gcf,'paperunits', 'inches');
 set (gcf,'paperorientation','landscape')
 set (gcf,'papersize', paper_size);
 set (gcf,'paperposition', [border, border, (paper_size - 2*border)]);
 print foo1.pdf
 ---

*Adjusting the size of the figure to the paper
----
clear all;graphics_toolkit fltk;
paper_size=[10 6]; %in inches
border = 0;
set (gcf,'papertype', '<custom>');
set (gcf,'paperunits', 'inches');
set (gcf,'paperorientation','landscape')
set (gcf,'papersize', paper_size);
set (gcf,'paperposition', [0, 0, paper_size]);
fig_size=(paper_size-2*border)*72;%in pixels
set (gcf,'position',[0 0 fig_size]);
plot (rand (3))
print foo2.pdf
---

The results are similar in both cases, and although better than using orient, the figure has still somehow large margins even with border=0. Compare the attached foo1.pdf with foo3.pdf, which was generated using the same code but with gnuplot instead of fltk.

On 05/08/2012 12:09 AM, Ben Abbott wrote:

I mean you can output a smaller image/page, and then scale the result using 
ghostscript (or some other utility outside of octave).

Yes, that is what I will do if I don't find a solution from within octave. I will print to a pdf, use for example pdfcrop to automatically remove the excess of margins and InkScape to export to latex.

Thanks again for your patience.

BR
Jose

Attachment: foo1.pdf
Description: Adobe PDF document

Attachment: foo3.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]