Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Legend in Mathematica, inside the Show[] function' topicStudent Support Forum > General > "Legend in Mathematica, inside the Show[] function"

Help | Reply To Topic
Author Comment/Response
Armin Müller
09/14/12 5:08pm

Hello, I have some data, and for each data a function which is the fit of one data. So f[x] is the fit of the data "laser", g[x] is the fit of the data "rot" and so on plus a 5th function.
Now I want to Plot this together with the Show[] function. This works perfectly. But without Legends it is silly. So I added in the function Show[], inside Plot[] the function PlotLegend. And when I make this I get a plot like the attachment. Mathematica plots me 2 Diagramms, one upon the other. This is not what I want. When I only use the Plot[] Funktion without the Show[] funktion an of course without the ListPlot,but with the PlotLegend function, it works perfect. I have not forgot to add Needs["PlotLegends`"]. Can someone help me to show the ListPlot, the Fits and the 5th Function in one diagram with legend?

Here is my used code, which gives me the Attachment:

Show[ListPlot[{laser, rot, blau, gelb}],
Plot[{f[x], g[x], h[x], j[x], k[x]}, {x, -0.5*Pi, 0.5* Pi},
PlotLegend -> {"a", "a", "a", "a", "a"}, PlotRange -> {0, 1}],
AxesLabel -> {"Polarisationswinkel in Rad", "Normierte Intensität"}]

Thanks for your Help

Attachment: Untitled-4.pdf, URL: ,
Help | Reply To Topic