[Graph-dev] Can I display a legend?

Emile Aben emile at caida.org
Mon Jun 11 11:01:09 PDT 2007


Hi Adam,

I've done a little debugging by adding this to the t/xmgrace.t
test script that is included in the distribution:
$Chart::Graph::save_tmpfiles = 1;
$Chart::Graph::debug = 1;

Example output of the test script is then:
1..3
/usr/X11R6/bin/xmgrace -hardcopy -hdevice PNG -printfile test_results/xmgrace1.png /tmp/Graph_Xmgrace_92319/command.1.agr -pexec autoscale
done.
ok
/usr/X11R6/bin/xmgrace -hardcopy -hdevice PNG -printfile test_results/xmgrace2.png /tmp/Graph_Xmgrace_92320/command.2.agr -pexec autoscale
done.
ok
/usr/X11R6/bin/xmgrace -hardcopy -hdevice PNG -printfile test_results/xmgrace3.png /tmp/Graph_Xmgrace_92321/command.3.agr -pexec autoscale
done.
ok
Set 1 of tmp files are in /tmp/Graph_Xmgrace_92319
Set 2 of tmp files are in /tmp/Graph_Xmgrace_92320
Set 3 of tmp files are in /tmp/Graph_Xmgrace_92321

If you add a '-legend load' option to these xmgrace command lines a legend will appear
in the png files, although the defaults that are used there are probably not what you'd
like to see.

As far as I can see there is no support for customization of legends in Chart::Graph::Xmgrace itself,
so I think the best way to go about this is post processing the agr files yourself to add the information
you need.
I'm not sure how much time it would cost to add support for legends in the perl module.

I hope this helps,
Emile

On Mon, Jun 04, 2007 at 10:34:40AM -0400, Adam Stein wrote:
> Is it possible to do legends?  I'm specifically looking to do legends in
> the Xmgrace module.  Looks like the code supports it (sets the graph
> 'title' to be the legend label, etc.), but no legend ever appears and
> the AGR file doesn't have the legend label line needed for Grace to
> create the legend.
> 
> I didn't see anything in the mailing list archives about this.  I'm
> using Chart-Graph v3.2.
> -- 
> Adam Stein @ Xerox Corporation       Email: adam at scan.mc.xerox.com
>                                             
> Disclaimer: All views expressed             
> here have been proved to be my own.  [http://www.csh.rit.edu/~adam/]
> 
> _______________________________________________
> Graph-dev mailing list
> Graph-dev at caida.org
> https://rommie.caida.org/mailman/listinfo/graph-dev



More information about the Graph-dev mailing list