Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

It's my first post. I solved it when writing this so I send it anyway in case it helps someone.

When compiled with pdflatex.exe from MiKTeX 2.7 it works. When compiled with pdflatex.exe from MiKTeX 2.9 the fill opacity property of \addplot also compiles without errors but when opened in a pdf reader, the reader returns error: pgf@ca0.5 blablabla.

To fix this problem (I don't know why) you should avoid using packages: pstricks, pst-node, pst-plot, pst-circ.

Here's my corrected code

\documentclass[addressstd,a4paper,10pt]{article}

\usepackage{tikz}
\usepackage{pgfplots}
%\usepackage{pstricks, pst-node, pst-plot, pst-circ}

\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}

\addplot [black,thick,ybar interval,fill=black,] 
    coordinates {(22.1,68.9) (44.2,74.4) (88.4,86.5)};
\addlegendentry{one};

\addplot [blue,thick,ybar interval,fill=blue,fill opacity=.5] 
    coordinates {(22.1,78.9) (44.2,64.4) (88.4,86.5)};
\addlegendentry{two};

\end{semilogxaxis}
\end{tikzpicture}
\end{document}

Do you know why?

share|improve this question
    
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I see no problem with your code, apart from suprious ; after the legends, and the output is fine when I run in a pstricks compatible way. Which engine are you using? Have you seen tex.stackexchange.com/q/8413/15925? –  Andrew Swann Apr 8 at 7:03
    
Thanks Andrew. The problem (perhaps not in the code) is when uncomment the line: %\usepackage{pstricks, pst-node, pst-plot, pst-circ} using miktex 2.9 pdflatex (I am using texnic 1.0 to compile) –  Ernesto Apr 10 at 16:55
    
Ernesto, this issue is very, very probably not related to MiKTeX itself, but to the fact that in MiKTeX 2.7 you necessarily have older package versions of pgf/TikZ and PSTricks & co. –  Speravir Apr 10 at 23:57
    
My remarks about the output applied to when the line was uncommented. –  Andrew Swann Apr 11 at 9:32
    
Speravir: Thanks for the hint on versions (Miktex, pgf/Tikz and PSTricks). I put the label Miktex because it was how I (and perhaps others) identified the problem. It was hard, for me, to discover that the problem was in packages versions not in the compiler. –  Ernesto Apr 12 at 0:26
add comment

1 Answer 1

up vote 8 down vote accepted

use it this way:

[...]
\usepackage{ifpdf}
\usepackage{tikz}
\usepackage{pgfplots}
\ifpdf\else
  \usepackage{pstricks,pst-node,pst-plot,pst-circ}
  \psset{pgffunctions}
\fi
\begin{document}
[...]

then it will work with pdflatex --shell-escape, latex->dvips->ps2pdf, and xelatex

share|improve this answer
    
good answer! I can not vote because "my reputation" < 15 –  Ernesto Apr 10 at 16:53
    
you can accept the answer –  Herbert Apr 10 at 18:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.