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

Home » Public Forums » archive » Multi-page graphics in IDL 8
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
Multi-page graphics in IDL 8 [message #72384] Thu, 02 September 2010 13:33 Go to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
We frequently use direct graphics and !P.MULTI to generate graphics output
where there are multiple plots on multiple pages. It is not hard to make
this work either to the display or to a PS file. When drawing to the display
you can wait for a <cr> before moving to the next page. When creating PS, you
just draw all the plots to a single file. The PS file can then be easily converted
to a multi-page PDF file.

With the new Graphics system, I can see how to draw multiple plots in a single
window, but not how to create multi-page graphics. Is the concept of multi-page graphics
not part of the new Graphics system?

I can see that it could be done by keeping track of the number of plots in a window and
saving the window to a graphics file when full, etc., but the result is then multiple PDF files
rather than a single file.

Am I missing something? Is there an easy way to do what I need with the New Graphics
system, or do I need to stay with Classic Graphics.

Thanks, Ken Bowman
Re: Multi-page graphics in IDL 8 [message #72485 is a reply to message #72384] Tue, 07 September 2010 11:37 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Chris Torrence wrote:
> On Sep 7, 7:34 am, Paul van Delst <paul.vande...@noaa.gov> wrote:
>> Kenneth P. Bowman wrote:
>>> In article
>>> < 8a5d65d5-be94-4b27-9e97-9ffff6cfe...@u5g2000prn.googlegroups .com >,
>>> Mark Piper <mpi...@ittvis.com> wrote:
>>>> Spawning a call to ImageMagick's 'convert' program will join several
>>>> PS files into a single PDF file:
>>>> infiles = ['plot1.eps', 'plot2.eps']
>>>> infiles = strjoin(infiles, ' ')
>>>> outfile = 'plots.pdf'
>>>> cmd = 'convert -density 300 ' + infiles + ' -quality 100 ' + outfile
>>>> spawn, cmd
>>> Thanks. I'm aware of several ways to concatenate PDF files, but if New
>>> Graphics can't make multi-page documents, it will be a significant loss
>>> of convenience. In fact, I think we will have to stay with Old Graphics
>>> for most purposes.
>> Yeah, no kidding. But, just to clarify (since I don't create PDF files directly from IDL), are you saying that the
>> creation of multi-page postscript files is no longer possible with IDL8 New Graphics?
>>
> Hi Paul & Ken,
>
> In IDL 8.0, multi-page postscript files still work fine, just as they
> did before.

Phewph! :o)


cheers,

paulv
Re: Multi-page graphics in IDL 8 [message #72490 is a reply to message #72384] Tue, 07 September 2010 09:40 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<f5fdd207-0529-4098-b2ca-a699728e0df7@b34g2000yqm.googlegroups.com>,
Chris Torrence <gorthmog@gmail.com> wrote:

> In IDL 8.0, multi-page postscript files still work fine, just as they
> did before.
>
> For the new graphics, we added support for PDF output, but we ran out
> of time to do multi-page output. I have some prototype code that adds
> this feature, if you're interested in trying it out.
>
> Cheers,
> Chris
> ITTVIS

I can continue to use direct graphics for now and wait for an
official release. I'm sure it will take some time to get my
brain to convert to using New Graphics. :-)

Cheers, Ken
Re: Multi-page graphics in IDL 8 [message #72491 is a reply to message #72384] Tue, 07 September 2010 09:33 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <i65f0q$ecm$1@speranza.aioe.org>,
Paul van Delst <paul.vandelst@noaa.gov> wrote:

> Yeah, no kidding. But, just to clarify (since I don't create PDF files directly from IDL), are you saying that the
> creation of multi-page postscript files is no longer possible with IDL8 New Graphics?
>
>
> cheers,
>
> paulv

It may be, but I can't see how. The LAYOUT keyword works similarly
to !P.MULTI, but as far as I can tell it only works for
a single window.

If you want to create multi-page PS or PDF documents you will have
to create each page in a separate window, save to the appropriate
file type, and them concatenate the files/pages using SPAWN or something
similar.

Or use Old Graphics (direct graphics).

I would be happy to be corrected if this is wrong.

Ken
Re: Multi-page graphics in IDL 8 [message #72497 is a reply to message #72384] Tue, 07 September 2010 08:59 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Sep 7, 7:34 am, Paul van Delst <paul.vande...@noaa.gov> wrote:
> Kenneth P. Bowman wrote:
>> In article
>> < 8a5d65d5-be94-4b27-9e97-9ffff6cfe...@u5g2000prn.googlegroups .com >,
>>  Mark Piper <mpi...@ittvis.com> wrote:
>
>>> Spawning a call to ImageMagick's 'convert' program will join several
>>> PS files into a single PDF file:
>
>>> infiles = ['plot1.eps', 'plot2.eps']
>>> infiles = strjoin(infiles, ' ')
>>> outfile = 'plots.pdf'
>>> cmd = 'convert -density 300 ' + infiles + ' -quality 100 ' + outfile
>>> spawn, cmd
>
>> Thanks.  I'm aware of several ways to concatenate PDF files, but if New
>> Graphics can't make multi-page documents, it will be a significant loss
>> of convenience.  In fact, I think we will have to stay with Old Graphics
>> for most purposes.
>
> Yeah, no kidding. But, just to clarify (since I don't create PDF files directly from IDL), are you saying that the
> creation of multi-page postscript files is no longer possible with IDL8 New Graphics?
>
> cheers,
>
> paulv

Hi Paul & Ken,

In IDL 8.0, multi-page postscript files still work fine, just as they
did before.

For the new graphics, we added support for PDF output, but we ran out
of time to do multi-page output. I have some prototype code that adds
this feature, if you're interested in trying it out.

Cheers,
Chris
ITTVIS
Re: Multi-page graphics in IDL 8 [message #72921 is a reply to message #72384] Mon, 18 October 2010 09:43 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Oct 18, 2:09 am, Teddy Allen <teddy.ie...@gmail.com> wrote:
> How did you find out to create multi plots on one window in 8.0?
> Thank you very much for your time.

Besides what David mentioned above, note that you can combine
different layout grids to make non-rectangular multiplots, as show in
one of the examples of the last webinar:

http://groups.google.com/group/comp.lang.idl-pvwave/browse_t hread/thread/a44a227fb6d32cf7/

Also, I am finishing writing a class to provide in the new graphics
functionality like IDLAstro's multiplot does for direct graphics. It
is more flexible than multiplot, allowing to have lines/columns of
different heights/widths, and providing synchronization of axes
properties. It will be out probably sometime this week.
Re: Multi-page graphics in IDL 8 [message #72926 is a reply to message #72384] Mon, 18 October 2010 08:54 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.272579e1c02a14859897c0@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> Teddy Allen writes:
>
>> I am having trouble creating MULTI-PLOT images in the same window with
>> IDL8.0 . From above, you mention that you can produce multiple plots
>> on one image with the new 8.0 . Personally, I am struggling to
>> accomplish this. IDL help menu shows how to do !p.multi using older
>> releases of IDL, NOT with the newest 8.0 version. It makes no sense to
>> me to start using a new release, but have to depend on previous
>> releases to make progress, especially when the things I am trying to
>> do have been updated in 8.0. For example, you probably noticed the new
>> method in 8.0 to produce plots p = PLOT(xxxxxxxxxx) and then we can
>> save the plot by typing P.SAVE ......this to me is VERY easy. But, to
>> use !p.multi it seems like I need to issue plot commands from earlier
>> IDL releases. Bummer!
>
> You want to use the LAYOUT keyword in conjunction with
> the CURRENT keyword.
>
> IDL> p = plot(loaddata(17), layout=[2,2,1])
> IDL> p = plot(loaddata(17), layout=[2,2,2], /current)
> IDL> p = plot(loaddata(17), layout=[2,2,3], /current)
> IDL> p = plot(loaddata(17), layout=[2,2,4], /current)
>
>> How did you find out to create multi plots on one window in 8.0?
>
> I looked up one of the multiple plot examples
> in the on-line help. Then, I mucked around
> until I figured it out. :-)
>
> Cheers,
>
> David

Thanks, David. :-)

Ken
Re: Multi-page graphics in IDL 8 [message #72935 is a reply to message #72384] Sun, 17 October 2010 21:24 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Teddy Allen writes:

> I am having trouble creating MULTI-PLOT images in the same window with
> IDL8.0 . From above, you mention that you can produce multiple plots
> on one image with the new 8.0 . Personally, I am struggling to
> accomplish this. IDL help menu shows how to do !p.multi using older
> releases of IDL, NOT with the newest 8.0 version. It makes no sense to
> me to start using a new release, but have to depend on previous
> releases to make progress, especially when the things I am trying to
> do have been updated in 8.0. For example, you probably noticed the new
> method in 8.0 to produce plots p = PLOT(xxxxxxxxxx) and then we can
> save the plot by typing P.SAVE ......this to me is VERY easy. But, to
> use !p.multi it seems like I need to issue plot commands from earlier
> IDL releases. Bummer!

You want to use the LAYOUT keyword in conjunction with
the CURRENT keyword.

IDL> p = plot(loaddata(17), layout=[2,2,1])
IDL> p = plot(loaddata(17), layout=[2,2,2], /current)
IDL> p = plot(loaddata(17), layout=[2,2,3], /current)
IDL> p = plot(loaddata(17), layout=[2,2,4], /current)

> How did you find out to create multi plots on one window in 8.0?

I looked up one of the multiple plot examples
in the on-line help. Then, I mucked around
until I figured it out. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Multi-page graphics in IDL 8 [message #72936 is a reply to message #72384] Sun, 17 October 2010 21:09 Go to previous message
Teddy Allen is currently offline  Teddy Allen
Messages: 13
Registered: October 2010
Junior Member
On Sep 2, 4:33 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> We frequently use direct graphics and !P.MULTIto generate graphics output
> where there are multiple plots on multiple pages.  It is not hard to make
> this work either to the display or to a PS file.  When drawing to the display
> you can wait for a <cr> before moving to the next page.  When creating PS, you
> just draw all the plots to a single file.  The PS file can then be easily converted
> to amulti-page PDF file.
>
> With the new Graphics system, I can see how to draw multiple plots in a single
> window, but not how to createmulti-page graphics.  Is the concept ofmulti-page graphics
> not part of the new Graphics system?
>
> I can see that it could be done by keeping track of the number of plots in a window and
> saving the window to a graphics file when full, etc., but the result is then multiple PDF files
> rather than a single file.
>
> Am I missing something?  Is there an easy way to do what I need with the New Graphics
> system, or do I need to stay with Classic Graphics.
>
> Thanks, Ken Bowman

Ken,
I am having trouble creating MULTI-PLOT images in the same window with
IDL8.0 . From above, you mention that you can produce multiple plots
on one image with the new 8.0 . Personally, I am struggling to
accomplish this. IDL help menu shows how to do !p.multi using older
releases of IDL, NOT with the newest 8.0 version. It makes no sense to
me to start using a new release, but have to depend on previous
releases to make progress, especially when the things I am trying to
do have been updated in 8.0. For example, you probably noticed the new
method in 8.0 to produce plots p = PLOT(xxxxxxxxxx) and then we can
save the plot by typing P.SAVE ......this to me is VERY easy. But, to
use !p.multi it seems like I need to issue plot commands from earlier
IDL releases. Bummer!
How did you find out to create multi plots on one window in 8.0?
Thank you very much for your time.
cheers,
teddy allen
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: New Graphics Tolerant of Clumsy Fingers!
Next Topic: columns not shown in table widget on Solaris

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

Current Time: Fri Oct 10 13:26:39 PDT 2025

Total time taken to generate the page: 1.75547 seconds