是否有可能更改打印节点的选项(例如颜色)?我用 multido 创建了很多节点,并想更改它们的外观。打印后有什么办法吗?
背景:我想规划生物实验,并用不同的颜色为圆圈(对应样本)着色,如下所示:
梅威瑟:
% !TeX encoding = UTF-8
% !TeX program = xelatex
\documentclass{scrartcl}
\usepackage{pstricks,pst-node,multido,fp}
\begin{document}
\FPset{\AnzahlX}{6}
\FPset{\AnzahlY}{4}
\FPset{\AbstandX}{1.57}
\FPset{\AbstandY}{1.47}
\FPset{\Abstand}{1.88}
\FPset{\Durchmesser}{1.5}
\FPdiv\Radius\Durchmesser{2}
\begin{pspicture}(0.7,-0.7)(12.9,-8.7)%
%Rahmen
\pspolygon(0,0)(12.8,0)(12.8,-8.2)(12.4,-8.6)(0,-8.6)%
%
%Beschriftung
\multido{\nX=\AbstandX+\Abstand,\iN=1+1}{\AnzahlX}{\rput(\nX,0.5){\iN}}%
\multido{\nY=-\AbstandY+-\Abstand,\iC=65+1}{\AnzahlY}{\rput(-0.5,\nY){\char\iC}}%
%
%Wellplates
\multido{\nY=-\AbstandY+-\Abstand,\iX=1+1}{\AnzahlY}{\multido{\nX=\AbstandX+\Abstand,\iY=1+1}{\AnzahlX}{\Cnode[radius=\Radius](\nX,\nY){\iX\iY}}}%
\end{pspicture}
Now I want to change color from red to light red for Well A1 to A5
\end{document}
答案1
使用节点名称作为坐标,定义一个颜色系列,分为6个步骤:
\documentclass{scrartcl}
\usepackage{pst-node,multido}
\begin{document}
\def\AnzahlX{6}
\def\AnzahlY{4}
\def\AbstandX{1.57}
\def\AbstandY{1.47}
\def\Abstand{1.88}
\def\Durchmesser{1.5}
\pstFPdiv\Radius\Durchmesser{2}
\definecolorseries{foo}{rgb}{last}{red}{red!30!white}
\resetcolorseries[6]{foo}
\begin{pspicture}(0.7,-0.7)(12.9,-8.7)%
%Rahmen
\pspolygon(0,0)(12.8,0)(12.8,-8.2)(12.4,-8.6)(0,-8.6)%
%
%Beschriftung
\multido{\nX=\AbstandX+\Abstand,\iN=1+1}{\AnzahlX}{\rput(\nX,0.5){\iN}}%
\multido{\nY=-\AbstandY+-\Abstand,\iC=65+1}{\AnzahlY}{\rput(-0.5,\nY){\char\iC}}%
%
%Wellplates
\multido{\nY=-\AbstandY+-\Abstand,\iX=1+1}{\AnzahlY}{%
\multido{\nX=\AbstandX+\Abstand,\iY=1+1}{\AnzahlX}{%
\Cnode[radius=\Radius](\nX,\nY){N\iX\iY}}}%
%Now I want to change color from red to light red for Well A1 to A5
\multido{\iA=1+1}{\AnzahlX}{%
\pscircle[fillstyle=solid,fillcolor=foo!!+](N1\iA){\Radius}}
\end{pspicture}
\end{document}
答案2
具体到您按顺序更改 A1 到 A6 颜色的示例,您可以添加选项,例如用特定颜色填充节点。下面我添加了fillstyle=solid
确保第一行已填充并fillcolor=red!<C>!lightred
成为填充颜色;测量和<C>
之间的颜色份额(定义为和的混合),该份额从 100% 减少到最后一个圆圈中的(几乎)100% 。red
lightred
red
white
red
lightred
\documentclass{article}
\usepackage{pst-node,multido,fp}
\begin{document}
\FPset{\AnzahlX}{6}
\FPset{\AnzahlY}{4}
\FPset{\AbstandX}{1.57}
\FPset{\AbstandY}{1.47}
\FPset{\Abstand}{1.88}
\FPset{\Durchmesser}{1.5}
\FPdiv\Radius\Durchmesser{2}
\colorlet{lightred}{red!30!white}
\begin{pspicture}(0.7,-0.7)(12.9,-8.7)%
%Rahmen
\pspolygon(0,0)(12.8,0)(12.8,-8.2)(12.4,-8.6)(0,-8.6)%
%Beschriftung
\multido{\nX=\AbstandX+\Abstand,\iN=1+1}{\AnzahlX}{\rput(\nX,0.5){\iN}}%
\multido{\nY=-\AbstandY+-\Abstand,\iC=65+1}{\AnzahlY}{\rput(-0.5,\nY){\char\iC}}%
%Wellplates
\multido{\nY=-\AbstandY+-\Abstand,\iX=1+1}{\AnzahlY}
{\multido{\nX=\AbstandX+\Abstand,\iY=1+1,\iC=100+-16}{\AnzahlX}
{\ifnum\iX=1
\Cnode[radius=\Radius,fillstyle=solid,fillcolor=red!\iC!lightred](\nX,\nY){\iX\iY}
\else
\Cnode[radius=\Radius](\nX,\nY){\iX\iY}
\fi
}
}%
\end{pspicture}
Now I want to change color from red to light red for Well A1 to A6
\end{document}