[ncl-talk] too less data points in scatter plot
Mary Haley
haley at ucar.edu
Thu Oct 9 16:57:41 MDT 2014
Hi Lena,
It is hard to debug this code without knowing what "data1" looks like.
Can you write data1 to a NetCDF file and send that file to me?
To write data1 to a NetCDF file, you can add this code to the end of your
script:
fout = addfile("formary.nc","c")
fout->data1 = data1
and then send me "formary.nc". Hopefully it's not too large and you can
just email it to me.
You can do this offline (i.e., don't include ncl-talk at ucar.edu on the
response), and then when I response, I will include ncl-talk again.
Thanks,
--Mary
On Wed, Oct 8, 2014 at 2:48 AM, Lena Frey <Frey_L at web.de> wrote:
> Hi all!
>
> I have made a scatter plot. I get no error message, but in my plots are
> too less data points.
> The data dimensions are time,lat,lon with time=348. I would like to have
> the data points for all time steps of a specific region in the plot.
> I de-seasonalized the data and then used the ndtooned command to reshape
> the data for the scatter plot.
> I get 8700 values, but I can't see all the values in the plot.
>
> Have I used the wrong command to reshape the data?
>
> Here you can see the important part of my script. You can find attached
> the plot.
>
>
>
> ;*********************************************************************************
> ; remove annual cycle and create monthly anomalies
>
> ;*********************************************************************************
> cf_ann = rmMonAnnCycTLL(cf)
> albedo_ann = rmMonAnnCycTLL(albedo)
>
> printVarSummary(cf_ann)
> printMinMax(cf_ann,0)
> printVarSummary(albedo_ann)
> printMinMax(albedo_ann,0)
>
>
> ;********************************************************************************
> ; de-seasonalized data
>
> ;********************************************************************************
> cf_season = cf-cf_ann
> albedo_season = albedo-albedo_ann
>
> printVarSummary(cf_season)
> printMinMax(cf_season,0)
> printVarSummary(albedo_season)
> printMinMax(albedo_season,0)
>
>
> ;********************************************************************************
> ; reshape
>
> ;********************************************************************************
> cf_reshape = ndtooned(cf_season)
> albedo_reshape = ndtooned(albedo_season)
>
> printVarSummary(cf_reshape)
> printMinMax(cf_reshape,0)
> printVarSummary(albedo_reshape)
> printMinMax(albedo_reshape)
>
>
> ;********************************************************************************
> ; regression line
>
> ;********************************************************************************
> rc = regline(cf_reshape,albedo_reshape)
> print(rc)
>
>
> ;********************************************************************************
> ; create array
>
> ;********************************************************************************
> x = cf_reshape
> y = albedo_reshape
> printVarSummary(x)
> printVarSummary(y)
>
>
> data1 = new((/2,dimsizes(y)/), typeof(y))
> data1(0,:) = y
> data1(1,:) = rc*(x-rc at xave) + rc at yave
>
>
> ;*********************************************************************************
> ; plotting parameters
>
> ;*********************************************************************************
> wks = gsn_open_wks("pdf","scatter_Australian2")
> res = True
> res at gsnMaximize = True
> res at xyMarkLineModes = (/"Markers","Lines"/)
> res at xyMarkers = 5
> res at xyMarkerColor = "black"
> res at xyMarkerSizeF = 0.0025
> res at xyDashPatterns = 1
> res at xyLineThicknesses = (/1,2/)
>
> res at tiMainString = "Australian"
> res at tiXAxisString = "cloud fraction"
> res at tiYAxisString = "albedo"
>
> plot = gsn_csm_xy (wks,x,data1,res)
>
> end
>
>
>
> Thanks.
>
> Best regards,
> Lena
>
>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141009/a5ae500c/attachment.html
More information about the ncl-talk
mailing list