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

Home » Public Forums » archive » Re: colors and plot direct graphics function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: colors and plot direct graphics function [message #82451 is a reply to message #82449] Fri, 14 December 2012 15:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
bing999 writes:

> I switched from idl 7 to 8.2 recently, and start using direct graphics
> for plotting purposes.
>
> To plot in colors in idl 7, I used to do:
> loadct,39
> plot,x,y,color=250
> for a red line.
>
> With direct graphics I can do:
>
> p=plot(x,y,AXIS_STYLE=0,$
> XRANGE=[0,30],YRANGE=[0,30],color='red')
>
> But is there a way to load a color table and use a single number value
> (e.g. 250 for red) for colors instead of a string with the plot
> function?
>
> I find it convenient to use that when you want to overplot many curves
> of different colors in a for loop for instance.
>
> I couldn't find this tip in the IDL help...

It appears you have actually switched to function graphics,
which use the object graphics system, not the direct graphics
system.

If you wanted to stay with direct graphics, and still
have nearly all the advantages of a modern graphics
system, you could try Coyote Graphics:

http://www.idlcoyote.com/graphics_tips/coyote_graphics.php

With Coyote Graphics, you would do this to get an equivalent plot:

LoadCT, 39
cgPlot, cgDemoData(1), Color='250', XStyle=5, YStyle=5, /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 thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: HASH with case insensitive keys versus a new DICT class
Next Topic: Sparse matrix algorithms

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

Current Time: Sat Oct 11 08:08:50 PDT 2025

Total time taken to generate the page: 0.55890 seconds