Is there a way to reliably test the equality of two plots? Consider this:
plot1 = Plot[Sin[x], {x, 0, 2Pi}];
plot2 = Plot[Sin[x], {x, 0, 2Pi}];
You'd think these would be equal, but they're not.
Evaluate[plot1 == plot2]
SameQ
doesn't work either:
Evaluate[plot1 === plot2]
(* False *)
At least this works:
Evaluate[plot1 == plot1]
(* True *)
Edit:
@eyorble provided a nice answer, but the plot thickens. How can we also get False
when two plots are not equal?
plot3 = Plot[Cos[x], {x, 0, 2Pi}];
(plot1 == plot3) /. (x_String :> StringReplace[x, "Charting`Private`Tag$" ~~ __ -> "Charting`Private`Tag"])