[ncl-talk] Scatter plot with density

Ipsita Putatunda ipsita.putatunda at gmail.com
Wed Mar 22 23:28:25 MDT 2017


Dear Dennis,

I made the plot with the script you send me. As per the plot the maximum
density (number density of scatter points) is confined in the centre of the
plot, whereas the contour lines are showing something different.

What I want is the maximum value of contour with more number density
points. So as per your figure the maximum contour value should fall in the
centre of the scatter plot. Hope I make you understand my problem clearly.

Thanks in advance,
Ipsita


On Tue, Mar 21, 2017 at 11:01 PM, Dennis Shea <shea at ucar.edu> wrote:

> The attached is done with random numbers.
> It illustrates the process.
>
> x, y, values are all one-dimensional arrays
>
> %> ncl tst_density_scatter.ncl_v0
>
> It will draw to an x11 windo.
>
> HTH
>
> On Tue, Mar 21, 2017 at 1:56 AM, Ipsita Putatunda <
> ipsita.putatunda at gmail.com> wrote:
>
>> Dear Dennis,
>> Thank you for your suggestions, but I have little doubt;
>>
>>  res at sfXArray       = x_location_of-each_point  ; [*]
>>   res at sfYArray       = y_location_of-each_point  ; [*]
>>
>> these two resources(res at sfXArray, res at sfYArray) should be monotonically
>> increasing or decreasing, where in my case it is not.
>> What is "data" here in plotting the scatter_contour?  is it a 2D array of
>> X and Y values (my X and Y is not any gridded data, it is unstructured
>> arbitrary data, with almost 40000 data points)?
>>
>> Regards,
>> Ipsita
>>
>> On Tue, Mar 21, 2017 at 9:41 AM, Ipsita Putatunda <
>> ipsita.putatunda at gmail.com> wrote:
>>
>>> Dear Dennis,
>>> Thank you for your suggestions, but I have little doubt;
>>>
>>>  res at sfXArray       = x_location_of-each_point  ; [*]
>>>   res at sfYArray       = y_location_of-each_point  ; [*]
>>>
>>> these two resources(res at sfXArray, res at sfYArray) should be monotonically
>>> increasing or decreasing, where in my case it is not.
>>> What is "data" here in plotting the scatter_contour?  is it a 2D array
>>> of X and Y values (my X and Y is not any gridded data, it is unstructured
>>> arbitrary data, with almost 40000 data points)?
>>>
>>> Regards,
>>> Ipsita
>>>
>>> On Tue, Mar 21, 2017 at 12:58 AM, Dennis Shea <shea at ucar.edu> wrote:
>>>
>>>> Hello , I am out for the afternoon. Please, always respond to ncl-talk.
>>>> Could u pls resend.
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Mar 20, 2017, at 11:39 AM, Ipsita Putatunda <
>>>> ipsita.putatunda at gmail.com> wrote:
>>>>
>>>> Dear Dennis,
>>>> Thank you for your suggestions, but I have little doubt;
>>>>
>>>>  res at sfXArray       = x_location_of-each_point  ; [*]
>>>>   res at sfYArray       = y_location_of-each_point  ; [*]
>>>>
>>>> these two resources(res at sfXArray, res at sfYArray) should be
>>>> monotonically increasing or decreasing, where in my case it is not.
>>>> What is "data" here in plotting the scatter_contour?  is it a 2D array
>>>> of X and Y values (my X and Y is not any gridded data, it is unstructured
>>>> arbitrary data, with almost 40000 data points)?
>>>>
>>>> Regards,
>>>> Ipsita
>>>>
>>>>
>>>>
>>>> On Mon, Mar 20, 2017 at 7:20 PM, Dennis Shea <shea at ucar.edu> wrote:
>>>>
>>>>> Yes.
>>>>>
>>>>>   res at gsnDraw        = False        ; Don't draw plots
>>>>>   res at gsnFrame        = False        ; Don't advance frame
>>>>>
>>>>> [1] Scatter plot your values
>>>>>         scatter =
>>>>>
>>>>> [2] Overlay a contour. Something like
>>>>>      res at trGridType    = "TriangularMesh"
>>>>>      res at sfXArray       = x_location_of-each_point  ; [*]
>>>>>      res at sfYArray       = y_location_of-each_point  ; [*]
>>>>>
>>>>>
>>>>>   res at cnLevelSelectionMode        = "ManualLevels"
>>>>>   res at cnMinLevelValF              =
>>>>>   res at cnMaxLevelValF              =
>>>>>   res at cnLevelSpacingF             =
>>>>>
>>>>>   res at cnFillOn                    = True
>>>>> ; see: http://www.ncl.ucar.edu/Document/Graphics/color_table_galler
>>>>> y.shtml
>>>>> ;;res at cnFillPalette               = "..."  ; if not specified use
>>>>> default color map
>>>>>
>>>>>   res at cnLinesOn                   = True or False
>>>>>   res at cnLineLabelsOn              = True or False
>>>>>
>>>>>    contour_scatter = gsn_csm_contour(wks,data,res)
>>>>>
>>>>>   overlay(scatter,contour_scatter)
>>>>>
>>>>>
>>>>>
>>>>> On Mon, Mar 20, 2017 at 6:11 AM, Ipsita Putatunda <
>>>>> ipsita.putatunda at gmail.com> wrote:
>>>>>
>>>>>> Dear all,
>>>>>>
>>>>>> I have one dimensional datasets for X and Y coordinate. Am making
>>>>>> scatter plot with these data, but what I want if there is any way in NCL to
>>>>>> generate density scatter plot.
>>>>>> Thanks in advance for any help in this issue.
>>>>>>
>>>>>> Regards,
>>>>>> Ipsita
>>>>>>
>>>>>> _______________________________________________
>>>>>> ncl-talk mailing list
>>>>>> ncl-talk at ucar.edu
>>>>>> 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/20170323/68a71a64/attachment.html 


More information about the ncl-talk mailing list