0

I wish I could draw some diagrams with pstricks. But I have a coordinate problem when I draw figures. For example, when I draw a rectangle using \psframe (0,0) (2,2), the rectangle does not appear to start from coordinates (0,0) but from a slightly higher value as you can see on the copy below

enter image description here

\documentclass{article}
\usepackage{pst-labo}
\begin{document}
\psset{unit=0.5cm}
\psgrid[subgriddiv=1, griddots=10, gridlabels=5pt, gridwidth=0.5pt](-2,-2)(6,6)
        %\colorlet{myfill}{brown!60}
        \psframe[fillstyle=solid, fillcolor=myfill](0,0)(0.25,13)   

        
        \end{document}

With the same code in overleaf, the problem does not recur

Where does the problem come from ?

thanks in advance`

4
  • 1
    Can you provide a complete minimal document that replicates this? I can't replicate this myself with an up-to-date TeXLive 2021.
    – Werner
    Sep 28, 2021 at 20:18
  • my guess would be that you are adding space tokens where you do not want them but as you have given no indication of the input hard to guess. Sep 28, 2021 at 21:42
  • @DavidCarlisle : I added my code
    – Nicolas
    Sep 29, 2021 at 4:30
  • @DavidCarlisle, I think I understood where the difference comes from: it comes from the command \colorlet {myfill} {brown! 60} but I don't understand why (I added my code in the initial post)
    – Nicolas
    Sep 29, 2021 at 4:40

2 Answers 2

3

put it into a pspicture environment!

\documentclass{article}
\usepackage{pst-labo}
\begin{document}
\psset{unit=0.5cm}
\pspicture
\psgrid[subgriddiv=1, griddots=10, gridlabels=5pt, gridwidth=0.5pt](-2,-2)(6,6)
\colorlet{myfill}{brown!60}
\psframe[fillstyle=solid, fillcolor=myfill](0,0)(0.25,13)   
\endpspicture
        
\end{document}

However, fillcolor=brown!60 makes live easier ...

1
  • +1 for Herbert with fillcolor=brown!60 makes live easier ... Sep 29, 2021 at 11:39
1

You are adding a space after the color let, which you can comment out:

\documentclass{article}
\usepackage{pst-labo}
\begin{document}
\psset{unit=0.5cm}
\psgrid[subgriddiv=1, griddots=10, gridlabels=5pt, gridwidth=0.5pt](-2,-2)(6,6)
        \colorlet{myfill}{brown!60}%%%%%
        \psframe[fillstyle=solid, fillcolor=myfill](0,0)(0.25,13)   

        
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .