\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)
\psChart{2,2,3,2}{}{3}
\psdot[linecolor=red](psChart2)
\uput[r](psChart2){\textcolor{red}{psChart2}}
\psdot[linecolor=green](psChartI2)
\uput[r](psChartI2){\textcolor{green}{psChartI2}}
\psdot[linecolor=blue](psChartO2)
\uput[r](psChartO2){\textcolor{blue}{psChartO2}}
\psdot[linecolor=red](psChart3)
\uput[r](psChart3){\textcolor{red}{psChart3}}
\psdot[linecolor=green](psChartI3)
\uput[r](psChartI3){\textcolor{green}{psChartI3}}
\psdot[linecolor=blue](psChartO3)
\uput[r](psChartO3){\textcolor{blue}{psChartO3}}
\end{pspicture}
\end{document}
![]() |
| Fig.1 Three useful nodes defined by command \psChart. |
Files Downloads: tex ps pdf
Now a practical example of plotting a pie chart will be presented.
\documentclass{article}
\usepackage{pstricks}
\usepackage{pstricks-add}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-5,-5)(5,5)
\psChart{5,4,4,3,3}{}{3}
\rput(psChartI1){\textcolor{red}{5}}
\rput(psChartI2){\textcolor{red}{4}}
\rput(psChartI3){\textcolor{red}{4}}
\rput(psChartI4){\textcolor{red}{3}}
\rput(psChartI5){\textcolor{red}{3}}
\psset{nodesepA=5pt,nodesepB=-10pt}
\rput(psChartO1){{US}}
\rput(psChartO2){{EU}}
\rput(psChartO3){{China}}
\rput(psChartO4){{Japan}}
\rput(psChartO5){{Others}}
\end{pspicture}
\end{document}
![]() |
| Fig.2 A practical example of pie chart plotting. |
In this example, we put the labels using the nodes which have been defined by "\psChart".
Files Downloads: tex ps pdf


