I'm trying to plot the curve of

\frac{1}{x - 1}

My code is as follows:



\draw [red] (0,0) plot [domain=0.5:4] (\x,1/(\x-1));


This throws an error.

If I write this:

\draw [red] (0,0) plot [domain=0.5:4] (\x,1/x);

It's fine. It can handle this.

The error message is:

Package tikz Error: Giving up on this path. Did you forget a semicolon?. ... plot [domain=0.5:4] (\x,1/(\x-1))

Any idea what's going on?


1 Answer 1


The issue is the double brackets. You should put the expression within {}. And then have the (x-1) within the brackets so the eventual \begin{tikzpicture} input should look like:

\draw [red] (0,0) plot [domain=0.5:4] (\x, {1/(\x-1)});

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .