0

I am trying out pgf-pie and even simple examples seem to have some bug, because I get lots of Missing character: There is no b in font nullfont! errors and if I put all errors one after each other, they read blue!60blue!60,cyan!60,yellow!60..., so it must be something with the standard color definition in pgf-pie.

I am using Package: pgf-pie 2011/10/02 v0.2, has this maybe been fixed in later versions?

This is an MWE that leads to the given issue:

\documentclass{standalone}
\usepackage{pgf-pie}

\begin{document}

\begin{tikzpicture}[every label/.style={black}, nodes={white}]
  \pie {10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}
  \pie[pos={8,0}, square] {23/A, 27/B, 17/C, 13/D, 20/E}
  \pie[pos={2,-8}, cloud] {10/A, 20/B, 30/C, 20/D, 20/E}
\end{tikzpicture}
\end{document}
4
  • 1
    tikz uses nullfont so that any "stray characters" get dropped. So that's why the error is of that form, but of course there shouldn't be "stray characters" being generated, Someone knowing the package better will need to trace why it is trying to typeset the colour name, Jul 26 '20 at 16:08
  • @DavidCarlisle thanks, that sounds like an interesting concept, in that case probably the programming of pgf-pie has some flaws.
    – TobiBS
    Jul 26 '20 at 16:14
  • in the code it prints \thecolor. It doesn't seem to have any sense but shouldn't harm. Jul 26 '20 at 16:19
  • @UlrikeFischer would there be a way to fix this through a patch? Because the log files are getting very big if you draw more than one pie chart, so in the end I now have log files with more than 10MB and this is the only thing that annoys me.
    – TobiBS
    Jul 26 '20 at 16:24
2

you can try the following. But I didn't checked very thoroughly the code, so perhaps the \thecolor has function that I missed

\documentclass{standalone}
\usepackage{pgf-pie}
\makeatletter
\renewcommand{\pgfpie@findColor}[1]
{
  \pgfmathparse{int(mod(#1,\value{pgfpie@colorLength}))}
  \let\ci\pgfmathresult
  \foreach \c [count=\j from 0] in \pgfpie@color {
    \ifnum \j=\ci
    \xdef\thecolor{\c}
    %\thecolor %removed 
    \breakforeach
    \fi
  }
}
\makeatother

\begin{document}

\begin{tikzpicture}[every label/.style={black}, nodes={white}]
  \pie {10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}
  \pie[pos={8,0}, square] {23/A, 27/B, 17/C, 13/D, 20/E}
  \pie[pos={2,-8}, cloud] {10/A, 20/B, 30/C, 20/D, 20/E}
\end{tikzpicture}
\end{document}

4
  • Thanks Ulrike, but this code does not compile here, PDFlatex tells me it cannot find \pgfpie@color
    – TobiBS
    Jul 26 '20 at 16:45
  • I don't get it with this fix in texlive 2020. Jul 26 '20 at 16:46
  • Sorry I mixed up my files, but you were too fast. Actually it doesn't compile at all, because it says it cannot find \pgfpie@color. But it seems this is a difference between my and your version, I will patch the actual command in my current version and see what it does.
    – TobiBS
    Jul 26 '20 at 16:47
  • Thank you Ulrike, actually it fixes the issue and hence I opened an issue: github.com/pgf-tikz/pgf-pie/issues/2, introduced the fix as a pull request: github.com/pgf-tikz/pgf-pie/pull/3 and hope it fixes the issue for others, too.
    – TobiBS
    Jul 26 '20 at 16:59
-1

With etoolbox -- https://tex.stackexchange.com/a/130985/197451

enter image description here

\documentclass{standalone}
\usepackage{pgf-pie,etoolbox}

\begin{document}

\begin{tikzpicture}[scale=0.9]
\pie[pos={0,0},
    /tikz/every pin/.style={align=center},
    every only number node/.style={text=white},
    text=pin,
    rotate=240,
    explode=0.2,
    color={blue!70,cyan!70,red!70,orange!50}
    ]{10/A, 20/B, 30/C, 10/D, 10/E, 10/F, 10/G}

\pie[pos={0,-9cm},square,
     /tikz/every pin/.style={align=center},
     every only number node/.style={text=white},
     text=pin,
     rotate=240,
     explode=0.2,
     color={blue!70,cyan!70,red!70,orange!50}
     ]{23/A, 27/B, 17/C, 13/D, 20/E}

\pie[pos={0,-15cm},cloud,
     /tikz/every pin/.style={align=center},
     every only number node/.style={text=white},
     text=pin,
     rotate=240,
     explode=0.2,
     color={blue!70,cyan!70,red!70,orange!50}
     ]{10/A, 20/B, 30/C, 20/D, 20/E}

\end{tikzpicture}
\end{document}
1
  • Your answer does not take my question into account and it still produces the exact same error messages.
    – TobiBS
    Jul 26 '20 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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