Okay, but this doesn't really work if you actually use ColorFunction
in a nontrivial way. E.g., consider:
plotd = Plot[1, {x, 0, 1}, ColorFunction -> (GrayLevel[#1] &), ImageSize -> 600]
The axes, ticks, and labels are still transformed like in plotb
, and, while the Normal
trick fixes that, it destroys the gradient which was the whole point of using ColorFunction
to begin with.
In any case, it is helpful (at least, in an abstract way) to know that this is a GraphicsComplex
issue. Indeed, upon further investigation it seems pretty clear that the issue is that GraphicsComplex
has a weird effect on PlotRangePadding
. For example,
Graphics[{Black, AbsoluteThickness[1.6], GraphicsComplex[{{0, 1}, {1, 1}}, Line[{{1, 2}}]]},
ImageSize -> 600, Axes -> True, AspectRatio -> GoldenRatio^(-1)]
doesn't even have the right dimensions, but using the PlotRangePadding
options that InputForm
reveals that plota
is using...
Graphics[{Black, AbsoluteThickness[1.6], GraphicsComplex[{{0, 1}, {1, 1}}, Line[{{1, 2}}]]},
ImageSize -> 600, Axes -> True, AspectRatio -> GoldenRatio^(-1),
PlotRangePadding -> {{Scaled[0.02`], Scaled[0.02`]}, {Scaled[0.05`], Scaled[0.05`]}}]
yields an image which is identical to plota
.
But, even though this seems like the underlying explanation (subject, of course, to someone who actually knows what's going on saying otherwise), I still can't figure out how to use PlotRangePadding
to get plota
and plotb
to be identical.