0

I have some questions regarding a plot I wanna create. Here is a minimal example:

\documentclass[]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}
    \begin{axis}[
            width=\textwidth,%Breite des Plots
            axis line style=thin,%Achsenstärke
            axis y line = center,
            axis x line = center,
            no markers,%keine Markierungen auf den Plots
            every axis plot/.append style={thin},%Plotstärke
            axis on top=false,%Achsen hinter dem Plot
        ]
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {1}]{124-Auswertung.csv};
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {2}]{124-Auswertung.csv};
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {3}]{124-Auswertung.csv};
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {4}]{124-Auswertung.csv};
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {5}]{124-Auswertung.csv};
        \addplot table[col sep=semicolon,/pgf/number format/read comma as period, x index = {0}, y index = {6}]{124-Auswertung.csv};
    \end{axis}
\end{tikzpicture}
\end{document}

The result: enter image description here

The csv-file is here (too long to add here): https://dl.dropboxusercontent.com/u/57816350/124-Auswertung.csv

Since only the first plot is a measurement and the second to sixth plot are just signals, I wanna rename the plots on the y-scale like shown below.

Is there a way to mark a specific area like shown in the picture below? I would like best to have the marking area in the CSV-file. How would I do that?

Is there a way to have the col sep... and the pgf/number/... as period ... option more globally?

Since I will have a lot of quite similar plots in the document I would like to predefine the colors of the plots (the color option doesn't seem to work when I add it to every single plot)

How to change the color of the axis?

What I wanna achieve:

enter image description here

Please help!

1 Answer 1

1

Like this?

enter image description here

\documentclass[margin=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\usetikzlibrary{backgrounds}% <-- added

\begin{document}
\begin{tikzpicture}
    \begin{axis}[
width=\textwidth,%Breite des Plots
axis line style=thin,%Achsenstärke
axis y line=left,
axis x line=middle,
no markers,%keine Markierungen auf den Plots
%every axis plot/.append style={thin},%Plotstärke
%%axis on top=false,%Achsen hinter dem Plot
ytick={-6,...,1},% <-- added
yticklabels={$v_5$,$v_4$,$v_3$,$v_2$,$v_1$,-1,0,1},% <-- added
% only for demonstration ...
trig format plots=rad,
domain=0:4*pi, samples=48, 
xmax=4.1*pi, ymax=1.2
        ]
        \addplot    {   0.5*sin(x)};
        \addplot    {-1+0.5*sin(x)};
        \addplot    {-2+0.5*sin(x)};
        \addplot    {-3+0.5*sin(x)};
        \addplot    {-4+0.5*sin(x)};
        \addplot    {-5+0.5*sin(x)};
        \addplot    {-6+0.5*sin(x)};
\scoped[on background layer] \fill[red!30] (2.5,-6.5) rectangle (3.5,1);
    \end{axis}
\end{tikzpicture}
\end{document}

For demonstration of solution I use sin function which you can simple replace with your table.

3
  • Thank you, this helped a lot. If I have further questions, I'll come back later. Feb 1, 2017 at 15:06
  • Why are the last two plots dashed, I try to make them solid but the usual solutions (\addplot[solid] or every axis plot style/.append ...) doesn't seem to work. Feb 2, 2017 at 14:32
  • In the my answer addplot use line styles from predefined list of styles. See pgfplots manual, section 4.7.7 Cycle Lists -- Options Controlling Line Styles, page 210. Probably the color list style offer what you looking for. Otherwise, you can define line styles individually as option in addplot (as you have in your question) . If this problem still persist, than seems to be the best way ask new question, which will be as question better visible to wide audience who can help you.
    – Zarko
    Feb 2, 2017 at 15:06

You must log in to answer this question.

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