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

Home » Public Forums » archive » Re: PRINTER device, TV, and image position
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: PRINTER device, TV, and image position [message #28179] Tue, 27 November 2001 08:08 Go to next message
nobody@nowhere.com (S is currently offline  nobody@nowhere.com (S
Messages: 55
Registered: July 2001
Member
On 27 Nov 2001 06:48:09 -0800, Ray Muzic <muzic@uhrad.com> wrote:
> Is it just me or does 'PRINTER' device ignore (x,y)
> position specified in the TV command?
> : TV, Image [, X, Y [, Channel]]
>
> I am trying to put three images next to each other on a page.
> Of course I could make a single array with the composite
> image but that seems unnecessary as the 'PS' device honored
> the "x,y,/centimeters", arguments specified in TV.
> It seems to be more than the 'PRINTER' device just ignoring
> /centimerers since I tried x position of 600 (dots) on a
> 600 dpi printer and the image position was not altered.
>
> Comments?
> Workarounds?
>
> Ray Muzic

I do exactly what you mention, overlaying 1,2 or 3 images on a graph page
using tv and the ps device. You do set the !p.multi correctly? Here's what
I do (some of the commands are other procedures I've written):

;this is the procedure to put an image into the graph window:
;first, you add [1,0,0,0,0] to !p.multi, forcing it not to erase the window
;on the second plot command. then, you use the x,y,xsize=,ysize=, /inches
;keywords to specify that you want the image in a certain place and a certain
;size on the plot window.
;;;;;;;;;;;;;;;;;;;CAN YOU BELIEVE IT? I ACTUALLY DOCUMENTED SOMETHING!!!!!!;;
pro graphpic,edata,graphdata,imagedata
back=!p.multi
!p.multi=back+[1,0,0,0,0] ;this disables clearing plot window.
pgsize, 15 ;this size seems good (in mm, square image).
plot, edata,graphdata,xtitle='Energy (eV)',ytitle='Counts',$
xstyle=1,yrange=[0,1000]
tvscl, rebin(imagedata,186,186),3.7,3.7,xsize=1.8,ysize=1.8,/inches
arrow, 1.8548,550,1.8567,850,/data,/solid
psoff
!p.multi=back
end

--
Steve S.

steve@NOSPAMmailaps.org
remove NOSPAM before replying
Re: PRINTER device, TV, and image position [message #28184 is a reply to message #28179] Tue, 27 November 2001 07:15 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
Ray Muzic wrote:
> Is it just me or does 'PRINTER' device ignore (x,y)
> position specified in the TV command?
> : TV, Image [, X, Y [, Channel]]
>
> I am trying to put three images next to each other on a page.
> Of course I could make a single array with the composite
> image but that seems unnecessary as the 'PS' device honored
> the "x,y,/centimeters", arguments specified in TV.
> It seems to be more than the 'PRINTER' device just ignoring
> /centimerers since I tried x position of 600 (dots) on a
> 600 dpi printer and the image position was not altered.
>
> Comments?
> Workarounds?

I'd use a program such as IMDISP:

http://www.gumley.com/PIP/Free_Software.html

that allows the image position to be specified by a POSITION vector or
the system variable !P.MULTI, e.g.,

entry_device = !d.name
set_plot, 'PRINTER'
!p.multi = [0, 3, 1, 0, 0]
imdisp, dist(256)
imdisp, dist(256)
imdisp, dist(256)
device, /close_document
set_plot, entry_device

IMDISP has other advantages as well:

- Supports WIN, MAC, X, CGM, PCL, PRINTER, PS, and Z graphics devices,
- Image is automatically byte-scaled (can be disabled),
- Custom byte-scaling of Pseudo color images via the RANGE keyword,
- Pseudo (indexed) color and True color images are handled
automatically,
- 8-bit and 24-bit graphics devices are handled automatically,
- Decomposed color settings are handled automatically,
- Image is automatically sized to fit the display (can be disabled),
- Color table splitting via the BOTTOM and NCOLORS keywords,
- Image aspect ratio customization via the ASPECT keyword,
- Resized images can be resampled (default) or interpolated,
- Top down image display via the ORDER keyword (!ORDER is ignored),
- Selectable display channel (R/G/B) via the CHANNEL keyword,
- Background can be set to a specified color via the BACKGROUND keyword,
- Screen can be erased prior to image display via the ERASE keyword,
- Plot axes can be drawn on the image via the AXIS keyword,
- Photographic negative images can be displayed via the NEGATIVE
keyword.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: PRINTER device, TV, and image position [message #28185 is a reply to message #28184] Tue, 27 November 2001 07:14 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning (david@dfanning.com) writes:

> I'd do something like this to get three images centered
> on a landscape page of output:
>
> thisDevice = !D.Name
> keywords = PSWindow(/Printer, /Landscape, Fudge=0.25)
> Set_Plot, 'PRINTER'
> Device, Landscape = keywords.landscape
> Device, _Extra=keywords
> !P.Multi=[0,3,1]
> TVImage, image1, /Keep_Aspect
> TVImage, image2, /Keep_Aspect
> TVImage, image3, /Keep_Aspect
> !P.Multi = 0
> Set_Plot, thisDevice

Whoops! Of course, there would be a CLOSE_DOCUMENT
in there somewhere. :-)

thisDevice = !D.Name
keywords = PSWindow(/Printer, /Landscape, Fudge=0.25)
Set_Plot, 'PRINTER'
Device, Landscape = keywords.landscape
Device, _Extra=keywords
!P.Multi=[0,3,1]
TVImage, image1, /Keep_Aspect
TVImage, image2, /Keep_Aspect
TVImage, image3, /Keep_Aspect
!P.Multi = 0
Device, /Close_Document
Set_Plot, thisDevice

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: PRINTER device, TV, and image position [message #28186 is a reply to message #28185] Tue, 27 November 2001 07:05 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ray Muzic (muzic@uhrad.com) writes:

> Is it just me or does 'PRINTER' device ignore (x,y)
> position specified in the TV command?
> : TV, Image [, X, Y [, Channel]]
>
> I am trying to put three images next to each other on a page.
> Of course I could make a single array with the composite
> image but that seems unnecessary as the 'PS' device honored
> the "x,y,/centimeters", arguments specified in TV.
> It seems to be more than the 'PRINTER' device just ignoring
> /centimerers since I tried x position of 600 (dots) on a
> 600 dpi printer and the image position was not altered.

Lot's of things don't work right in the PRINTER device. :-)

I'd do something like this to get three images centered
on a landscape page of output:

thisDevice = !D.Name
keywords = PSWindow(/Printer, /Landscape, Fudge=0.25)
Set_Plot, 'PRINTER'
Device, Landscape = keywords.landscape
Device, _Extra=keywords
!P.Multi=[0,3,1]
TVImage, image1, /Keep_Aspect
TVImage, image2, /Keep_Aspect
TVImage, image3, /Keep_Aspect
!P.Multi = 0
Set_Plot, thisDevice

You can learn more about how the PRINTER device works
from this article:

http://www.dfanning.com/tips/sendtoprinter.html

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: PRINTER device, TV, and image position [message #28235 is a reply to message #28179] Wed, 28 November 2001 06:54 Go to previous message
muzic is currently offline  muzic
Messages: 5
Registered: December 1994
Junior Member
Steve,

I can do it with the 'PS' device. I am now trying
to add 'PRINTER' device support.

nobody@nowhere.com (Steve Smith<steven_smith>) wrote in message news:<slrna07f0a.84g.nobody@pooh.nrel.gov>...
> On 27 Nov 2001 06:48:09 -0800, Ray Muzic <muzic@uhrad.com> wrote:
>> Is it just me or does 'PRINTER' device ignore (x,y)
>> position specified in the TV command?
>> : TV, Image [, X, Y [, Channel]]
>>
>> I am trying to put three images next to each other on a page.
>> Of course I could make a single array with the composite
>> image but that seems unnecessary as the 'PS' device honored
>> the "x,y,/centimeters", arguments specified in TV.
>> It seems to be more than the 'PRINTER' device just ignoring
>> /centimerers since I tried x position of 600 (dots) on a
>> 600 dpi printer and the image position was not altered.
>>
>> Comments?
>> Workarounds?
>>
>> Ray Muzic
>
> I do exactly what you mention, overlaying 1,2 or 3 images on a graph page
> using tv and the ps device. You do set the !p.multi correctly? Here's what
> I do (some of the commands are other procedures I've written):
>
> ;this is the procedure to put an image into the graph window:
> ;first, you add [1,0,0,0,0] to !p.multi, forcing it not to erase the window
> ;on the second plot command. then, you use the x,y,xsize=,ysize=, /inches
> ;keywords to specify that you want the image in a certain place and a certain
> ;size on the plot window.
> ;;;;;;;;;;;;;;;;;;;CAN YOU BELIEVE IT? I ACTUALLY DOCUMENTED SOMETHING!!!!!!;;
> pro graphpic,edata,graphdata,imagedata
> back=!p.multi
> !p.multi=back+[1,0,0,0,0] ;this disables clearing plot window.
> pgsize, 15 ;this size seems good (in mm, square image).
> plot, edata,graphdata,xtitle='Energy (eV)',ytitle='Counts',$
> xstyle=1,yrange=[0,1000]
> tvscl, rebin(imagedata,186,186),3.7,3.7,xsize=1.8,ysize=1.8,/inches
> arrow, 1.8548,550,1.8567,850,/data,/solid
> psoff
> !p.multi=back
> end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Global chaos (was: Re: can i place a job advert)
Next Topic: Translate simple syntax from Matlab into IDL

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

Current Time: Wed Oct 08 19:33:20 PDT 2025

Total time taken to generate the page: 0.00633 seconds