I have a really complex function that takes a few hours to plot as a function of a parameter.
Few days later I realised that I named the axes wrong. Is there an easy way to edit the AxesLabels without running the plot again? (it takes too long!!)
I tried Show[%, AxesLabel-> {newname, newname2}]
but it doesn't change anything...
$\begingroup$
$\endgroup$
$\begingroup$
$\endgroup$
Very straightforward:
plot = Plot[Sin[x], {x, 0, 2 Pi}];
plot /. (AxesLabel -> _) -> (AxesLabel -> {"x", "y"})
$\begingroup$
$\endgroup$
You can copy and paste your graphic, add /. {"oldName1" -> "newName1", "oldName2" -> "newName2"}
after it, and evaluate :
$\begingroup$
$\endgroup$
Is this what you want?
g = Plot[Sin[x], {x, 0, 2 \[Pi]}]
Graphics[Line@Cases[g, Line[x__] :> x, \[Infinity]], PlotLabel -> "New labels", Options[g]]