[ncl-talk] How to change color bar for the second field using gsnHistogramCompare

rK Aditya aditya.rk at gmail.com
Mon May 16 03:09:08 MDT 2016


Dear All,

Got it! I need to change gsn_code.ncl and introduce

gsres at gsFillColor = fillcolor(j) manually inside do j=nbarsinbin-1,0,1.

Cheers,
-r/K-

On Mon, May 16, 2016 at 6:59 AM, rK Aditya <aditya.rk at gmail.com> wrote:

> Dear Guilherme,
>
> Thank you for the suggestion. I tried to activate gsnXYBarChart toTrue as
> well, but  gsnXYBarChartColors2 or gsnXYBarChartColors are not valid
> resources for this. I still could not change the color bar for the second
> field.
>
> Kindest regards,
> -r/K-
>
>
>
> On Mon, May 16, 2016 at 2:08 AM, Guilherme Martins <jgmsantos at gmail.com>
> wrote:
>
>> I'm note sure but try: gsnXYBarChartColors2 or gsnXYBarChartColors.
>>
>> Guilherme.
>>
>> Em dom, 15 de mai de 2016 às 16:11, rK Aditya <aditya.rk at gmail.com>
>> escreveu:
>>
>>> Dear All,
>>>
>>> I would like to compare histogram for two seasons; winter and summer. I
>>> use the first field for summer and put it with filled red color. But I
>>> could not change the color in the second field, on crosshatch pattern to
>>> other color, let say blue.
>>>
>>> If someone can help me?
>>>
>>> Thank you for your time.
>>>
>>> Kindest regards,
>>> -r/K-
>>>
>>>
>>> begin
>>> ;************************************************
>>> ; Generate some random data.
>>> ;************************************************
>>>   x = new(1000,integer)
>>>   y = new(1000,integer)
>>>   do i=0,dimsizes(x)-1
>>>     x(i) = rand()
>>>     y(i) = rand()
>>>   end do
>>>   x = x/320
>>>   y = y/320
>>>
>>> ;************************************************
>>> ; Set up a variable to hold both x and y.
>>> ;************************************************
>>>   z = new((/2,dimsizes(x)/),integer)
>>>   z(0,:) = x
>>>   z(1,:) = y
>>> ;************************************************
>>> ; create plot
>>> ;************************************************
>>>   wks = gsn_open_wks("png","histo")              ; send graphics to PNG
>>> file
>>>   gsn_define_colormap(wks,"temp1")               ; choose colormap
>>>
>>>   res                            = True          ; plot mods desired
>>>   res at gsnHistogramCompare        = True
>>>   res at gsnHistogramBinIntervals = (/25,50,75/)
>>> ;  res at gsFillColors = (/(/"blue","red"/),(/"blue","red"/)/)
>>> ;  res at gsFillColor=(/"blue","blue","red","red"/)
>>>   res at gsnHistogramBarColors = (/(/"red","blue"/),(/"red","blue"/)/)
>>> ;  res at gsnHistogramBarColors=(/"blue","blue","red","red"/)
>>>   plot=gsn_histogram(wks,z,res)                  ; create histogram
>>> end
>>> [image: Inline image 1]
>>> _______________________________________________
>>> ncl-talk mailing list
>>> ncl-talk at ucar.edu
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>> --
>>
>> ------------------------------------------------------------------------------------------
>> Dr. Guilherme Martins
>> Instituto Nacional de Pesquisas Espaciais (INPE)
>> Centro de Previsão de Tempo e Estudos Climáticos (CPTEC)
>> Grupo de Desenvolvimento em Assimilação de Dados (GDAD)
>> Telefone (INPE/CP): +55 12 3186-8551 || Celular (TIM): +55 12 98152-8580
>> E-mail: guilherme.martins at inpe.br || jgmsantos at gmail.com
>> Skype: guilherme.martins.
>> Homepage: https://sites.google.com/site/jgmsantos
>> Currículo Lattes: http://lattes.cnpq.br/5997657584785803
>>
>> ------------------------------------------------------------------------------------------
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160516/c1839963/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: histo.png
Type: image/png
Size: 70341 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160516/c1839963/attachment.png 


More information about the ncl-talk mailing list