Add gridlines to a output plot in Mathemaitca
- by xslittlegrass
I'm trying to add gridlines to a output density plot in Mathematica. The plot is generated by a long calculation in Mathematica and when I do the plot I forget to add the Mesh-True options. I don't want to do all the calculation and generate the plot again since it takes a long time. Is that possible to add the gridlines or mesh lines to plot ONLY using the output plot at hand?
For example, If I have a plot p. Is it possible to add the mesh lines ONLY manipulate p?
In a ordinary one dimensional plot, this will work
p1 = Plot[Sin[x], {x, -3, 3}];
Insert[p1, GridLines -> Automatic, -1]
But when I try the density plot, it seems the gridlines is always under the plot, and can be seen only at the image margin area.
p2 = DensityPlot[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, PlotRangePadding -> 0.2];
Insert[p2, GridLines -> Automatic, -1]
Updata
The Mesh option on the output plot will not work because Mesh is not a options of a Graphics:
Show[p2,Mesh->True]
will give a message "an unrecoginzed option name(Mesh) was encountered while rendering a Graphics"
Thanks.