[pstricks] Cannot compile Example

Michael Sharpe msharpe at ucsd.edu
Fri Feb 26 01:44:04 CET 2010


On Feb 25, 2010, at 3:42 PM, Ulrich Bongartz wrote:

> Hi,
>  
> when I try to compile the Example below (Pie-Chart). The Run stops with
>  
> Undefined control sequence \psPie[PieColor=color] ...
>  
> The black and white Piechart is ok.
>  
> What have I done worng?
>  
> thx in advance
>  
> Ulrich
>  
>  
> \documentclass{article}
> \usepackage[T1]{fontenc}
> \usepackage{pstricks-add}
> \definecolor{A-color}{hsb}{0.00 ,0.9, 0.9}
> \definecolor{B-color}{hsb}{0.65 ,0.9, 0.9}
> \SpecialCoor
>  
> \begin{document}
> \begin{center}
> \psset{framesep=1.5pt,unit=1.5cm}
> \begin{pspicture}(-2.1,-2.1)(2.1,2.1)
> \degrees[100]
> \pswedge[fillstyle=solid,fillcolor=gray,hatchcolor=gray]{2}{ 0 }{17 }
> \rput(1.2; 8 ){\psframebox*{\small 17 \%}}
> \uput{2.2}[ 8 ](0;0){\Large A él}
> \pswedge[fillstyle=hlines,fillcolor=gray,hatchcolor=gray]{2}{17 }{42 }
> \rput(1.2;29 ){\psframebox*{\Large 25 \%}}
> \uput{2.2}[29 ](0;0){\Large A dém}
> \pswedge[fillstyle=solid,fillcolor=white,hatchcolor=white]{2}{42 }{58 }
> \rput(1.2;50 ){\psframebox*{\Large 17 \%}}
> \uput{2.2}[50 ](0;0){\Large égal}
> \pswedge[fillstyle=hlines,fillcolor=gray,hatchcolor=gray]{2}{58 }{83 }
> \rput(1.2;71 ){\psframebox*{\Large 25 \%}}
> \uput{2.2}[71 ](0;0){\Large B dém}
> \pswedge[fillstyle=solid,fillcolor=gray,hatchcolor=gray]{2}{83 }{100 }
> \rput(1.2;92 ){\psframebox*{\Large 17 \%}}
> \uput{2.2}[92 ](0;0){\Large B él}
> \rput(0;0){\psframebox*{\bfseries 0/0}}
> \end{pspicture}
>  
> \vspace{1cm}
> \psframebox[fillcolor=black!20,fillstyle=solid]{%
> \begin{pspicture}(-3.5,-3.5)(4.25,3.5)
> \psPie[pieColor=color]{23, 29, 3, 26, 28, 14, 17, 4, 9}{}{2}
> \multido{\iA=1+1}{9}{%
>   \ncline[linecolor=-pieFillColor\iA,
>     nodesepB=-10pt]{psPieO\iA}{psPie\iA}
>   \rput[l](psPieO\iA){%
>     \textcolor{pieFillColor\iA}{pie no \iA}}}
> \end{pspicture}}
> \end{center}
>  
> 
> \end{document}
> _______________________________________________

The macros formerly known as \psPie etc are now called \psChart etc in recent pstricks-add. Try instead:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{pstricks-add}
\definecolor{A-color}{hsb}{0.00 ,0.9, 0.9}
\definecolor{B-color}{hsb}{0.65 ,0.9, 0.9}
\SpecialCoor
 
\begin{document}
\begin{center}
\psset{framesep=1.5pt,unit=1.5cm}
\begin{pspicture}(-2.1,-2.1)(2.1,2.1)
\degrees[100]
\pswedge[fillstyle=solid,fillcolor=gray,hatchcolor=gray]{2}{ 0 }{17 }
\rput(1.2; 8 ){\psframebox*{\small 17 \%}}
\uput{2.2}[ 8 ](0;0){\Large A él}
\pswedge[fillstyle=hlines,fillcolor=gray,hatchcolor=gray]{2}{17 }{42 }
\rput(1.2;29 ){\psframebox*{\Large 25 \%}}
\uput{2.2}[29 ](0;0){\Large A dém}
\pswedge[fillstyle=solid,fillcolor=white,hatchcolor=white]{2}{42 }{58 }
\rput(1.2;50 ){\psframebox*{\Large 17 \%}}
\uput{2.2}[50 ](0;0){\Large égal}
\pswedge[fillstyle=hlines,fillcolor=gray,hatchcolor=gray]{2}{58 }{83 }
\rput(1.2;71 ){\psframebox*{\Large 25 \%}}
\uput{2.2}[71 ](0;0){\Large B dém}
\pswedge[fillstyle=solid,fillcolor=gray,hatchcolor=gray]{2}{83 }{100 }
\rput(1.2;92 ){\psframebox*{\Large 17 \%}}
\uput{2.2}[92 ](0;0){\Large B él}
\rput(0;0){\psframebox*{\bfseries 0/0}}
\end{pspicture}
 
\vspace{1cm}
\psframebox[fillcolor=black!20,fillstyle=solid]{%
\begin{pspicture}(-3.5,-3.5)(4.25,3.5)
\psChart[chartColor=color]{23, 29, 3, 26, 28, 14, 17, 4, 9}{}{2}
\multido{\iA=1+1}{9}{%
  \ncline[linecolor=-chartFillColor\iA,
    nodesepB=-10pt]{psChartO\iA}{psChart\iA}
  \rput[l](psChartO\iA){%
    \textcolor{chartFillColor\iA}{pie no \iA}}}
\end{pspicture}}
\end{center}
 

\end{document}

Michael





More information about the PSTricks mailing list