comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Postscript device coordinates
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Postscript device coordinates [message #50069] Thu, 31 August 2006 10:59
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
Oh - that's nice. Looks like 1000's just right. Now that doesn't happen
often!

many thanks,
Greg
Re: Postscript device coordinates [message #50070 is a reply to message #50069] Thu, 31 August 2006 10:51 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <1157045037.993836.3160@e3g2000cwe.googlegroups.com>,
greg michael <greg.michael@gmail.com> wrote:
>
> I'm trying to make a plot with an exact print-size - 2 cm per tick mark
> - using the PS device.
>
> Setting up the plot window works ok:
>
> set_plot,'PS'
>
> xrange=[-3,1]
> yrange=[-4,2]
> xticks=xrange[1]-xrange[0]
> yticks=yrange[1]-yrange[0]
>
>
> device,/encapsulated,filename="test.eps",/helvetica,xsize=xticks*2.+3.,ysize=yticks*2.+3.
>
> Then I hoped to be able to specify the plot region in centimetres using
> 'position':
>
>
> plot,[0],[0],/nodata,xrange=10.^xrange,/xlog,yrange=10.^yran ge,/ylog,/isotropic,$
> position=[2.,2.,2.+xticks*2.,2.+yticks*2.],/device,$
> xticks=xticks,yticks=yticks
>
> device,/close_file
>
> Seems the device coordinates are not cm, since all I get is a spot in
> the bottom left corner. By trial and error, I find that if I multiply
> the position array by 1000, I get more or less something which fills
> the window. But I don't know where this 1000 figure comes from: does
> anyone know what it means? And how I can calculate the exact value?
>
> many thanks,
> Greg

IDL> set_plot,'PS'
IDL> print, !D.X_PX_CM
1000.00
IDL> print, !D.Y_PX_CM
1000.00

IDL help says these variables are the approximate number of pixels per centimeter in the X and Y directions.


--Mike
Re: Postscript device coordinates [message #50071 is a reply to message #50070] Thu, 31 August 2006 10:49 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 31 Aug 2006, greg michael wrote:

>
> I'm trying to make a plot with an exact print-size - 2 cm per tick mark
> - using the PS device.
>
> Setting up the plot window works ok:
>
> set_plot,'PS'
>
> xrange=[-3,1]
> yrange=[-4,2]
> xticks=xrange[1]-xrange[0]
> yticks=yrange[1]-yrange[0]
>
>
> device,/encapsulated,filename="test.eps",/helvetica,xsize=xticks*2.+3.,ysize=yticks*2.+3.
>
> Then I hoped to be able to specify the plot region in centimetres using
> 'position':
>
>
> plot,[0],[0],/nodata,xrange=10.^xrange,/xlog,yrange=10.^yran ge,/ylog,/isotropic,$
> position=[2.,2.,2.+xticks*2.,2.+yticks*2.],/device,$
> xticks=xticks,yticks=yticks
>
> device,/close_file
>
> Seems the device coordinates are not cm, since all I get is a spot in
> the bottom left corner. By trial and error, I find that if I multiply
> the position array by 1000, I get more or less something which fills
> the window. But I don't know where this 1000 figure comes from: does
> anyone know what it means? And how I can calculate the exact value?
>
> many thanks,
> Greg
>
>

IDL> set_plot, 'ps'
IDL> help, !d, /str
** Structure !DEVICE, 17 tags, length=84, data length=84:
NAME STRING 'PS'
X_SIZE LONG 17780
Y_SIZE LONG 12700
X_VSIZE LONG 17780
Y_VSIZE LONG 12700
X_CH_SIZE LONG 222
Y_CH_SIZE LONG 352

X_PX_CM FLOAT 1000.00
Y_PX_CM FLOAT 1000.00

N_COLORS LONG 256
TABLE_SIZE LONG 256
FILL_DIST LONG 1
WINDOW LONG -1
UNIT LONG 0
FLAGS LONG 266807
ORIGIN LONG Array[2]
ZOOM LONG Array[2]

regards,
lajos
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Postscript device coordinates
Next Topic: Writing to the IDL prompt?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 14:58:12 PDT 2025

Total time taken to generate the page: 0.71970 seconds