2

enter image description here

I have drawn the Figure in the picture environment and I have these long lines (which act as the x1-x2 axes) in it. I would like to make these lines dashed, though.

Some googling turned up a command, \dashedline, but my editor (TeXstudio) says that it's an unknown command. Am I using it wrong? Should I add an extra package? I cannot find any information about it all.

Thanks!

Edit: I create the picture using the following code:

\begin{figure}[H]
    \hspace{2.8cm}
    \begin{picture}(300,125)
    \put(-5,70){\vector(-1,0){25}}
    \put(-53,67.5){$-\infty$}   

\put(-5,70){\line(1,0){280}} %x1 axis
\put(266,62){$x_1$}

\put(250,70){\vector(1,0){25}}
\put(278,67.5){$+\infty$}
\put(40,115){\vector(2,-1){90}}

\put(60,97){\line(1,2){6}}
\put(70,92){\line(1,2){6}}
\put(80,87){\line(1,2){6}}


\qbezier(115,78)(122,85)(130,80)
\put(117,83){\footnotesize $\theta$}

\linethickness{0.7 mm}
\put(130,-4){\line(0,1){150}}

\multiput(130,18)(11,0){10}{
    \multiput(0,0)(0,11){10}{+}}
\thinlines

\put(130,-5){\line(0,1){160}} %x2 axis  
\put(132.5,167){$x_2$}

\put(130,147){\vector(0,1){25}}
\put(118.5,175){$+\infty$}      

\put(130,-5){\vector(0,-1){25}}
\put(118.5,-37){$-\infty$}

\end{picture}
\vspace{1cm}
\caption{}
\label{fig:geom}
\end{figure}
4
  • welcome to tex.se! please provide small complete document with your image. this will help us to help you.
    – Zarko
    Commented Feb 8, 2019 at 13:14
  • Of course you're right, I added the image and the code used to produce it!
    – Alex Aiv.
    Commented Feb 8, 2019 at 13:29
  • (1) This is not a complete document. There is no documentclass etc. (2) Any reason why you are drawing in picture and not using the wastly more powerful tikz environment?
    – daleif
    Commented Feb 8, 2019 at 13:44
  • I tried tikz but decided to refrain from it, because it created a whole lot of issues and crahsed the editor constantly. I should give it another try probably.
    – Alex Aiv.
    Commented Feb 8, 2019 at 14:08

1 Answer 1

3

Use \multiput to draw many short lines which form a dashed line:

\documentclass{article}

\begin{document}

\begin{figure}
    \hspace{2.8cm}
    \begin{picture}(300,125)

\multiput(-30,70)(20,0){9}{\line(1,0){10}}


%    \put(-5,70){\vector(-1,0){25}}
    \put(-53,67.5){$-\infty$}   

%\put(0,70){\line(1,0){280}} %x1 axis
\put(266,62){$x_1$}

\put(130,70){\vector(1,0){145}}
\put(278,67.5){$+\infty$}
\put(40,115){\vector(2,-1){90}}

\put(60,97){\line(1,2){6}}
\put(70,92){\line(1,2){6}}
\put(80,87){\line(1,2){6}}


\qbezier(115,78)(122,85)(130,80)
\put(117,83){\footnotesize $\theta$}

\linethickness{0.7 mm}
\put(130,-4){\line(0,1){150}}

\multiput(130,18)(11,0){10}{
    \multiput(0,0)(0,11){10}{+}}
\thinlines

\put(130,-5){\line(0,1){160}} %x2 axis  
\put(132.5,167){$x_2$}

\put(130,147){\vector(0,1){25}}
\put(118.5,175){$+\infty$}      

\put(130,-5){\vector(0,-1){25}}
\put(118.5,-37){$-\infty$}

\end{picture}
\vspace{1cm}
\caption{}
\label{fig:geom}
\end{figure}

\end{document}
2
  • Cheers, that did it! I am surprised there is no one command though. Anyway, thanks again!
    – Alex Aiv.
    Commented Feb 8, 2019 at 14:09
  • @AlexAiv. Indeed, this is the way. So perhaps you can accept this user's answer ;-) Commented Mar 9, 2021 at 17:53

You must log in to answer this question.

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