2

With the help of plotstyle and dotstyle one can realize scatterplots in pstricks. In the case one selects plotstlye=dots and dotstyle as +, o, otimes or similar one obtains little symbols drawed at each data position.

My question: How can I change the linewidth of these symbols without globally scaling them? In my case I am interested in creating thicker symbols than the default ones.

Minimal working example:

\documentclass\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage[final]{pst-pdf}

\begin{document}
  \begin{pspicture*}(0cm,-0.3cm)(1cm,0.3cm)  
    % some data...
    \savedata{\mydataA}[{{0.2,0}}]
    \savedata{\mydataB}[{{0.4,0}}]
    \savedata{\mydataC}[{{0.6,0}}]
    \savedata{\mydataD}[{{0.8,0}}]
    % set plotstyle and dotstyle
    \psset{plotstyle=dots, dotstyle=x} % or 'o', '+', 'otimes', ...
    % test A: simple plot -> too thin
    \dataplot{\mydataA}
    % test B: change linewidth -> only scaling, no relations are changed
    \dataplot[linewidth=3pt]{\mydataB}
    % test C: change dotscale  -> only scaling, no relations are changed
    \dataplot[dotscale=1.5]{\mydataC}
    % test D: change dotsize   -> only scaling, no relations are changed
    \dataplot[dotsize=5pt]{\mydataD}
  \end{pspicture*}
\end{document}

Only scaling, no changes in the relations:

enter image description here

Please note: The same question can be found here, but without an answer...

[EDIT] Overview over possible solutions:

  • Using bold versions B+, Bo, B|, Btriangle, Bsquare, Bpentagon and Basterisk
  • Most general: Defining new dotstyles (see here or Herbert's answer below).
3
\documentclass[pstricks]{standalone}
\usepackage{pst-plot}

\makeatletter
\@namedef{psds@z}{%
  \pst@gdot{\pst@number\pslinewidth SLW 
    -5 -5  moveto 5 5 L -5 5 moveto 5 -5 L stroke}}
\makeatother

\begin{document}
  \begin{pspicture}(0,-0.4)(2,0.4)  
    % some data...
    \savedata{\mydataA}[{0.2,0}]
    \savedata{\mydataB}[{0.7,0}]
    \savedata{\mydataC}[{1.3,0}]
    \savedata{\mydataD}[{1.8,0}]
    % set plotstyle and dotstyle
    \psset{plotstyle=dots, dotstyle=z}% z: new dotstyle 
    \dataplot{\mydataA}
    \dataplot[linewidth=2pt]{\mydataB}
    \dataplot[dotscale=1.5,linewidth=3pt]{\mydataC}
    \dataplot[linewidth=0.5pt]{\mydataD}
  \end{pspicture}
\end{document}

enter image description here

  • Thanks a lot! Since defining new dotstyles seems to be the only general answer, I will accept yours... – matheburg Apr 29 '14 at 15:30

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.