2 Added another solution
source | link

The plots are misaligned because plot b doesn't have the exact same options as a, which causes it to be drawn slightly different. If you give the same options to plot b (PlotRange, AxesOrigin, and AxesLabel)

b = Plot[-2 f'[z], {z, 0, 5}, PlotLegend -> "Theory", 
  PlotRange -> {{0, 5}, {0, 1}}, LegendPosition -> {1.1, -0.4}, 
  AxesOrigin -> {0, 0}, AxesLabel -> {"gamma", "quantity"}]

then you can use Show[a,b] to get them lined up: enter image description hereoutput of Show[a,b]

Note that you'll have to move the "Theory" legend to get the "N=10" legend to show.

Alternatively, you could generate a set of data from the theoretical functions, and plot that in one go with your other data:

plottheory = Table[{z, -2 f'[z]}, {z, 0, 5, 0.01}];

ListPlot[
  {plotgamma6, plotgamma10, plottheory},
  AxesOrigin->{0,0}, PlotRange->{{0,5},{0,1}}, AxesLabel->{"gamma","quantity"},
  PlotStyle->PointSize[0.02], PlotLegend-> {"N=6","N=10","theory"},
  LegendPosition->{1.1,-0.4}, Joined->True, 
  PlotMarkers->{\[FilledSmallSquare],\[FilledSmallCircle],""}
]

This gives a slightly nicer output:

output of ListPlot[{},...]

The plots are misaligned because plot b doesn't have the exact same options as a, which causes it to be drawn slightly different. If you give the same options to plot b (PlotRange, AxesOrigin, and AxesLabel)

b = Plot[-2 f'[z], {z, 0, 5}, PlotLegend -> "Theory", 
  PlotRange -> {{0, 5}, {0, 1}}, LegendPosition -> {1.1, -0.4}, 
  AxesOrigin -> {0, 0}, AxesLabel -> {"gamma", "quantity"}]

then you can use Show[a,b] to get them lined up: enter image description here

Note that you'll have to move the "Theory" legend to get the "N=10" legend to show.

The plots are misaligned because plot b doesn't have the exact same options as a, which causes it to be drawn slightly different. If you give the same options to plot b (PlotRange, AxesOrigin, and AxesLabel)

b = Plot[-2 f'[z], {z, 0, 5}, PlotLegend -> "Theory", 
  PlotRange -> {{0, 5}, {0, 1}}, LegendPosition -> {1.1, -0.4}, 
  AxesOrigin -> {0, 0}, AxesLabel -> {"gamma", "quantity"}]

then you can use Show[a,b] to get them lined up: output of Show[a,b]

Note that you'll have to move the "Theory" legend to get the "N=10" legend to show.

Alternatively, you could generate a set of data from the theoretical functions, and plot that in one go with your other data:

plottheory = Table[{z, -2 f'[z]}, {z, 0, 5, 0.01}];

ListPlot[
  {plotgamma6, plotgamma10, plottheory},
  AxesOrigin->{0,0}, PlotRange->{{0,5},{0,1}}, AxesLabel->{"gamma","quantity"},
  PlotStyle->PointSize[0.02], PlotLegend-> {"N=6","N=10","theory"},
  LegendPosition->{1.1,-0.4}, Joined->True, 
  PlotMarkers->{\[FilledSmallSquare],\[FilledSmallCircle],""}
]

This gives a slightly nicer output:

output of ListPlot[{},...]

1
source | link

The plots are misaligned because plot b doesn't have the exact same options as a, which causes it to be drawn slightly different. If you give the same options to plot b (PlotRange, AxesOrigin, and AxesLabel)

b = Plot[-2 f'[z], {z, 0, 5}, PlotLegend -> "Theory", 
  PlotRange -> {{0, 5}, {0, 1}}, LegendPosition -> {1.1, -0.4}, 
  AxesOrigin -> {0, 0}, AxesLabel -> {"gamma", "quantity"}]

then you can use Show[a,b] to get them lined up: enter image description here

Note that you'll have to move the "Theory" legend to get the "N=10" legend to show.