3

My question is similar to this question, of which I have found the solution here. The solution enables me to edit a Plot after it has been drawn, so that Mathematica doesn't have to compute everything it needs for the plot again.

Now I have the same question, but for a DensityPlot, or actually a ListDensityPlot (I'm assuming here that the answers to this question will be similar for both commands, correct me if I'm wrong). In particular, I have some ListDensityPlots of which I want to change the frame labels. How can I do this?

To give a specific example, given the plot

p = ListDensityPlot[Table[{x, y, x^2 - y^2}, {x, -1, 1, 1/100}, {y, -1, 1, 1/100}] 
// Flatten[#, 1] &, FrameLabel-> {x, y}],

can I add the option RotateLabel -> False afterwards using Show?

ScroogeMcDuck
  • 419
  • 2
  • 13

1 Answers1

4
p1 =
 ListDensityPlot[
  Table[x^2 - y^2, {x, -1, 1, 1/10.}, {y, -1, 1, 1/10.}],
  FrameLabel -> (Style[#, 14, Bold] & /@ {x, y}),
  PlotLabel -> Style["Rotated", 14, Bold],
  RotateLabel -> True];

p2 =
 Show[p1,
  RotateLabel -> False,
  PlotLabel -> Style["Not rotated", 14, Bold]];

Grid[{{p1, p2}}]

enter image description here

eldo
  • 67,911
  • 5
  • 60
  • 168
  • Thanks, strange that I didn't realize that this actually worked... So the FrameLabel soft options are options I can easily change with Show. Do you know how to change other "non-soft" options of the plot which, like the ColorFunction? – ScroogeMcDuck Nov 16 '15 at 13:00
  • With Show you can only change the options listed with Options[Graphics]. To change the ColorFunction you have to make another plot. – eldo Nov 16 '15 at 13:15