5

Here is my code:

\documentclass{article}
\usepackage{pgfplots}
\usetikzlibrary{shadows.blur}

\begin{document}

\tikzfading[name=fade down,
     top color=transparent!30,
     bottom color=transparent!0]

\begin{tikzpicture}
\begin{axis}[axis x line*=bottom,
             axis y line*=left, blur shadow] 
  \addplot[yshift=-2pt,ybar, blue, fill,path fading=fade down, rounded corners=2pt]
       coordinates{(1,2.9) (2,1.7) (3,4.2) (4,5.1) (5,4) (6,2.2)};
\end{axis}
\end{tikzpicture}
\end{document}

when I compile the code use pdflatex, the PDF is display correct. but when I compile using xelatex, in the generated pdf, the shadows became to black color.

why? how to fix it?

pdflatex output

xelatex output

Torbjørn T.
  • 206,688
Jack
  • 53

1 Answers1

7
\documentclass{article}
\def\pgfsysdriver{pgfsys-dvipdfmx.def}%%%% the correct driver for xelatex
\usepackage{pgfplots}
\usetikzlibrary{shadows.blur}
[...]