1

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}
  • welcome to tex.se! please provide small complete document with your image. this will help us to help you. – Zarko Feb 8 at 13:14
  • Of course you're right, I added the image and the code used to produce it! – Alex Aiv. Feb 8 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 Feb 8 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. Feb 8 at 14:08
1

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}
  • Cheers, that did it! I am surprised there is no one command though. Anyway, thanks again! – Alex Aiv. Feb 8 at 14:09

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.