I am plotting a number of functions (at least 4 in one plot) with a legend. Needless to say, it is important that it is clear from the legend which line belongs to which function. I tried to play around with the PlotStyle
, but I'm not getting them to look all that different. The paper it will be published in demands grey-scale pictures, so I can't use different colours.
I was hoping to use PlotMarkers
instead, but I found that these only exist within the ListPlot
but not in Plot
. In theory I could overlay a Plot
with a ListPlot
, but then it wouldn't show in the legend. What is the best way to add the markers in both the plot and the legend?
This is a minimal working example of something to which I'd to add PlotMarkers
.
Needs["PlotLegends`"];
Plot[{Sin[x], Sin[x + π/4], Sin[x + π/2], Sin[x + 3π/4]}, {x, 0, 2π},
PlotLegend -> {"#1", "#2", "#3", "#4"},
PlotStyle -> {DotDashed, Dashed, Dashing[0.01], Dotted}]
Show
like here. $\endgroup$Show[]
, but none of them is extremely helpful here. That is what I meant in the question: when I usePlot
andListPlot
within the sameShow[]
command, it doesn't quite cover it. $\endgroup$PlotLegends
(instead of the package you are loading). You can e.g. use it directly in @Kuba's answer (I personally always had problems with thePlotLegends
package...) $\endgroup$