0

after reading Stack OverFlow's many times to solve my problems, I'm asking my first question today on the forum ! :) I'm using the following code to plot a curve with Tikz.

If I add coordinates commonly by using for example this code, it works well.

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

\begin{tikzpicture}
    \begin{axis}
        \addplot+ [mark=none] coordinates {(0,2.6) (1,2.5) (2,2.6)};
    \end{axis}
\end{tikzpicture}

\end{document}

However, if I wanna use data from a txt file, no error messages arrives but the curve is not plot on the graph (my txt file is just 3 columns of data separate by a space) That's what happen with this code :

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

\begin{tikzpicture}
    \begin{axis}
        \addplot+ [mark=none] table[x index=0,y index=1]{Data/vitessewood.txt};
   \end{axis}
\end{tikzpicture}

\end{document}

By removing the "[mark=none]", the curve appears on the figure with this code. It prooves that the code is able to read the txt file and the issue is like an uncompatibility between importing data from txt file and ploting data with the option [mark=none].

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}
    \begin{axis}
        \addplot+ table[x index=0,y index=1]{Data/vitessewood.txt};
   \end{axis}
\end{tikzpicture}

\end{document}

I've already tried to use 'addplot+' or only 'addplot'. I've already tried to increase thickness to be sure that the parameter of the thickness was not on zero.

Feel free to tell me if you have any idea to solve the problem. My expected results is just to be able to plot the data without marks.

Thank you very much ! :)

  • Can you please make a [mre] that includes all packages necessary to compile your code fragment? – samcarter_is_at_topanswers.xyz Nov 11 '19 at 23:42
  • Yes, I think that's better now, thank you – Robin Jean Nov 12 '19 at 16:20
  • Unfortunately the code fragment is still not compilable. Besides the obvious things like a missing documentclass, which I could add myself if need be, we cannot know what the content of your `Data/vitessewood.txt` might be and thus cannot compile the code fragment. – samcarter_is_at_topanswers.xyz Nov 12 '19 at 16:29
  • Thank you for helping me to use stack overflow correctly. I've edited it again, I've let the `Data/vitessewood.txt` because I guess it's part of the issue but I've explained the content of it. – Robin Jean Nov 12 '19 at 19:10

0 Answers0