3

I tried compiling a bunch of files today, all of which use tikzpictures and pgfplots. Something truly odd is happening with how the y-axis label is being positioned.

I took the MWE from Positioning of Pgfplot axis labels (copied below) as a starting point -- expecting the figure to be rendered looking just like the following:

what it should look like

However, when I compile the MWE using latest and greatest MikTeX (crucially, by using the .tex -> .dvi -> .ps -> .pdf compilation sequence), and tikz and pgfplot packages, this is what I'm now getting -- notice that the y-axis label is waaay off to the left, and not centred wrt to the y-axis. At all...

this is the bug

This is a huge issue for me, since I have files with many such diagrams -- when I compile them, every one of this sort of figure has a wonky axis label, which changes the size of the image when rendered, and throws off the formatting altogether.

I don't really know what the culprit is, but...I can try rolling back to earlier versions of tiks, and pgfplot, and see if that matters.

In the meantime -- comments? Suggestions?

Here is the MWE code:

\documentclass[12pt,letterpaper,oneside]{article}

\usepackage{tikz}
   \usetikzlibrary{decorations,shapes,arrows,positioning}
\usepackage{pgfplots}

\begin{document}


\begin{tikzpicture}
\begin{axis}[
   axis lines=middle,
   axis line style={->},
   x label style={at={(axis description cs:0.5,-0.1)},anchor=north},
   y label style={at={(axis description 
   cs:-0.1,.5)},rotate=90,anchor=south},
   xlabel={$u$ unemployment},
   ylabel={$\pi$ inflation}]
   \addplot[black,samples=100,domain=0:1] {120*(1-x)^(1/3)-1};
\end{axis}
\end{tikzpicture}

\end{document} 

As per request: here is the output from \listfiles, using the MikTeX install with the update to pgf installed:

*File List*
article.cls    2018/09/03 v1.4i Standard LaTeX document class
size12.clo    2018/09/03 v1.4i Standard LaTeX file (size option)
tikz.sty    2019/07/17 v3.1.4a (3.1.4a)
 pgf.sty    2019/07/17 v3.1.4a (3.1.4a)
pgfrcs.sty    2019/07/17 v3.1.4a (3.1.4a)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
pgfrcs.code.tex
pgfcore.sty    2019/07/17 v3.1.4a (3.1.4a)
graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
dvips.def    2017/06/20 v3.1d Graphics/color driver for dvips
pgfsys.sty    2019/07/17 v3.1.4a (3.1.4a)
pgfsys.code.tex
pgfsyssoftpath.code.tex    2019/07/17 v3.1.4a (3.1.4a)
pgfsysprotocol.code.tex    2019/07/17 v3.1.4a (3.1.4a)
xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg    2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
pgfcomp-version-0-65.sty    2019/07/17 v3.1.4a (3.1.4a)
pgfcomp-version-1-18.sty    2019/07/17 v3.1.4a (3.1.4a)
pgffor.sty    2019/07/17 v3.1.4a (3.1.4a)
pgfkeys.sty    
pgfkeys.code.tex
pgfmath.sty    
pgfmath.code.tex
pgffor.code.tex
tikz.code.tex
pgfplots.sty    2018/03/28 v1.16 Data Visualization (1.16)
  • 1
    The example works fine for me, with an up to date TeX Live 2019. Could you add \listfiles before \documentclass, recompile, and then add the .log file to your question? Perhaps there are some hints there, as to what is wrong. – Torbjørn T. Jul 26 '19 at 19:28
  • Will do, but I'd already switched back to a MikTeX install I archeved back in early June. Compilation went perfectly, and the plot looks exactly like it should. So, something happened between June -> present. – Johnny Canuck Jul 26 '19 at 19:36
  • 1
    The example work fine with my recent MikTeX (64-bit) installation. – Zarko Jul 26 '19 at 19:39
  • I just tried again, with a MikTeX install I archived 22 July (so, only a few days ago). I do this routinely whenever there are major package updates. The bug (as I'm calling it for the moment), shows up. Moving back a bit earlier (July 7), no bug -- image renders fine. If I look for package updates for this 7 July version, I see an update for pgf (3.1.3 -> 3.1.4a, which was packaged on 20 July). If I apply this update, to pgf, then the bug shows up. So the problem is definitely something that happened to pgf, between 3.1.3 and 3.1.4a – Johnny Canuck Jul 26 '19 at 19:49
  • if it matters, I'm using 64-bit MikTex, under Win 7 Pro. I comile from.tex -> .dvi, using LaTeX (not Xetex, or anything else), and for the final compile, .tex -> dvi -> ps -> pdf. – Johnny Canuck Jul 26 '19 at 20:03
  • dvips.def suggests it, but to be absolutely sure: Are you compiling to a PDF or to DVI? What engine (LaTeX, pdfLaTeX, XeLaTeX, LuaLaTeX, ...) are you using? I tested with pdfLaTeX, LuaLaTeX and XeLaTeX with a fully up-to-date MikTeX and things worked fine. LaTeX's DVI output looks really odd in Yap, even worse than what you show, so I'm not sure if something else is going on at my end. – moewe Jul 26 '19 at 20:04
  • 1
    Ah, I see you anticipated my comment. I can reproduce the output with the DVI -> PS -> PDF route (latex file, dvips file, ps2pdf file). Please add that crucial info directly to your question. – moewe Jul 26 '19 at 20:06
  • Yep, see the same with that compilation route. (Didn't even think of trying it before, only tested pdf/xe/lualatex.) – Torbjørn T. Jul 26 '19 at 20:10
  • For the record: If you believe you have found a bug in a package (and it appears you are reasonably convinced you have), you should always contact the package maintainer/developer through their preferred communication channels for bugs even if you have good reason to believe that they will read your question here. In this case https://github.com/pgf-tikz/pgf/issues seems to be a good place to report the issue (it is listed as bug report page on CTAN and one of the first pages of the manual). – moewe Jul 26 '19 at 20:11
  • moewe -- It looks like we posted at the same time -- mine answering yours, partially. I use straight LaTeX. Period. If I 'texify' (which will mean something to MikTeX users), I go straight to .dvi -- figure iswrong (as described). If I go .dvi -> .ps -> PDF, figure is wrong (as described). Now, if I PDFtexify (again, a MikTeX thing), the image is correct. So, what that tells me is that the new pgf introduces a bug which cause a problem with the .dvi file, which carries through to the PDF (if you go through the sequence .dvi -> .ps -> PDF). – Johnny Canuck Jul 26 '19 at 20:13
  • Johnny, if you add an at-sign before the username, the user will be notified of your comment. You as the owner of the post is notified of all comments. (@moewe I deleted my previous comment, as I hadn't fully read all the comments above.) – Torbjørn T. Jul 26 '19 at 20:17
  • Thanks for all the help, and the pointers to how to use StackExchange more effectively in future. I'll post a 'bug report' with the pgf folks. – Johnny Canuck Jul 26 '19 at 20:53
  • 1
    I posted a bug report on the github site for pgf/tikz (they lkeft SourceForge for Github). The report can be found here: https://github.com/pgf-tikz/pgf/issues/722 – Johnny Canuck Jul 26 '19 at 21:36
  • @JohnnyCanuck if you use the dvi-ps-pdf sequence because of .eps figures then maybe just using pdflatex would be an option (.eps figures are automatically converted to pdf in that case)? – Marijn Jul 27 '19 at 14:17
  • @Marijn True, and fair point -- but there are a lot of reasons why I use the sequence I do (not just .eps figures, although it is a big one). I do a fair amount of 'fiddling' with the .ps file following .tex -> .dvi -> .ps. Yes, I can go from PDF -> .ps, but that doesn't always work well. SImply put, pgf is broken -- the fact that I could try pdflatex as a workaround for some jobs doesn't change the fact. – Johnny Canuck Jul 27 '19 at 20:58

0 Answers0