Re: questions regarding using cgWindow, cgLoadCT, and something else [message #78109] |
Thu, 27 October 2011 14:39  |
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 #78112 is a reply to message #78111] |
Thu, 27 October 2011 10:24   |
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   |
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 #78205 is a reply to message #78204] |
Thu, 27 October 2011 16:51  |
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  |
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  |
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.")
|
|
|