Code: Select all
\fill[draw=black,color=lightgray] (1.5,4) rectangle (3.5,4.5);
What should I do?
Code: Select all
\fill[draw=black,color=lightgray] (1.5,4) rectangle (3.5,4.5);
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Read the pgf/tikZ user guide, which suggests another approach.psionman wrote:[…] What should I do?
Code: Select all
\filldraw[draw=black,fill=lightgray] (1.5,4) rectangle (3.5,4.5);
Code: Select all
\documentclass[11pt]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}[!ht]
\begin {center}
\begin{tikzpicture}
\filldraw[draw=black,color=lightgray] (1,1) rectangle (3,3);
\end{tikzpicture}
\end{center}
\end{figure}
\end{document}
Code: Select all
\filldraw[draw=black,fill=lightgray] (1.5,4) rectangle (3.5,4.5);
center
environment here due to unwanted vertical space. Simply replace by the \centering
command.Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis