Graphics, Figures & TablesPicture only appears as one Pixel

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
gonlatex
Posts: 2
Joined: Sun Feb 10, 2013 5:12 am

Picture only appears as one Pixel

Post by gonlatex »

I have a new installation of tikz (apt-get install pgf) on Debian. I have been using Latex for a couple of weeks and wanted to explore tikZ graphics. I have started out with some examples from tutorials. Whenever I run tikZ the pictures either do not appear or appear as a dot. On some cases where there are labels with the picture, the labels will all be bunched up around one spot on the page.

The following code produces the words "We are working on" with a dot roughly one inch to the right of the text.

Code: Select all

\documentclass{article} % say
\usepackage{tikz}
\begin{document}
We are working on
\begin{tikzpicture}
\draw (-1.5,0) -- (1.5,0);
\draw (0,-1.5) -- (0,1.5);
\end{tikzpicture}.
\end{document}
Any help is appreciated. I have been searching the web for solutions to this for several days and have found nothing.
Attachments
tikzEx1.log
This is the log file. Don't know if it helps.
(11.87 KiB) Downloaded 260 times

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Picture only appears as one Pixel

Post by localghost »

Convert the DVI output further to PS (and perhaps to PDF) and view the resulting output. Alternatively compile directly with PDFLaTeX.


Best regards and welcome to the board
Thorsten
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Re: Picture only appears as one Pixel

Post by Stefan Kottwitz »

Hi,

welcome to the board!

I would use pdfLaTeX instead of LaTeX in DVI mode, as Thorsten mentioned as option. Click on "Open in writeLaTeX" above your code, to see that it's working.

Stefan
LaTeX.org admin
gonlatex
Posts: 2
Joined: Sun Feb 10, 2013 5:12 am

Picture only appears as one Pixel

Post by gonlatex »

Thank you both of you.

This gave me a DVI file that I viewed with Evince or XDVI giving the one pixel picture.

Code: Select all

$ latex tikzEx1.tex
Evidently the information is in the DVI file but Evince and XDVI do not know how to display it.

Both

Code: Select all

$ latex tikzEx1.tex
$ dvipdf tikzEx1.dvi
and

Code: Select all

$ pdflatex tikzEx1.tex
gave PDF files that had good pictures.
Post Reply