5

I'm trying to plot this:

\begin{tikzpicture}
\begin{axis}[
    height=5cm,
    width=\linewidth]
    \addplot[smooth,blue] plot coordinates {
    (27,177)
    (28,223)
    (29,240)
    (30,227)
    (31,201)
    (32,186)
    (33,183)
    (34,187)
    (35,192)
    (36,191)
    (37,188)
    (38,174)
    (39,168)
    (40,169)
    (41,195)
    (42,249)
    (210,413)
    (211,473)
    };
\end{axis}
\end{tikzpicture}

and this is the result: plot result (strange) >

As you can see, my data contains increasing non repeating value on x axis. However, there's a curve that bend back at around x=30 to 40 and x=210 to 220. However when I remove the last 2 data (210,413),(211,473) the resulting plot seems normal:

plot result (normal) > Any idea for this?

  • Welcome to TeX.SX. The problem is the smooth, remove that and it works as expected. – Torbjørn T. Dec 22 '13 at 12:44
5

Without the smooth option, it look like this : enter image description here

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Please notice that when someone posts an answer as a comment, is it considered quite impolite to post the very same thing as an answer. We do it quite often, as discussed in the meta.TeX.SX site. – yo' Dec 22 '13 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.