Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would also be very interested in an answer to this question. </p> <p>To tell you what is wrong with PlotLegends: It is terribly unstable and in many instances doesn't work at all.</p> <p>Here is an example where PlotLegends screws up completely. Output is from Mathematica 7.0:</p> <p>Assume that we have measured some data points corresponding to a number of functions, and we want to show how well they compare to the ideal function, or maybe how well they match with a calculated fit. No problem! We'll just Show[] the smooth plot together with a ListPlot of the data points, right?</p> <p>It could look something like this:</p> <pre><code>Show[ Plot[{Sin[x], Sinh[x]}, {x, -Pi, Pi}], ListPlot[Join[{#, Sin[#]} &amp; /@ Range[-Pi, Pi, .5], {#, Sinh[#]} &amp; /@ Range[-Pi, Pi, .5]]] ] </code></pre> <p><img src="https://i.stack.imgur.com/AjYdW.png" alt="alt text"></p> <p>Now we'd like to put a legend on the plot, so readers will know what on earth they're looking at. Easier said than done, mister! Let's add the PlotLegend to the Plot[]:</p> <pre><code>Show[ Plot[{Sin[x], Sinh[x]}, {x, -Pi, Pi}, PlotLegend -&gt; {Sin[x], Sinh[x]}], ListPlot[Join[{#, Sin[#]} &amp; /@ Range[-Pi, Pi, .5], {#, Sinh[#]} &amp; /@ Range[-Pi, Pi, .5]]] ] </code></pre> <p><img src="https://i.stack.imgur.com/SbY8V.png" alt="alt text"></p> <p>This looks GREAT! Publish immediately!</p> <p>For such a basic and ubiquitously needed functionality, it sure has been a lot of work to find an alternative to PlotLegend that just works. The best alternative I've found so far has been to meticulously construct a list of plotstyles, then construct the legend by hand, and finally to show it together with the plot using ShowLegend[]. (See for example <a href="http://mathforum.org/kb/message.jspa?messageID=5789281&amp;tstart=0" rel="nofollow noreferrer">here</a>) It's possible, but a lot of work. </p> <p>So if anyone knows of a workaround to make PlotLegend work, an alternative package that works better, or just a neat way to get legends that can be automated easily, I would be very grateful! It would certainly make life a little bit easier.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload