1

I tried to make two lines:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (1,1) -- (2,1);
\draw (1,1) -- (1,2);
\end{tikzpicture}
\end{document}

To my surprice, only lines are drawn that are at an angle of about 45 degrees. I tried many other things, but I cannot find the clue to solve this. Can somebody help me ? (the first time using TikZ).

Extra info: Now I found out that the problem only occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines as expected). Thus the question now becomes: Why are the lines I see in the DVI-output not the same as in the PDF-output?

  • 1
    You tried to make two lines and you were successful with it. Actually, the angle of these lines is 90 degrees. What is your problem to solve? – bmv Jan 24 '18 at 20:29
  • 1
    Welcome to TeX.Stackexchange! This is what I get from your MWE: i.stack.imgur.com/j7L66.png Can you share your output? – user36296 Jan 24 '18 at 20:41
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:06
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:07
  • what do you use to view the dvi file, and please show an image of your output (as a new user you may have to remove the ! from the image link after uploading it, so it appears as a link not inline) – David Carlisle Jan 27 '18 at 10:35
3

I have inserted a grid. Maybe it could help you solve your problem? Let me know if I have helped you.

enter image description here

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[domain=-5:5, scale=0.65, baseline=0, >=stealth]
\draw (0,0)--(5,0);
\foreach \x in {0,...,5}
\draw (\x,0)--(\x,-.1) node[anchor=north] {\x};
\draw (0,0)--(0,5);
\foreach \y in {0,...,5}
\draw (0,\y)--(-.1,\y) node[anchor=east] {\y};
\draw[step=1cm, draw=lightgray, thin] (-5,-5) grid (5,5);
\draw (1,1) -- (2,1);
\draw (1,1) -- (1,2);
\end{tikzpicture}
\end{document}
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:06
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:07
  • The file DVI is a file called Device Indipendent. Look this link: tex.stackexchange.com/questions/98704/… – Sebastiano Jan 27 '18 at 10:11
  • 2
    @JacquesSmeets by default, if using latex, tikz and the latex graphics package will use \special designed for the dvips dvi to postscript driver. If you view the dvi in an on-screen dvi viewer then you may see nothing at all or may see something if the viewer can emulate some dvips specials. Most dvi viewers though can not use full PostScript capabilities. So what you see depends on which viewer you use, If I use xdvi, the lines appear at right angles as expected. – David Carlisle Jan 27 '18 at 10:32
2

Nobody cannot reproduce your issue. I think it is related to applying different scaling factors on horizontal and vertical directions.

\documentclass[border=12pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[ultra thin,green] (0,-1) grid (3,3);
\draw (1,1) -- (2,2);
\draw (1,1) -- (2,0);
\end{tikzpicture}
\begin{tikzpicture}[xscale=.25]
\draw[ultra thin,green] (0,-1) grid (3,3);
\draw (1,1) -- (2,2);
\draw (1,1) -- (2,0);
\end{tikzpicture}
\end{document}

enter image description here

  • For my opinion is correct too your answer. +1 colleague. . – Sebastiano Jan 25 '18 at 20:44
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:07
  • Extra info: Now I found out that the problem ony occurs if the output profile is LATEX --> DVI. If the output Profile is LATEX --> PDF, then there is no problem (the pdf-output are the two orthogonal lines). Thus the question now becomes: Why are the lines I ssee in the DVI-output not the same as in the PDF-output? – Jacques Smeets Jan 26 '18 at 21:08
  • I left a comment to the same query inder the other answer – David Carlisle Jan 27 '18 at 10:32

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.