Re: scatter plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Mon Aug 16 2010 - 15:02:14 MDT

Hi Jeff,
Scatter plots can be created by passing in 2 1D arrays to gsn_csm_xy. I
don't know whether you are trying to create a scatter plot for each lat
lon combination, or not. Regardless, the method is the same. You need to
create 2 timeseries of the same length, one representing TS, and one
representing OLR. If needed you could use ndtooned to create a 1D array..
(http://www.ncl.ucar.edu/Document/Functions/Built-in/ndtooned.shtml)

Here's some code of mine that plotted a scatter plot. In my case,
finarr(1,:) was SST and finarr(0,:) was SLP:

res = True
res@xyMarkLineMode = "Markers"
res@xyMonoMarkLineMode = True
res@xyMarkers = 16
res@xyMonoMarkerColor = True
res@xyMarkerColor = "blue"
res@xyMarkerSizeF = 0.015
res@tiYAxisString = "SLP Trend"
res@tiXAxisString = "SST Trend"
...
plot= gsn_csm_xy(wks,finarr(1,:),finarr(0,:),res)

Hope that helps..
Adam

> NCL,
> I am having some trouble creating a scatter plot at the moment. I have
brought
> in the following variables from a NetCDF file:
> 1. outgoing longwave radiation (OLR)
> 2. surface temperature (TS)
> Each variable has the same dimension sizes (ntime * nlatitude *
> nlongitude).
> What I'm trying to do is make a scatter plot with OLR as a function of
TS
> over
> the entire time period (12 time steps), but I keep getting tripped up.
My
> original idea was to create a new array with TS in the "x" dimension and
OLR in
> the "y" dimension, and for each time step, lat and lon, I would record
teh
> corresponding TS and OLR, but that was not working in my NCL script. Any
feedback would be much appreciated. Thank you.
> Jeff Waters
> Graduate Student
> Department of Meteorology
> Penn State University '11
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 16 15:02:19 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 15:33:24 MDT