Re: regression plot

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon, 28 Jul 2008 10:56:52 -0600 (MDT)

Hi Lin,

I should have noticed this before.

You are setting xy* resources for the gsn_add_polyline functions.
The gsn_add_polyxxxx functions are not considered XY plots; they
are simply routines for adding things like markers, lines,
and polygons to an *existing* plot.

Instead of using xy resources, then, you want to use gs resources:

       resPL1_at_gsLineDashPattern = 18 ; dash line
       resPL1_at_gsLineThicknessF = 3
       resPL1_at_xgsineColor ="red"

       resPL2 = True
       resPL2_at_gsLineDashPattern = 0 ; solid line
       resPL2_at_gsLineThicknessF = 3
       resPL2_at_gsLineColor ="black"

Also, there is no dash pattern 18. They only go up to 16:

   http://www.ncl.ucar.edu/Document/Graphics/Images/dashpatterns.gif

You can add your own dash patterns via NhlNewDashPattern:

   http://www.ncl.ucar.edu/Document/Functions/Built-in/NhlNewDashPattern.shtml

and these will be added temporarily to the current table of dash
patterns, starting with pattern 17.

--Mary

On Mon, 28 Jul 2008, Mary Haley wrote:

> Lin Su,
>
> I noticed you are setting the plural form of the xy* resources, but
> you only have one curve per XY plot, correct?
>
> If so, you might try setting the singular version of these
> resources instead:
>
> resPL1 = True
> resPL1_at_xyMarkLineMode = "Lines"
> resPL1_at_xyDashPattern = 18
> ; dash line
> resPL1_at_xyLineThicknessF = 3
> resPL1_at_xyLineColor ="red"
>
> resPL2 = True
> resPL2_at_xyMarkLineMode = "Lines"
> resPL2_at_xyDashPattern = 0
> ; solid line
> resPL2_at_xyLineThicknessF = 3
> resPL2_at_xyLineColor ="black"
>
> To use plural resources, you usually have to set the corresponding
> "Mono" resource to False. For example, to set xyLineColors, you would
> need to set xyMonoLineColor to False.
>
> I would stick with the singular resources so you don't need to set all
> the xyMonoXXXX resources as well.
>
> --Mary
>
> On Sun, 27 Jul 2008, Lin Su wrote:
>
>> Hi Jimmy,
>>
>> Thanks for your help! Attached please find my NCL scripts for the scatter
>> plot.
>> The resources part for xy1 (resPL1) and xy2(resPL2) still don't work.
>> Please let
>> me know if you find any mistake in the code at your convenient time:)
>>
>> Thanks a lot,
>> -Lin
>> ---
>> Lin Su
>> http://atoc.colorado.edu/~sul/
>>
>> ---- Original message ----
>>> Date: Sat, 26 Jul 2008 23:43:46 -0700
>>> From: "James Correia" <jimmyc42_at_gmail.com>
>>> Subject: Re: regression plot
>>> To: "Lin Su" <Lin.Su_at_colorado.edu>
>>>
>>> Hi you might try adding the resources:
>>> res_at_gsnDraw = False
>>> res_at_gsnFrame = False
>>> issue your plot,xy1,xy2 commands
>>> draw(plot)
>>> frame(wks)
>>>
>>> jimmyc
>>>
>>> On Fri, Jul 25, 2008 at 8:58 PM, Lin Su
>>> <Lin.Su_at_colorado.edu> wrote:
>>>
>>> Dear NCL users,
>>> My scatter regression plot looks good. However,
>>> when I am trying to define
>>> different resources for the one-to-one line and
>>> the fit line, they just don't work
>>> at all. I plan to identify the two solid lines
>>> (one-to-one line and the fit line) with
>>> different colors and different lines (solid
>>> and dash). Here is my definition for them:
>>> ......
>>> resPL1 = True
>>> resPL1_at_xyMarkLineModes = "Lines"
>>> resPL1_at_xyDashPatterns = 18
>>> ; dash line
>>> resPL1_at_xyLineThicknesses = 3
>>> resPL1_at_xyLineColors ="red"
>>>
>>> resPL2 = True
>>> resPL2_at_xyMarkLineModes = "Lines"
>>> resPL2_at_xyDashPatterns = 0
>>> ; solid line
>>> resPL2_at_xyLineThicknesses = 3
>>> resPL2_at_xyLineColors ="black"
>>>
>>> plot = gsn_csm_xy(wks, AOD1, AOD2, res1)
>>> xy1=gsn_add_polyline(wks,plot,DUSTAOD1,fit1,resPL1)
>>> xy2=gsn_add_polyline(wks,plot,x,y,resPL2)
>>> ......
>>> Any apparent error somewhere?
>>> Also, attached please find the plot.
>>>
>>> Thanks a lot,
>>> -Lin
>>> ---
>>> Lin Su
>>> http://atoc.colorado.edu/~sul/
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk_at_ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>> --
>>> James Correia Jr.
>>> Post Doc
>>> Climate Physics Group, PNNL
>>
>>
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 28 2008 - 10:56:52 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 30 2008 - 15:23:14 MDT