# Change options of a pstricks node after it is printed

is there any possibility to change the options (for example color) of a printed node? I create a lot of nodes with multido and want to change their appearance. Is there any way to do it after it got printed?

Background: I want to plan biological experiments and color the circles (corresponding to a sample) in a different color like this:

MWE:

% !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}
\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
\end{pspicture}
Now I want to change color from red to light red for Well A1 to A5
\end{document}


• Why do you want to change it afterwards? Wouldn't it be more efficient (and possible) to do it while creating the circles? – TeXnician Aug 24 '17 at 18:13
• Werner gave me a good idea. This works, but is somewhat a lot defining. In my mind was something like \mycommand{Row1}{StartColor}{EndColor}, as I want to set different colors to different rows. – Niklas Aug 24 '17 at 21:30

Use the node names for the coordinates and define a color series with 6 steps:

\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}

\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}{%
%Now I want to change color from red to light red for Well A1 to A5
\multido{\iA=1+1}{\AnzahlX}{%
\end{pspicture}

\end{document}


• Thanks Herbert, this is something i can use to do a easy command for adding color to the wells. – Niklas Aug 25 '17 at 11:54
• Is there a command like \stepcolorseries that does just step through the colorseries? – Niklas Aug 27 '17 at 12:50
• As far as I know yes, but you have to read the documentation. – user2478 Aug 30 '17 at 19:20

Specific to your example of changing the colours for A1 through A6 in a sequential manner, you can add options like for filling the nodes with a specific colour. Below I've added fillstyle=solid to ensure that the first row is filled and fillcolor=red!<C>!lightred be the fill colour; <C> measures the share of colour between red and lightred (defined as a mixture of red and white) which decreases from 100% red to (almost) 100% lightred in the last circle.

\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}

\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
\else
\fi
}
}%
\end{pspicture}

Now I want to change color from red to light red for Well A1 to A6

\end{document}