我正在使用以下代码创建饼图:
\begin{center}
\begin{pspicture}(-5,-4)(4,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},chartSep=10pt,shadow,shadowsize=3pt]{\above,\below}{}{3}
\bfseries%
\rput(psChartI1){TEXTA \above \%}\rput(psChartI2){TEXTB \below \%}
\end{pspicture}
\end{center}
目前 TEXTA 和 TEXTB 是沿着圆周对齐的,有什么方法可以使该文本居中对齐吗?
更新:(与 MWE 一起);
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{pgfplots, pgfplotstable}
\usepackage{datatool}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{pspicture}(-5,-4)(4,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},chartSep=10pt,shadow,shadowsize=3pt]{30,70}{}{3}
\bfseries%
\rput(psChartI1){TEXTA 30 \%}\rput(psChartI2){TEXTB 70 \%}
\end{pspicture}
\end{center}
\end{document}
答案1
将内部图表节点的距离设置为0.5:
\documentclass{article}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}(-5,-4)(4,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},chartSep=10pt,chartNodeI=0.5,%%%%%
shadow,shadowsize=3pt]{30,70}{}{3}
\rput(psChartI1){\bf TEXTA 30\%}
\rput(psChartI2){\bf TEXTB 70\%}
%\psdots(psChartI1)(psChartI2)%% for a test
\end{pspicture}
\end{document}
答案2
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add}
\begin{document}
\multido{\i=0+15}{24}{%
\begin{pspicture}(-4,-4)(4,4)
\psset{unit=1.2}
\psChart[userColor={black!10,black!40},chartSep=10pt,shadow,shadowsize=3pt]{30,70}{}{3}
\bfseries
\rput{\i}(1.5;54){TEXTA 30 \%}
\rput{\i}(1.5;234){TEXTB 70 \%}
\end{pspicture}}
\end{document}