Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: ShowLegend....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53656] Re: ShowLegend....
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Fri, 21 Jan 2005 06:37:03 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 1/20/05 at 3:48 AM, plizak at gmail.com (plizak) wrote:

>There has to be an easier way to do this....

>I was trying to figure out how to use showlegend, and here's what I
>came out with....

>(* plot2 and plot3 are two different plots *)
>legend = ShadowBox[ {-0.4, 6}, {0.3, 3}, ShadowBackground -> GrayLevel[
>0.5], ShadowOffset -> {0.025, -0.5}];
>
>showlegend = Show[ plotX, Graphics[{legend , {
>Text["Normal - solid", {-.375, 6.775}, {-1.0, 0}],
>Text["Data - dashed", {-.375, 7.775}, {-1.0, 0}]}}]]

>That is way to much code to just add a legend to a graph.

>Is there a faster/easier way to do this? 

Easier/faster is in the eye of the beholder

>Is there a way that the legend also includes an example of the linestyle?

Yes, for example

Plot[{x^2, x^3}, {x, -1, 1}, 
   PlotStyle -> {Hue[0], GrayLevel[0]}, 
   Epilog -> {Text["x^2", {0.7, 0.1}, {-1, 0}], 
              Text["x^3", {0.7, 0.05},{-1, 0}], 
              Line[{{0.6, 0.05}, {0.69, 0.05}}], Hue[0], 
              Line[{{0.6, 0.1}, {0.69, 0.1}}]}]; 
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Memory usage
  • Next by Date: Re: TableForm and MatrixForm
  • Previous by thread: ShowLegend....
  • Next by thread: Re: ShowLegend....