Menu

#153 [fillbetween] gives odd placement of `axis` environment when `tikzpicture` is `scale`d

v1.0 (example)
pending
5
2017-12-23
2017-02-14
No

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.

Discussion

  • Christian Feuersänger

    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".

    \documentclass{article}
    
    \usepackage{pgfplots}
    
    \pgfplotsset{compat=1.15}
    
    \begin{document}
    The box for the tikzpicture appears to be much higher than it should be.\\
    \begin{tikzpicture}[scale=0.75]
    \pgfplotsset{cell picture=false}
    \begin{axis}
    \addplot {x};
    \end{axis}
    \end{tikzpicture}
    \end{document}
    
     
  • Christian Feuersänger

    drawing and \fbox around this picture shows that the bounding box is plain wrong.

     

    Last edit: Stefan Pinnow 2017-12-23
  • Christian Feuersänger

    • status: open --> pending
     
  • Christian Feuersänger

    I have addressed this issue. I will test it in the next days (unless you are faster, @ Stefan)

    This issue occurs whenever cell picture=false was in effect. This is true whenever you use set layers (which is also the case for fill between).

    I am unaware of other use-cases involved cell picture=false.

     

    Last edit: Stefan Pinnow 2017-12-23
  • Christian Feuersänger

    Side-note: I am wondering if cell picture=false should become the default... in this case, scale=0.5 does 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
  • Christian Feuersänger

    there is a different issue of this sort: see https://sourceforge.net/p/pgfplots/bugs/199/ . apparently, the bounding box does not reflect shifts.

     
  • Christian Feuersänger

    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=true but is inherently wrong for cell 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
MongoDB Logo MongoDB