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

Home » Public Forums » archive » Re: problems printing labels on graphs
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: problems printing labels on graphs [message #14644] Tue, 16 March 1999 00:00
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Stu wrote:
> Actually the more I look at this problem, the more I think it is an IDL bug, either
> that or something
> REALLY obscure. I have actually managed to get the labels printed each time under
> some circumstances. What I have is something like:
>
> old_dev=!D.NAME
> :
> :
> program
> :
> :
> IF old_dev NE !D.NAME THEN BEGIN
> DEVICE,/CLOSE
> SET_PLOT, old_dev
> ENDIF

Stu,

Try creating a test program that reproduces the problem with the minimum
number of lines of code. If you can condense it down to 10 lines or less
and the problem persists, then you can be more confident that it's an
IDL bug (post the code to the group). However often times in the
condensing process, the problem will go away....

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
Re: problems printing labels on graphs [message #14647 is a reply to message #14644] Tue, 16 March 1999 00:00 Go to previous message
Stu is currently offline  Stu
Messages: 5
Registered: March 1999
Junior Member
David Fanning wrote:

> R.Bauer (R.Bauer@fz-juelich.de ) writes:
>
>>
>>
>> Stu wrote:
>>
>>> hello,
>>>
>>>> I have written an IDL procedure for displaying some data I have, this
>>>> basically consists of displaying a grey-scale image (using TV), and then
>>>> plotting a line graph directly below this image using PLOT. This data can
>>>> be displayed on the screen or written to a PS or EPS file. The procedure
>>>> also has the ability to change the type of font used (e.g. vector fonts,
>>>> true type fonts, or hardware/device fonts {e.g. postscript}), and by using
>>>> TITLE, SUBTITLE, XTITLE, and YTITLE, titles can be added to the axes and
>>>> various parts of the plot.
>>>>
>>>> The procedure works correctly when displaying data to the screen, all the
>>>> labels are printed correctly and the correct fonts are displayed. When
>>>> writing to a file, the titles are only displayed when the procedure is
>>>> called for the first time. I have to quit IDL and restart it each time in
>>>> order for the titles to be printed on the plot. Note: this only seems to
>>>> apply to vector and true type fonts, it is not necessary to quit each time
>>>> when using postscript fonts - although the titles are printed each time,
>>>> they're not printed in the correct place.
>>>>
>>> Anyone any ideas?
>>> cheers,
>>> Stu
>>
>> Did you close the device by device ,/close
>
> Oh, good idea! :-)
>
> This is clearly a programming error, not an IDL error.
> I would bet some money on that!
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting
> Phone: 970-221-0438 E-Mail: davidf@dfanning.com
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Toll-Free IDL Book Orders: 1-888-461-0155

Yes of course I used DEVICE, /CLOSE and DEVICE,/CLOSE_FILE!

Actually the more I look at this problem, the more I think it is an IDL bug, either
that or something
REALLY obscure. I have actually managed to get the labels printed each time under
some circumstances. What I have is something like:

old_dev=!D.NAME
:
:
program
:
:
IF old_dev NE !D.NAME THEN BEGIN
DEVICE,/CLOSE
SET_PLOT, old_dev
ENDIF

Normally !D.NAME would be 'X' when the procedure is first run, it would only be
changed during the course of the procedure when printing to a file, if the device
is changed it is closed and plotting is redirected to the old device before the
procedure quits, as above. I discovered (by chance) if I do a SET_PLOT, 'PS'
before running the procedure for the first time I can get labels printed on the
plots each time I run the procedure. But the PS device isn't being closed until I
rerun the procedure to generate the next plot. Oddly, if I now sent the output to
a window, the labels aren't printed in the window!?

So are there any "hidden variables" in IDL that control if labels are printed to
the X/PS devices?

Stu
Re: problems printing labels on graphs [message #14655 is a reply to message #14644] Mon, 15 March 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
R.Bauer (R.Bauer@fz-juelich.de ) writes:

>
>
> Stu wrote:
>
>> hello,
>>
>>> I have written an IDL procedure for displaying some data I have, this
>>> basically consists of displaying a grey-scale image (using TV), and then
>>> plotting a line graph directly below this image using PLOT. This data can
>>> be displayed on the screen or written to a PS or EPS file. The procedure
>>> also has the ability to change the type of font used (e.g. vector fonts,
>>> true type fonts, or hardware/device fonts {e.g. postscript}), and by using
>>> TITLE, SUBTITLE, XTITLE, and YTITLE, titles can be added to the axes and
>>> various parts of the plot.
>>>
>>> The procedure works correctly when displaying data to the screen, all the
>>> labels are printed correctly and the correct fonts are displayed. When
>>> writing to a file, the titles are only displayed when the procedure is
>>> called for the first time. I have to quit IDL and restart it each time in
>>> order for the titles to be printed on the plot. Note: this only seems to
>>> apply to vector and true type fonts, it is not necessary to quit each time
>>> when using postscript fonts - although the titles are printed each time,
>>> they're not printed in the correct place.
>>>
>> Anyone any ideas?
>> cheers,
>> Stu
>
> Did you close the device by device ,/close

Oh, good idea! :-)

This is clearly a programming error, not an IDL error.
I would bet some money on that!

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: problems printing labels on graphs [message #14665 is a reply to message #14655] Mon, 15 March 1999 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Stu wrote:

> hello,
>
>> I have written an IDL procedure for displaying some data I have, this
>> basically consists of displaying a grey-scale image (using TV), and then
>> plotting a line graph directly below this image using PLOT. This data can
>> be displayed on the screen or written to a PS or EPS file. The procedure
>> also has the ability to change the type of font used (e.g. vector fonts,
>> true type fonts, or hardware/device fonts {e.g. postscript}), and by using
>> TITLE, SUBTITLE, XTITLE, and YTITLE, titles can be added to the axes and
>> various parts of the plot.
>>
>> The procedure works correctly when displaying data to the screen, all the
>> labels are printed correctly and the correct fonts are displayed. When
>> writing to a file, the titles are only displayed when the procedure is
>> called for the first time. I have to quit IDL and restart it each time in
>> order for the titles to be printed on the plot. Note: this only seems to
>> apply to vector and true type fonts, it is not necessary to quit each time
>> when using postscript fonts - although the titles are printed each time,
>> they're not printed in the correct place.
>>
> Anyone any ideas?
> cheers,
> Stu

Did you close the device by device ,/close
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Widget color tables
Next Topic: Maximum memory under Windows NT

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

Current Time: Wed Oct 08 19:09:48 PDT 2025

Total time taken to generate the page: 0.00932 seconds