Re: trick for hiding lines in legend

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 18 2012 - 11:25:29 MDT

Hi Mark and Rick,

I thought changing a legend should be as easy as using the lgLineColors resource. But, when you use the built-in legend that comes with an XY plot, most of the legend resources are "turned off" and hence you can't change them. There's something called the "PlotManger" which is taking control of the legend here.

If you want to customize the lines in your legend, especially in the sense of turning individual ones on or off, then you will need to *not* use this built-in legend, and instead create one yourself and attach it to the plot.

Please see example 8, which shows you how to create the legend using gsn_create_legend, and then how to attach it using gsn_add_annotation.

You can look at example 13, which is more complicated. It queries the XY plot for you, and attemps to construct the legend from scratch. It also allows you to pick how many legend items to display, but it starts with the first one and works from there. You would have to modify it to indicate that you want to keep the last two.

--Mary

On Jul 18, 2012, at 9:35 AM, Rick Brownrigg wrote:

> Hi Mark,
>
> I don't know for certain without seeing your script and playing around with it, but one thing that comes to mind is to define the black line colors as completely transparent, such as (/ 0., 0., 0., 0. /) (assumes you are using 6.1.0b). Are you using the lgLineColors resource to specify line colors of the legend?
>
> Hope that helps…
> Rick
>
> On Jul 18, 2012, at 2:15 AM, mark collier wrote:
>
>> Hi,
>> wondering if there is a "cheap trick" for hiding the black-lines in the legend when using the built in legend feature? Setting the line to white wouldn't work as it would white out the time-series - and my attempt to put a white box over them failed although should work in principle but requires tweaking. One option might be to define a line type that has no "dashes" and use it?
>> Thanks for any advice,
>> Mark.
>>
>> <PastedGraphic-2.tiff>
>> _______________________________________________
>> 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 Wed Jul 18 11:25:40 2012

This archive was generated by hypermail 2.1.8 : Wed Jul 18 2012 - 14:33:00 MDT