Feature request: availability to change canvas size wile printing with the driver Postscript

Ben Abbott bpabbott at mac.com
Fri Nov 7 05:51:55 CST 2008


On Oct 30, 2008, at 6:57 AM, Ben Abbott wrote:

> On Oct 30, 2008, at 6:01 AM, François Poulain wrote:
>
>> 2008/10/27 Ben Abbott <bpabbott at mac.com>:
>>> For on screen rendering (or for bitmaps), gnuplot does not  
>>> explicitly
>>> control where its windows are displayed, so "position(1:2)" are  
>>> moot.
>>> However, it is possible to tell gnuplot what the width,
>>> "position(3)", and
>>> height, "position(4)" are.
>>>
>>>      set term <terminal type> size <XX> <YY>
>>
>> I am not so sure; it doesn't work on my gnuplot-4.2 :
>> gnuplot> set term wxt size 800 600
>> Terminal type set to 'x11'
>>        undefined variable: size
>>
>> (idem with wxt term)
>
> Strange ... that comes right out of the gnuplot manual and worked fine
> for me when I inserted in into the gnuplot stream produced by Octave.
> I tried x11 and a couple of bitmaps. When I have time to work on this
> I'll post a plot stream for you and others to try out.
>
>>> So, to review, my questions are;
>>>
>>> (1) How does gnuplot relate character width/height of the margins to
>>> points/inches/etc?
>>>
>>> (2) How does gnuplot determine on screen dpi?
>>>
>>> (3) How does gnuplot determine the dpi of bitmap output?
>>
>> I don't know gnuplot, but a fast look in source code told me this is
>> hardcoded:
>> ~/gnuplot-4.2.2$ grep "dpi\|\ 640" src/* -R -C1
>> src/beos/GPBitmap.h-//int gX = 100, gY = 100;
>> src/beos/GPBitmap.h://unsigned int gW = 640, gH = 450;
>> src/beos/GPBitmap.h-
>> --
>> src/gplt_x11.c-static int gX = 100, gY = 100;
>> src/gplt_x11.c:static unsigned int gW = 640, gH = 450;
>> src/gplt_x11.c-static unsigned int gFlags = PSize;
>> --
>> src/NeXT/GnuView.h-						/* This is the coordinate system defined in
>> next.trm.				*/
>> src/NeXT/GnuView.h:#define NEXT_XMAX 640
>> src/NeXT/GnuView.h-#define NEXT_YMAX 480
>> --
>> src/term.c-
>> src/term.c:/* resolution in dpi for converting pixels to size units  
>> */
>> src/term.c-int gp_resolution = 72;
>> --
>> src/wxterminal/wxt_gui.cpp-			title.Printf(wxT("Gnuplot (window id :
>> %d)"), window.id);
>> src/wxterminal/wxt_gui.cpp:		window.frame = new wxtFrame( title,
>> window.id, 50, 50, 640, 480 );
>> src/wxterminal/wxt_gui.cpp-		window.frame->Show(true);
>>
>> François
>
> hmm ... it appears the gnuplot treats points and pixels in the same
> way (72dpi).  That is simple enough.
>
> Ben

I'm not making much headway on this (lack of sufficient free time). If  
any one is inspired to do so, feel free to dive into this. Otherwise,  
I'll continue at my current tortoise pace ;-)

However, I did look at the gnuplot 4.3 manual (I've been looking at  
4.2) and found this

--------------------
In version 4.3 almost all terminals now behave as follows:
set term <terminal type> size <XX>, <YY> controls the size of the  
output file, or "canvas".
Please see individual terminal documentation for allowed values of the  
size parameters. By default, the
plot will fill this canvas.

set size <XX>, <YY> scales the plot itself relative to the size of the  
canvas. Scale values less than
1 will cause the plot to not fill the entire canvas. Scale values  
larger than 1 will cause only a portion of
the plot to fit on the canvas. Please be aware that setting scale  
values larger than 1 may cause problems
on some terminal types.
--------------------

I haven't determined what "almost all terminals" means, but it appears  
possible to control the figure size and size of the axis for "almost  
all terminals".

Ben







More information about the Bug-octave mailing list