5

I tried to compile the example in How to combine fill and pattern in a pgfplot bar plot? to answer the question here PGFplots ybar patterns not showing and the pattern doesn't appear when I use lualatex xelatex or pdflatex; it only works with latex+dvipdf. I have PGF 2.10 and PGFplots 1.8. Is there any known bug and workaround here?

I tried this code:

\documentclass[12pt]{article}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{patterns}


\begin{document}
\begin{tikzpicture}
\begin{axis}[ybar, samples=10, enlarge y limits=upper, ymin=0]
\addplot +[
    black,
    fill=yellow,
    postaction={
        pattern=north east lines
    }
]{rnd};
\end{axis}

\end{tikzpicture}
\end{document}

The result with pdflatex:

enter image description here

The result with latex+dvipdf:

enter image description here

The only warning that appears is

Package pgfplots Warning: running in backwards compatibility mode (unsuitable t ick labels; missing features). Consider writing \pgfplotsset{compat=1.8} into y our preamble.

By the way, I am not sure, but in one of my tests, it seemed that if I had only none bar, it worked.

cacamailg
  • 8,405
  • 2
    Unfortunately, xelatex doesn't support patterns. About lualatex I have no idea. – Gonzalo Medina May 31 '13 at 16:01
  • 1
    @GonzaloMedina your comment is no longer true: the unstable of PGF supports patterns in xelatex (can be downloaded from texample.net). But pdflatex should have worked; it is supposed to be the best-supported driver. – Christian Feuersänger May 31 '13 at 20:17
  • 1
    @ChristianFeuersänger Good to know. Thank you. Do you know when this unstable version will be the stable one? – Gonzalo Medina May 31 '13 at 20:23
  • @ChristianFeuersänger as I said I tried with all those drivers, I usually use pdflatex but it failed. Then I tried latex+dvipdf and to my surprise, it worked! Both xelatex and lualatex were tried after, with the same result as pdflatex. – cacamailg May 31 '13 at 21:21
  • @GonzaloMedina I am currently unfamiliar with the release plan of PGF. – Christian Feuersänger Jun 01 '13 at 14:31
  • 1
    @cacamailg could you provide the resulting pdf somewhere? Perhaps it really is corrupted somehow. Did you modify the mentioned source code somehow? Did you get error messages? Ah, and note that you need to configure a special driver for PGF in order to use xelatex (please inspect the manual for details; I don't have it at hand now) – Christian Feuersänger Jun 01 '13 at 14:33
  • @ChristianFeuersänger I didn't modify the code that I mention. – cacamailg Jun 01 '13 at 22:02
  • Can you try with the \usepackage{tikz} line removed? You don't have to load tikz as pgfplots load it automatically but maybe something is overwritten. – percusse Jun 01 '13 at 23:33
  • @percusse I tried your suggestion, but it gave me the same result. Can you try the example with pdflatex and see if it compiles fine? Maybe the "bug" only affects me. – cacamailg Jun 03 '13 at 12:38
  • You can check it here https://www.writelatex.com/211132bctsfk Ther version of the PGFPLOTS is outdated though. – percusse Jun 03 '13 at 12:45
  • @percusse As I said before, my version of PGF is 2.10 and PGFPlots 1.8. I think for know I will use the latex+dvipdf and wait for the new release of TeXLive 2013. – cacamailg Jun 03 '13 at 13:07
  • On my computer with your configuration, I still can't replicate it though. I'll try to check again in the evening. – percusse Jun 03 '13 at 13:30
  • Indeed, I can't replicate this. Win 7, MikTeX 2.9, TikZ CVS, pgfplots 1.8. Maybe it is something fixed in TikZ CVS? {Luq,Xe,PDF}LaTeX all render correctly. But Latex->dvi->PDF fails. – percusse Jun 03 '13 at 19:42
  • @percusse I will keep this open, and wait for TeXLive 2013, and see if it renders correctly. It is strange that yours Latex->dvi->PDF, because with me it is the only one that works :). I assume that probably it is fixed with TikZ CVS. – cacamailg Jun 03 '13 at 20:51
  • I'm experiencing the same issue (because of I'm using matlab2tikz). However, as mentioned in the matlab2tikz page, you should type \usepackage{tikz,pgfplots} \pgfplotsset{compat=newest}\pgfplotsset{plot coordinates/math parser=false} in your preamble. I did it and I'm not longer experiencing the warning (I guess the compact=newest is the responsible) – Mario S. E. Jun 17 '13 at 14:00
  • @MarioS.E. your solution doesn't work for me. – cacamailg Jun 17 '13 at 14:16
  • @cacamailg It was worth the try... I did get rid of the warning by doing so – Mario S. E. Jun 17 '13 at 14:37
  • This is 'works for me' with pdfLaTeX with an up-to-date TeX Live 2013: are you still seeing an issue? – Joseph Wright Aug 17 '13 at 09:54
  • 1
    This question appears to be off-topic because it is about a problem solved by updating the software – egreg Nov 02 '13 at 22:47

0 Answers0