Graphics, Figures & TablesErrors in picture

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Errors in picture

Post by pban92 »

I am not sure where is the mistake. The following code gives 8 errors :(

Code: Select all

\begin{figure}[ht!]
\begin{picture}(350,350)(0,0)
\put(15,05){\includegraphics[width = 2.5]{kochcurve.jpg}
%\put(110,95){\small$St$}
%\put(210,-5){\small$c/t$}\end{picture}
  \caption[Strouhal number based on the chord ]{$vs$ chord-to-thickness ratio}
  \label{fig:kochcurve}
\end{figure}
Pls help.

Thanks.
Attachments
kochcurve.jpg
kochcurve.jpg (7.05 KiB) Viewed 3435 times

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Errors in picture

Post by Stefan Kottwitz »

This code would raise errors like "Missing \begin{document}" etc. because it's incomplete: no \documentclass, no graphicx package loaded etc.
It would be better if you post complete documents.

Beside that there's a closing brace missing after \includegraphics, \end{picture} is missing, width = 2.5 doesn't have a unit like cm or pt.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Errors in picture

Post by localghost »

Just for the record. These Koch snowflakes can easily be drawn with pgf/tikZ.

Code: Select all

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{decorations.fractals}

\begin{document}
  \begin{tikzpicture}[decoration=Koch snowflake]
    \draw(0,0)--(3,0);
    \draw decorate{(0,-1)--(3,-1)};
    \draw decorate{decorate{(0,-2)--(3,-2)}};
    \draw decorate{decorate{decorate{(0,-3)--(3,-3)}}};
  \end{tikzpicture}
\end{document}
This way you also can arbitrarily place your text as nodes in the picture. The manual tells you more.


Best regards
Thorsten
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Re: Errors in picture

Post by pban92 »

Thanks Stefan. It was helpful.
pban92
Posts: 54
Joined: Sat Aug 09, 2008 9:34 am

Re: Errors in picture

Post by pban92 »

Hi Thorsten thanks for that Tikz. Good bye to that koch images from this day. Sorry me I did not see your reply before!
Post Reply