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

Home » Public Forums » archive » Re: questions regarding using cgWindow, cgLoadCT, and something else
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: questions regarding using cgWindow, cgLoadCT, and something else [message #78109] Thu, 27 October 2011 14:39 Go to next message
Bill Murong is currently offline  Bill Murong
Messages: 3
Registered: October 2011
Junior Member
Thank you very much for the help and the fix.

About the PS font problem, you can find a figure converted from a ps file from

https://lh4.googleusercontent.com/-NKlI5Se06t0/TqnN3NYCkRI/A AAAAAAAABU/2xbcSNP1zRA/s800/ps.jpg

The corresponding command to generate the figure is:

cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], yticks = 1, /window

and then save the window as jpeg via ImageMagick. You can note the tick marks of y axis are not displayed correctly. There is no problem with the Heyshey font or TrueType fonts.

Bill


>
>> My final question is regarding using postscript font in IDL 7.0. When
>> I generate a postscript file with ps font, the "multiple" sign cannot
>> be displayed correctly (displayed as a "dot"); e.g., 6x10^5 will be
>> displayed as 6*10^5. I have tried this on various computers with both
>> Win and Mac. All give the same results.
>
> I guess I'm not sure what you mean. I tried this:
>
> cgplot, cgdemodata(1), title='Something 6x10^5', /window
>
> And it seemed to work perfectly in PostScript when I created the
> PostScript file. Can you provide an example that is failing
> for you?
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78110 is a reply to message #78109] Thu, 27 October 2011 12:58 Go to previous messageGo to next message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
Sometimes software problems stem from a simple lack of $s.
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78111 is a reply to message #78110] Thu, 27 October 2011 10:52 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bill Murong writes:

> A second quesiton I'm having is when I issue the command: "cgloadct,
> 13, /addcmd". It will pop up two resizable windows: one with black
> background and one with white background.

This turned out to be a typo on line 231, in which I forgot
to add a line continuation character. Fixed now:

http://www.idlcoyote.com/programs/cgloadct.pro

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78112 is a reply to message #78111] Thu, 27 October 2011 10:24 Go to previous messageGo to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On 10/27/11 12:32 PM, Bill Murong wrote:
> Hi,
>
> I'm a beginner of using David's cgWindow. I'm wondering how to
> display two images using two different color tables in a cgWindow?
> I've tried a few things, but all failed.
>
> A second quesiton I'm having is when I issue the command: "cgloadct,
> 13, /addcmd". It will pop up two resizable windows: one with black
> background and one with white background.
>
> My final question is regarding using postscript font in IDL 7.0. When
> I generate a postscript file with ps font, the "multiple" sign cannot
> be displayed correctly (displayed as a "dot"); e.g., 6x10^5 will be
> displayed as 6*10^5. I have tried this on various computers with both
> Win and Mac. All give the same results.
>
> I'm wondering whether someone can help me with these IDL questions.
> Many thanks in advance.
>
> Bill

The easiest way is using the RGB_TABLE keyword to cglaodct to get the
table out, and the PALETTE keyword in cgimage to display it:

image = cgdemodata(18)
cgwindow
cgloadct, 4, rgb_table=table1
cgloadct, 13, rgb_table=table2
cgimage, image, palette=table1, /window, layout=[2,1,1]
cgimage, image, palette=table2, /addcmd, layout=[2,1,2]

-Jeremy.
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78113 is a reply to message #78112] Thu, 27 October 2011 10:25 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bill Murong writes:

> I'm a beginner of using David's cgWindow. I'm wondering how to
> display two images using two different color tables in a cgWindow?
> I've tried a few things, but all failed.

cgLoadCT, 5, RGB_TABLE=pal_1
cgLoadCT, 33, RGB_TABLE=pal_2
cgWindow, WMulti=[0,2,1]
cgControl, Execute=0
cgImage, cgDemoData(5), PALETTE=pal_1, /AddCmd
cgImage, cgDemoData(7), PALETTE=pal_2, /AddCmd
cgControl, Execute=1

> A second quesiton I'm having is when I issue the command: "cgloadct,
> 13, /addcmd". It will pop up two resizable windows: one with black
> background and one with white background.

That's weird. I'll look into that. :-)

It is probably because there is no cgWindow at first, so it has to
create one to "add itself to", then, cgLoadCT actually sends a
command to a window to "load colors". This is probably generating
a second window because it didn't realize it had just created one!

