pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
200 stars 35 forks source link

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

Open pgf-tikz-bot opened 7 years ago

pgf-tikz-bot commented 7 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/ Author: mo-gul Timestamp: 2017-02-14 21:25:50.705000

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.

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#7776 Author: cfeuersaenger Timestamp: 2017-12-22 16:04:03.125000

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}
pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#b8a6 Author: cfeuersaenger Timestamp: 2017-12-22 16:09:41.762000

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

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#e1d1 Author: cfeuersaenger Timestamp: 2017-12-22 16:40:03.005000

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#f537 Author: cfeuersaenger Timestamp: 2017-12-22 16:40:03.193000

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.

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#981f Author: cfeuersaenger Timestamp: 2017-12-22 16:41:16.596000

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.

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#0d59 Author: cfeuersaenger Timestamp: 2017-12-23 11:38:51.399000

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

pgf-tikz-bot commented 6 years ago

Migrated from SourceForge https://sourceforge.net/p/pgfplots/bugs/153/#7602 Author: cfeuersaenger Timestamp: 2017-12-23 12:22:58.039000

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.