How to make scatter plot with colorbar in IDL? [message #85427] |
Fri, 02 August 2013 08:07  |
atmospheric physics
Messages: 121 Registered: June 2010
|
Senior Member |
|
|
Hello everyone,
I am working in IDL version 8.0. I am struck up with plotting in IDL even after following various suggestions by Coyote and EXELIS.
Data description:
I have 100 stations (represented by longitude and latitude) collecting some variable as a function of time (each second). I wanted to make the following subplots (using !p.multi) in the same figure.
Figure 1. I have downloaded the static googlemap from the following link: (centering 6.42 deg. E and 50.9 deg. N (or) lat: [50.84-50.96] deg. N and lon: [6.36-6.48] deg. E).
http://maps.googleapis.com/maps/api/staticmap?center=50.9,6. 42&zoom=13&size=500x500&maptype=satellite&se nsor=true
Now I want to include latitude (y-axis) & longitude (x-axis) as per the ranges shown above. Can anyone let me know how to do this? Overlaying on this, I want to make 2D scatter plot with colorbar representing my variable data while x and y represent the longitude & latitude of stations respectively. My variable data ranges from 0 to 1200.So, my colorbar is also required to have 1201 divisions. I prefer to have 'jetstream' colorbar.
I tried using the following lines for 2D scatter plot but could not succeed.
data_1=longitude ; array of 100 elements
data_2=latitude ; array of 100 elements
data_3=variable ; array of 100 elements
cgLoadCT,23
cgScatter2d,data_1,data_2,COLOR=BytScl(data_3)
I want each variable point to be represented a colored circle representing the corresponding value from the colorbar. I would appreciate if someone can help me with some example code to do this?
Figure 2. Since I have the variable data for 100 stations as a function of time, I would like to make simultaneously variable (y-axis) versus time (x-axis) with colorbar representing 100 stations with distinct colors.
Can anyone provide me a sample / rough code where I can plot Figure 1 above and Figure 2 below on the same figure. Ultimate goal for me to make a movie while I make each figure for each time step. I could succeed making this in MATLAB. Please advise me with some suggestions or sample examples to realize my figures & thus movie.
Thanks in advance ...
|
|
|