0

I've been struggling with removing these arrows as shown in the picture. It appears that I get more of these arrows the more graphs I have. And if I don't add any graphs they are completely gone. Hope someone can help me out there!

enter image description here


This is my code for this graph:

 \begin{tikzpicture}
    \begin{axis}[
        width=0.7\linewidth, % Scale the plot to \linewidth
        xtick=data,
        ymin=0,
        ymax=1600,
        %grid=major, % Display a grid
        %grid style={dashed,gray!30}, % Set the style
        xlabel=Gewicht $m$, % Set the labels
        ylabel=Spannung $U$ Peak to Peak,
        x unit=\si{\g}, % Set the respective units
        y unit=mV,
    ]
        \addplot+[mark=x, mark size=5, red, smooth]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=Reihe1, col sep=semicolon, only marks] {PeaktoPeakA.csv};

        \addplot+[mark=x, mark size=5, blue, smooth]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=Reihe2, col sep=semicolon, only marks] {PeaktoPeakA.csv};

        \addplot+[mark=x, mark size=5, green, smooth]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=Reihe3, col sep=semicolon, only marks] {PeaktoPeakA.csv};

        \addplot+[mark=x,mark size=5, brown, smooth]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=Reihe4, col sep=semicolon, only marks] {PeaktoPeakA.csv};

        \addplot+[mark=x,mark size=5, purple, smooth]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=Reihe5, col sep=semicolon, only marks] {PeaktoPeakA.csv};

        \addplot+[black, dashed]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        table[x=Gewicht, y=b, col sep=semicolon, mark = none] {PeaktoPeakA.csv};

         \node[label={y=0,0863x+312,65}] at (axis cs:7000,650) {};

        %\addplot[blue]
        % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
        %table[x=Membranabschnitt,y=160,col sep=semicolon, mark=none, dashed, y={create col/linear regression={y=160}}] % compute a linear regression from the input table {dreizeilentabelle.csv};

    \end{axis}
\end{tikzpicture}

I couldn't copy in all of my code, cause it had too many characters, but I was able to isolate the specific graph. Code of whole document which will result in the graph:

\documentclass[12pt,a4paper]{article}
\usepackage{german}
\usepackage[latin1]{inputenc}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{pgfplots}
\usepackage{pgfplotstable}
\usepackage{siunitx}
\usepackage{tikz}
\usepackage{subfigure}
\usepackage{comment}
\usepackage{caption}
\usepackage{gensymb}
\usepackage{xfrac}
\usepackage{wrapfig}
\usepackage{blindtext}
\pagestyle{plain}
\pgfplotsset{compat=newest}
\usepgfplotslibrary{units}
\sisetup{
    round-mode          = places,
    round-precision     = 2,
    }
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            width=0.7\linewidth, % Scale the plot to \linewidth
            xtick=data,
            ymin=0,
            ymax=1600,
            %grid=major, % Display a grid
            %grid style={dashed,gray!30}, % Set the style
            xlabel=Gewicht $m$, % Set the labels
            ylabel=Spannung $U$ Peak to Peak,
            x unit=\si{\g}, % Set the respective units
            y unit=mV,
        ]
            \addplot+[mark=x, mark size=5, black]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=Reihe1, col sep=semicolon, only marks] {PeaktoPeakA.csv};

            \addplot+[mark=x, mark size=5, black]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=Reihe2, col sep=semicolon, only marks] {PeaktoPeakA.csv};

            \addplot+[mark=x, mark size=5, black]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=Reihe3, col sep=semicolon, only marks] {PeaktoPeakA.csv};

            \addplot+[mark=x,mark size=5, black]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=Reihe4, col sep=semicolon, only marks] {PeaktoPeakA.csv};

            \addplot+[mark=x,mark size=5, black]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=Reihe5, col sep=semicolon, only marks] {PeaktoPeakA.csv};

            \addplot+[black, dashed]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            table[x=Gewicht, y=b, col sep=semicolon, mark = none] {PeaktoPeakA.csv};

             \node[label={y=0,0863x+312,65}] at (axis cs:7000,650) {};

            %\addplot[blue]
            % add a plot from table; you select the columns by using the actual name in the .csv file (on top)
            %table[x=Membranabschnitt,y=160,col sep=semicolon, mark=none, dashed, y={create col/linear regression={y=160}}] % compute a linear regression from the input table {dreizeilentabelle.csv};

        \end{axis}
    \end{tikzpicture}
\end{document}

Needed PeaktoPeakA.csv file:

Nummer;Gewicht;Reihe1;Reihe2;Reihe3;Reihe4;Reihe5;ReiheA;b
1;4782;718;301;704;746;881;670;725
2;7172;830;1405;937;984;1034;1038;931.594
3;9742;933;1522;1204;931;919;1101.8;1153.38
  • 2
    Welcome to TeX.SX! Please don't post code fragments. Instead, put your fragments into a complete compilable document that shows the problem. – Stefan Pinnow Dec 18 '18 at 18:19
  • 2
    From the presented code it is very unlikely that the arrows are coming from that. – Stefan Pinnow Dec 18 '18 at 18:28
  • I thought the same, but if I remove every \addplot entry there are no arrows. I'm using Overleaf, if that is making a difference. – user178029 Dec 18 '18 at 18:29
  • Please post complete code that produces this result and also the csv file so that we can compile it for ourselves. – JPi Dec 18 '18 at 19:24
  • 1
    With the code you added, there is no arrow pointing towards 0 on the graph. – AndréC Dec 18 '18 at 20:14
2

Ok, I found the error myself. The .csv files where originally made in excel, cause some of them had way more than 1000 rows. I saved it from Excel as a .csv and removed all , with . so Latex can understand it. I don't know how or why, but by using this method, it will show the arrows. If I just copy the content of the .csv file, create a new file with the same name and paste in the same .csv content and then upload it, the arrows are gone.

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.