[ncl-talk] too less data points in scatter plot
Mary Haley
haley at ucar.edu
Mon Oct 13 08:59:55 MDT 2014
Hi Lena,
I'm CC-ing ncl-talk again. Thanks for providing all your files offline.
I was able to run your script, and got the same results as you. The issue
that you have 8700 points, but 8400 of them are duplicates. When you plot
this, it's plotting all 8700 values, but since 8400 of them have the same
x,y pair, they get plotted in the same location.
You may want to recheck your calculations for these variables.
I've attached a version of your script that draws the XY plot, with all the
duplicate points colored.
--Mary
On Thu, Oct 9, 2014 at 4:57 PM, Mary Haley <haley at ucar.edu> wrote:
> 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/20141013/c9bf5b92/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scatter_Australian2.png
Type: image/png
Size: 61027 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141013/c9bf5b92/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scatter_Australian2_mod.ncl
Type: application/octet-stream
Size: 6371 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141013/c9bf5b92/attachment.obj
More information about the ncl-talk
mailing list