4

I am trying to change the global default or customise individual size of the node plotted in the following code, however regardless what I do it seems I can only have two input for each node, either "{name} and {stuff}" or "{radius} and {name}"

Can any one help please? Thax in advance

an example follows

\begin{pspicture}(5.5,6)
\psset{arrowscale=1.5}
\psset{radius=5cm}
%\cnodeput(1,5){N11}{1}
\rput(1,5){\circlenode{5cm}{N11}{1}}
\cnodeput(1,1){N12}{4}
\cnodeput(5,5){N21}{2}
\cnodeput(5,1){N22}{3}
\ncline{-}{N21}{N12}
\end{pspicture}
3

Short answer: The radii of \cnodeput and \circlenode cannot be adjusted manually. For more details, read the following.

Details

More precisely, there are 2 types of circular nodes in PSTricks:

  • empty (circular) nodes that just draw a circle without contents, and
  • container (circular) nodes that contain a stuff enclosed by a circle.

The nodes in the former type are \cnode and \Cnode and the nodes in the latter type are \circlenode and \Circlenode. Macros whose names begin with a lower case (\cnode and \circlenode) will have a circle of radius that is automatically adjusted. Macros with uppercase initial names (\Cnode and \Circlenode) will have a circle of radius that is specified manually (but it has a default value for sure) ONLY by the radius option.

We also have:

  • \cnodeput (it should be named as \circlenodeput I think) is a syntatic sugar of \rput combined with \circlenode, and
  • \Cnodeput (it should be named as \Circlenodeput I think) is a syntatic sugar of \rput combined with \Circlenode.

IMHO, the adopted naming convention is really bad as it is not intuitive for us. I am really sorry for mentioning this criticism many times everywhere in my questions and answers.

The complete code (that has been modified for the sake of simplicity) is given as follows. Be careful that \circlenode{5cm}{N12}{1} is wrong syntax, it must be written as either \Circlenode[radius=5cm]{N12}{1} or \psset{radius=5cm}\Circlenode{N12}{1}.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}
\begin{document}
\begin{pspicture}(6,6)
\psset{radius=1cm}
\rput(1,1){\Circlenode{N12}{1}}% \circlenode{5cm}{N12}{1} is a wrong syntax! 
\Cnodeput(5,5){N21}{2}
\ncline{N21}{N12}
\end{pspicture}
\end{document}

enter image description here

  • 1
    Thank you very much Stiff! Changing to the capital letters is precisely the solution I am seeking!! Didn't know the difference before... – pzshane Jan 4 '14 at 21:40
2

use \Cnodeput(1,1){N12}{4} and \Circlenode{foo}{N11} instead. It takes the radius setting into account.

\documentclass{article}
\usepackage{pst-node}
\begin{document}

\begin{pspicture}(5.5,6)
\psset{radius=8mm}
\rput(1,5){\Circlenode{foo}{N11}}
\Cnodeput(1,1){N12}{4}
\Cnodeput(5,5){N21}{2}
\Cnodeput(5,1){N22}{3}
\ncline{-}{N21}{N12}
\ncarc[arcangle=45,arrowscale=2]{->}{foo}{N22}
\end{pspicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.