almost_like_a_metaphor writes:
> I have 2 IDL plotting questions that have been giving me lots of
> frustrations. I just upgraded to 8.1 (Mac), so can use whatever is
> available.
>
> I'm guessing these have both been done a zillion times, but I'm new
> here (sorry, hi), and am having a devil of a time.
>
> First: trying to figure out how to plot data and color code by
> value.
>
> I have x,y, and, z values in 3 columns (actually lons, lats, and
> intensities of a profile)
>
> In my simple minded way I wanted to plot x vs y, and set the color of
> the dot to a value for z.
>
> The only way I can think of doing this right now is to step through
> every row and oplot each pair x[i],y[i] with the color for that pair
> taken from z[i]. This makes for a long executing loop with large
> files.
>
> I'm guessing I'm missing doing something with a mapping procedure
> (which I would be willing to learn), but is there any way to simply
> turn the color value of plotting into a vector the same size as x&y?
If you wanted to download the Coyote Library (highly recommended),
you could do something like this.
data = cgDemoData(14)
Help, data
; The data will be in three columns, lon, lat, data.
cgLoadCT, 33
cgPlot, data[0,*], data[1,*], /YNoZero, /NoData
cgPlotS, data[0,*], data[1,*], PSym=16, SymSize=2.0, $
SymColor=BytScl(data[2,*])
You can find the Coyote Library here:
http://www.idlcoyote.com/code_tips/installcoyote.php
> Second:
> I have many files I need to repeat processes with, generating data I
> want to overplot on multiple plots. So far, it looks like I have to
> make a choice: Load in one file and create my different plots for that
> file, or load in all files and extract the data from each file for one
> plot at a time, then going back again through all the files to create
> the next plot.
>
> A more detailed version of the problem.
> From any given Data (D1, D2, D3....D100) I extract parameters P1, P2,
> P3 that I want to plot.
> As of now, I can loop through D1-D100 and overplot derived parameters
> for P1, but in order to get P2, I have to loop through again. I can't
> seem to plot P1, P2, and P3 from D1, then cycle through and overplot
> data from D2 onto the correct plots.
>
> I hope that description makes sense. If not I can elaborate.
Well, this is harder to explain. How much money do you have?
I'm happy to sell you a book that explains everything you ever
wanted to know about IDL graphics. :-)
http://www.idlcoyote.com/books/
Basically, when you create a plot, IDL stores information about
that plot (so you can overplot on it, for example) in system
variables. These system variables are overwritten each time
you create a plot. So, if you wanted to go back and overplot
on a *previous* plot (i.e., not the *last* one you drew), you
would have to save those system variables that were set when
you drew the plot and reset them to overplot.
Here is an article about drawing multi-plots, but the
concept is the same.
http://www.idlcoyote.com/tips/oplot_pmulti.html
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.")
|