[fillbetween] gives odd placement of `axis` environment when `tikzpicture`...
Brought to you by:
cfeuersaenger,
ludewich
Please have a look at http://tex.stackexchange.com/questions/353906 and my corresponding answer for the details of the bug (and a workaround).
It seems that this is not only related to fillbetween. Please also have a look at http://tex.stackexchange.com/questions/357733 and my corresponding answer.
The problem of https://tex.stackexchange.com/questions/353906/graphics-tikz-picture-placed-incorrectly-when-drawing-areas-between-curves can be reduced to the following minimal example.
The connection between the two examples comes from the fact that "fill between" invokes "set layers" which, in turn, invokes "cell picture=false".
drawing and
\fboxaround this picture shows that the bounding box is plain wrong.Last edit: Stefan Pinnow 2017-12-23
I have addressed this issue. I will test it in the next days (unless you are faster, @ Stefan)
This issue occurs whenever
cell picture=falsewas in effect. This is true whenever you useset layers(which is also the case forfill between).I am unaware of other use-cases involved
cell picture=false.Last edit: Stefan Pinnow 2017-12-23
Side-note: I am wondering if
cell picture=falseshould become the default... in this case,scale=0.5does not scale font sizes and the entire integration into the tikzpicture is deeper and more natural.I remember that I hesitated to do... there is a risk of regressions.
Last edit: Stefan Pinnow 2017-12-23
there is a different issue of this sort: see https://sourceforge.net/p/pgfplots/bugs/199/ . apparently, the bounding box does not reflect shifts.
I have experimented with fixes for bug 199 as well, but there is more to it: adding
rotate=90, for example, breaks all my attempts.I believe that the current approach to define the bounding box and all anchors after the paths is necessary for
cell picture=truebut is inherently wrong forcell picture=false. An attempt to change this failed, though -- I will need to think about it in more depth. That transformation matrix stuff is confusing.Last edit: Stefan Pinnow 2017-12-23