Skip to main content
4 of 5
response to overlaying of data by model.
DavidC
  • 16.9k
  • 1
  • 43
  • 96

I'm assuming you want to use the same PlotRange for cell (2,2) as for the other cells.

You can change the order: show Plot before ListPlot. Note that Plot will now set the PlotRange; as I understand it, the first function called by Show controls the graphics settings (if there should be a conflict).

Show[Plot[cumulativeGauss[x, fit2[[1]], fit2[[2]]], {x, 0, 30}, PlotRange -> {{0, 30}, {0, 1}}], ListPlot[data2] ] 

PlotRange

The questions remain:

  • "Why isn't the full plot range displayed when ListPlot comes before Plot?

  • "Why can't you specify the PlotRange in Show as follows?"

    Show[Plot[cumulativeGauss[x, fit2[[1]], fit2[[2]]], {x, 0, 30}], ListPlot[data2], PlotRange -> {{0, 30}, {0, 1}}] According to the documentation, this latter approach should work (but it does not):

instruction

Either of these result in the following:

PlotRange2


Edit

You can display the data points beneath the model using. Note, however that the points will lie beneath the axes.

Plot[cumulativeGauss[x, fit2[[1]], fit2[[2]]], {x, 0, 30}, PlotRange -> {{0, 30}, {0, 1}}, PlotRangePadding -> {{.3, 3}, {0.1, 0}}, Prolog -> {Red, PointSize[Large], Point[data2]}] 

points shown

DavidC
  • 16.9k
  • 1
  • 43
  • 96