Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tikz plot problems

44 views
Skip to first unread message

Geoff Ostrin

unread,
Aug 16, 2008, 10:03:51 AM8/16/08
to
I have worked through some of the examples found in the tikz manual
and all works unitl I need to use "plot". Below is a minimal non-
working example simply copied from the manual. Perhaps I'm now missing
something in the preamble.

Any ideas?
Many thanks in advance,

Geoff.

\documentclass{article}

\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\draw plot (\x,\x);
\end{tikzpicture}

\end{document}

Victor Ivrii

unread,
Aug 16, 2008, 11:13:50 AM8/16/08
to

pgf & tikz uses gnuplot to provide some data for a plot. So you need
1) to have gnuplot installed
2) run (pdf)latex with --shell-escape switch enabling \write18 to
summon gnuplot to provide this data.

You missing nothing in preamble

HTH

Ken Starks

unread,
Aug 16, 2008, 11:25:13 AM8/16/08
to
It worked for me. (MikTeX distribution on windows)

I got a straight line at 45 degrees, length: 100mm x sqrt(2)

Alain Matthes

unread,
Aug 16, 2008, 12:31:28 PM8/16/08
to
On 2008-08-16 17:13:50 +0200, Victor Ivrii <viv...@gmail.com> said:

>
> pgf & tikz uses gnuplot to provide some data for a plot. So you need
> 1) to have gnuplot installed
> 2) run (pdf)latex with --shell-escape switch enabling \write18 to
> summon gnuplot to provide this data.
>
> You missing nothing in preamble

Hi,

No pgf/tikz can plot with gnuplot or without it

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}%[domain=0:4]
\draw[color=red] plot (\x,\x) ;
\end{tikzpicture}
\end{document}

With this code, (see page 195 the pgfmanual) TikZ can
plot without gnuplot

with gnuplot the code is

\begin{tikzpicture}[domain=0:4]
\draw[color=red] plot[id=x] function{x} node[right] {$f(x) =x$};
\end{tikzpicture}


It's better to give a domain but initially the values of \x are between
-5 and 5

Best Regards

Alain

Geoff Ostrin

unread,
Aug 17, 2008, 4:00:33 AM8/17/08
to

Geoff Ostrin

unread,
Aug 17, 2008, 4:15:33 AM8/17/08
to
I might have just sent an empty reply, apologies.

I'm glad it worked straight up for you, that's what I was expecting
too. All previous copy/paste examples worked too. I am also using
MikTeX on windows.
-------------------------------------
The error is:
! Package tikz Error: Cannot parse this plotting data.

See the tikz package documentation for explanation.

l.9 \draw plot (
\x,\x);

--------------------------------------

So I still can't see what the problem is!

Geoff Ostrin

unread,
Aug 17, 2008, 5:40:40 AM8/17/08
to

> So I still can't see what the problem is!

I realised, thanks to K.Starks message, that perhaps I needed to
update my Miktex. Lo and behold, it works.

Thanks for the help and time given, sorry for being an inconvenience.

Geoff.

Ken Starks

unread,
Aug 17, 2008, 7:41:44 AM8/17/08
to

You're very welcome.

Ken

0 new messages