0
$\begingroup$

When I try to use PlotLabels with Plot that is in Show, it gets cut off.

Show[
 ListPlot[{eulerN8,eulerN16,eulerN32,eulerN64}, Joined->True, 
  PlotStyle->{Black,Darker[Green],Blue,Red},Mesh->All, AspectRatio->1, 
  PlotLegends->{"n = 8", "n = 16", "n = 32", "n = 64"}],
 Plot[y[x],{x,a,b},
  PlotLabels->"True Solution", PlotStyle->Lighter[Purple]],
 PlotLabel->StringForm["y' = ``, y(``) = ``\n Euler method solutions with different step-sizes",f[x,y],x0,y0],AxesLabel->{x,y}
]

Note the single grey pixel on the upper right side of the image, that is absent when PlotLabels is absent.

Note the single grey pixel on the upper right side of the image, that is absent when PlotLabels is absent.

Does anyone know how to fix this? Manually adjusting the plot range fixes it, but there's got to be a more professional looking way than that right?

$\endgroup$
3
  • 2
    $\begingroup$ add the options PlotRange -> All and PlotRangeClipping -> False to Show[...]? $\endgroup$ – kglr Feb 18 at 1:23
  • $\begingroup$ That got it! Thanks! $\endgroup$ – Sam Feb 18 at 2:57
  • 1
    $\begingroup$ Generally, Show inherits the options of its very first function. In your case, it is the ListPlot. By default, it has the option PlotLabel->None. So, if you want to see the PlotLabel place it either into the first function or into the Show itself. $\endgroup$ – Alexei Boulbitch Feb 18 at 9:00

Browse other questions tagged or ask your own question.