Re: cross hatching overlay labelbar

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Jul 15 2011 - 11:51:22 MDT

On Jul 13, 2011, at 8:54 PM, mark collier wrote:

> Hi Mary,
>
> 1) I can turn off the cross-hatching label bars but I would like to
> keep one so that their range scan be easily seen.
>
> For now having say the one in the middle panel remain would be good.
> Later it might be more aesthetically pleasing to have it under the
> colour bar, and also to save space around the figures.

Hi Mark,

I added a new example to the panel page. Please see:

http://www.ncl.ucar.edu/Applications/panel.shtml#ex27

>
> In addition, when I limit the range of the cross-hatching I would like
> the lower values (for eg) to not be cross hatched. For example, in the
> current plot if I change
>
> conres@cnLevels = (/.12,.15/);ANN tas
> to
> conres@cnLevels = (/.15/);ANN tas
>
> 2) I would like to see no cross-hatching for values less than 0.15 and
> therefore highlight only the larger numbers (>0.12). Can this be done?
> Another way might be to have a no-lines (blank) cross-hatching for the
> lowest levels. Can the cross-hatching style be overwritten this way?
> So for the current plot the lowest cross-hatch style for the lowest
> box (values <.12) would be white (or transparent so that the colours
> can still be seen in the overlay).

You can do this by setting cnFillPatterns yourself, and setting the array to -1
wherever you don't want a pattern.

For example, in the files you tarred up, I added to your script:

   conres@cnFillPatterns = (/-1,3,5/)

If you don't know what the length of the pattern array is going to be apriori, then
you can first created the shaded plot, retrieve both the levels (cnLevels) and
the patterns (cnFillPatterns), and then set the patterns array to -1 based on where
your levels are below a certain value.

For example (untested):

  getvalues plot
    "cnFillPatterns" : patterns
    "cnLevels" : levels
  end getvalues
  do i=0,dimsizes(levels)-1
    if(levels(i).lt.0.12) then
        patterns(i) = -1
     end if
  end do
  setvalues plot
    "cnFillPatterns" : patterns
    "cnLevels" : levels
  end setvalues

I think you might also be able to use the "gsn_contour_shade" function for simpler coding!

>
> 3) probably the cross-hatching is a bit strong. I've tried playing
> with the colours of the lines used in the cross-hatching without this
> taking effect. Can the lines be turned to something fainter? For
> example, grey rather than black.

Yes, but you don't have gray in your color map. Since you have a
full 256 color map, but you are not using the last three colors, then
you can replace one of these last colors with a gray of your choice:

;---Replace last color with gray
   gray = "Gray75"
   rgb = namedcolor2rgb(gray)
   NhlSetColor(wks,255,rgb(0,0),rgb(0,1),rgb(0,2))

Later, set:

   conres@cnFillColor = gray

You can see some named gray colors at:

http://www.ncl.ucar.edu/Document/Graphics/named_colors.shtml

Click on any one of the thumbnail color tables for a larger view.

Good luck. I would like to see the final result if you are successful!

--Mary

>
> I've uploaded a simplified plot script and data to the "incoming" area
> of your ftp site, files_collier.tar
>
> Many thanks,
> Mark.
> On 12/07/2011, at 12:47 AM, Mary Haley wrote:
>
>>
>> On Jul 9, 2011, at 5:11 AM, mark collier wrote:
>>
>>> Hi,
>>> I've attached a figure that I'm happy with apart from panels a-h
>>> having their own cross-hatching labelbar. I'm using overlays. Is it
>>> possible to turn off all bar the one cross-hatching labelbars?
>>
>> Hi Mark,
>>
>> For each individual plot, you can try either setting the
>> lbLabelBarOn resource to False, or, if that doesn't work, setting
>> pmLabelBarDisplayMode to "Never".
>>
>>> I cannot find a way of controlling the overlays labelbars when
>>> panelling like can be done with the main set of plots (ie the one
>>> large colour label bar for all).
>>
>> How would you like to represent the two different labelbars on the
>> panel plot? Do you want the hatched labelbar to be vertical on the
>> side, for example? This may take some trickery in order to do this
>> in a paneled plot, but it *is* doable. I can help you more once I
>> know what you want to accomplish.
>>
>> --Mary
>>
>>
>>> Regards,
>>> Mark.
>>>
>>> <plot_modobs.pdf>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jul 15 11:51:29 2011

This archive was generated by hypermail 2.1.8 : Mon Jul 18 2011 - 15:57:57 MDT