Seite 1 von 1

\pgfplotsset{every mark/.append style={solid}} geht nicht

Verfasst: Mi 12. Jul 2017, 20:58
von Darcy
Hallo zusammen,

ich möchte in meinem Diagramm gerne Datenpunkte mit gestrichelten Linien verbinden. Aber die Marker für die Punkte sollen nicht gestrichelt sein. Im Manual für pgfplots steht, dass \pgfplotsset{every mark/.append style={solid}} dieses Problem beheben würde. Das tut es nur leider nicht. Wo liegt der Fehler in meinem Beispiel?

Danke und Grüße
Darcy
\documentclass[a4paper,oneside,10pt,captions=nooneline]{scrreprt} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
 
\usepackage{pgfplots}
\usetikzlibrary{matrix} 
\pgfplotsset{compat=newest, every mark/.append style={solid}}

\begin{document}
 		
\begin{figure}[htb]
\centering
	\begin{tikzpicture}
	  \begin{axis}[
			xlabel={Zeit\,/\,min},
			ylabel={Spezifische Diluatleitf{\"a}higkeit},
			enlarge x limits=0.01,
			scale only axis,
			xmax=330,
			ymin=0.12,
			ymax=0.18,
			axis y line=left]
 			\addplot[gray, mark=triangle*, dotted] coordinates{
			(0, 0.12)
			(150, 0.15)
			(330, 0.17)};
			\addplot [black, mark=x, dotted] coordinates{
			(0, 0.13)
			(150, 0.14)
			(330, 0.15)};
			\end{axis}
			
		 \begin{axis}
		  [xlabel={{Zeit\,/\,min}},
			ylabel={{Strom\,/\,A}},
			enlarge x limits=0.01,
			xmax=330,
			ymin=0.15,ymax=0.55,
			scale only axis,
			axis y line=right,
			axis x line=none]
			\addplot [only marks, gray, mark=triangle*] coordinates{
			(0, 0.15)
			(150, 0.35)
			(330, 0.54)};
			\addplot [only marks, mark=x] coordinates{
			(0, 0.17)
			(150, 0.25)
			(330, 0.35)};
			\end{axis}
		 	\end{tikzpicture}
		\caption{Test dotted}
		\end{figure}
	
	\end{document}

Verfasst: Mi 12. Jul 2017, 23:28
von esdd
Nimm entweder
\tikzset{every mark/.append style={solid}}
oder
\tikzset{mark options=solid}
Beispiel:
\documentclass[a4paper,oneside,10pt,captions=nooneline]{scrreprt} 
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
 
\usepackage{pgfplots}
\usetikzlibrary{matrix} 
\pgfplotsset{compat=newest}
\tikzset{every mark/.append style={solid}}
% \tikzset{mark options=solid}

\begin{document}
       
\begin{figure}[htb]
\centering
   \begin{tikzpicture}
     \begin{axis}[
         xlabel={Zeit\,/\,min},
         ylabel={Spezifische Diluatleitf{\"a}higkeit},
         enlarge x limits=0.01,
         scale only axis,
         xmax=330,
         ymin=0.12,
         ymax=0.18,
         axis y line=left]
         \addplot [black, mark=x, dotted] coordinates{
         (0, 0.13)
         (150, 0.14)
         (330, 0.15)};
      \end{axis}
   \end{tikzpicture}
   \caption{Test dotted}
\end{figure}   
\end{document}

Verfasst: Do 13. Jul 2017, 08:24
von Darcy
Danke, funktioniert wunderbar! :)

Aber kann mir jemand sagen, warum das andere nicht funktioniert hat? Würde mich schon noch interessieren...