Anyway, it sounds broken. I'll fix it. :-)

> My final question is regarding using postscript font in IDL 7.0. When
> I generate a postscript file with ps font, the "multiple" sign cannot
> be displayed correctly (displayed as a "dot"); e.g., 6x10^5 will be
> displayed as 6*10^5. I have tried this on various computers with both
> Win and Mac. All give the same results.

I guess I'm not sure what you mean. I tried this:

cgplot, cgdemodata(1), title='Something 6x10^5', /window

And it seemed to work perfectly in PostScript when I created the
PostScript file. Can you provide an example that is failing
for you?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78199 is a reply to message #78110] Fri, 28 October 2011 07:31 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Oct 27, 3:58 pm, Brian Wolven <brian.wol...@gmail.com> wrote:
> Sometimes software problems stem from a simple lack of $s.

Whoa! If that doesn't get a coder a lifetime membership in IDL's EPA
then what does it take?
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78204 is a reply to message #78199] Thu, 27 October 2011 18:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bill Murong writes:

> I think I would prefer to have IDL do this kind of low-level job
> automatically for us. :)

Yeah, well, then every Joe Shmo could be a programmer,
and some of us would have to get real jobs. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78205 is a reply to message #78204] Thu, 27 October 2011 16:51 Go to previous message
Bill Murong is currently offline  Bill Murong
Messages: 3
Registered: October 2011
Junior Member
I think I would prefer to have IDL do this kind of low-level job
automatically for us. :)

Thanks,

Bill



On Oct 27, 3:59 pm, David Fanning <n...@dfanning.com> wrote:
> Bill Murong writes:
>> About the PS font problem, you can find a figure converted from a ps file from
>
>> https://lh4.googleusercontent.com/-NKlI5Se06t0/TqnN3NYCkRI/A AAAAAAAAB...
>
>> The corresponding command to generate the figure is:
>
>> cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], yticks = 1, /window
>
>> and then save the window as jpeg via ImageMagick.  You can note the tick marks of y axis are not displayed correctly.  There is no problem with the Heyshey font or TrueType fonts.
>
> This will work for your original question:
>
> t = ['6x10!A-4!x', '7x10!A-4!x']
> cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], $
>    yticks = 1, ytickname=t, /window
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78207 is a reply to message #78109] Thu, 27 October 2011 15:59 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bill Murong writes:

> About the PS font problem, you can find a figure converted from a ps file from
>
> https://lh4.googleusercontent.com/-NKlI5Se06t0/TqnN3NYCkRI/A AAAAAAAABU/2xbcSNP1zRA/s800/ps.jpg
>
> The corresponding command to generate the figure is:
>
> cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], yticks = 1, /window
>
> and then save the window as jpeg via ImageMagick. You can note the tick marks of y axis are not displayed correctly. There is no problem with the Heyshey font or TrueType fonts.

This will work for your original question:

t = ['6x10!A-4!x', '7x10!A-4!x']
cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], $
yticks = 1, ytickname=t, /window

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78208 is a reply to message #78109] Thu, 27 October 2011 15:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bill Murong writes:

> About the PS font problem, you can find a figure converted from a ps file from
>
> https://lh4.googleusercontent.com/-NKlI5Se06t0/TqnN3NYCkRI/A AAAAAAAABU/2xbcSNP1zRA/s800/ps.jpg
>
> The corresponding command to generate the figure is:
>
> cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = [6e-9, 7e-4], yticks = 1, /window
>
> and then save the window as jpeg via ImageMagick. You can note the tick marks of y axis are not displayed correctly. There is no problem with the Heyshey font or TrueType fonts.

Ah, yes, the proper labeling of logarithmic axes has
been a problem since the beginning of time. Or, at least,
the beginning of IDL:

http://www.idlcoyote.com/graphics_tips/minorlog.html

You may wish to use the LogLevels function described in
the article above. Something like this, probably:

cgplot, [1e-10, 1], /ystyle, /ylog, ytickv = LogLevels(), /window

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: ENVI Navigating GeoTiff Image Incorrectly?
Next Topic: Re: questions regarding using cgWindow, cgLoadCT, and something else

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

Current Time: Wed Oct 08 09:13:49 PDT 2025

Total time taken to generate the page: 0.00642 seconds