Legende zeigt nur gestrichelte Linien

Tabellen und Grafiken erstellen und anordnen


achem
Forum-Newbie
Forum-Newbie
Beiträge: 8
Registriert: Fr 18. Jun 2021, 07:06

Legende zeigt nur gestrichelte Linien

Beitrag von achem »

Hallo zusammen,
ich habe ein Problem die Legende eines pgfplots betreffend. Ich erhalte nur gestrichelte Linien als Legendeneinträge. Dabei ist es egal, ob ich \addlegendentry direkt hinter dem \addplot oder \legend am Ende verwende.

Hier der Code:

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}% lädt tikz, das graphicx lädt
\pgfplotsset{compat=1.18}
\usetikzlibrary{positioning}
\usetikzlibrary{patterns}
\usepackage{siunitx}
\usetikzlibrary{intersections}
\usepgfplotslibrary{fillbetween}

\begin{document}
\begin{tikzpicture}
\begin{loglogaxis}[
ylabel=Energiedichte E${pr}$ in $\si{\watt\hour\per\kilo\gram}$,
xlabel=Leistungsdichte P${pr}$ in $\si{\watt\per\kilo\gram}$,
ymin=0.1,ymax=10000,
xmin=0.005,xmax=10000,
extra y ticks={250},
extra y tick style={grid=major, dashed},
extra y tick labels={250}
]



%C-Rate
\addplot [domain=0.1:10000, dashed, color=lightgray] {x};
\node[rotate=45,font=\footnotesize,gray] at(0.1,0.2){1C};
\addplot [dashed, lightgray]
coordinates{(250,250)};

%Zielbereich
\addplot [lightgray!0,fill=lightgray!30]
coordinates{
(250,250) (100000,100000)(100000,250) (250,250)
};
\node [gray, font=\tiny, right]at(600,600){Zielbereich};

%LLZO Fläche
\addplot+ [
  no marks, 
  orange!50, 
  mark size=2pt,
  mark options={ thick},
  pattern=crosshatch dots,
  pattern color = orange!50,
  mark indices={1,2,3,4,5,8,9,10,11,12,13,14,15}
] coordinates {
  (530.1,26.5)(367,36.7) (187.6,46.89)(106,53.01)(57.9,57.9) (33,330) (24.2,242) 
  (.1019,2.038)(.04061,.8123) (0.01624,0.6498) (.068229,.68229) (.11696,.58482) 
  (.27616,.55233)(.48735,.48735)(293.6,7.339)(530.1,26.5)
};

%LLZO Punkte LCO
\addplot [
  only marks, 
  mark=x,
  color=orange, 
  mark size=2pt,
  mark options={ thick},
  mark indices={1,2,3,4,5,8,9,10,11,12,13,14,15}
] coordinates {
  (530.1,26.5)(367,36.7) (187.6,46.89)(106,53.01)(57.9,57.9) (33,330) (24.2,242) 
  (.1019,2.038)(.04061,.8123) (0.01624,0.6498) (.068229,.68229) (.11696,.58482) 
  (.27616,.55233)(.48735,.48735)(293.6,7.339)(530.1,26.5)
};


%LLZO Punkte NMC 532
\addplot+ [
  mark=star, 
  mark indices={6,7},
  mark size=2pt, 
  mark options={ thick},
   color = orange,
  only marks
] coordinates {
  (530.1,26.5)(367,36.7) (187.6,46.89)(106,53.01)(57.9,57.9) (33,330) (24.2,242) 
  (.1019,2.038)(.04061,.8123) (0.01624,0.6498) (.068229,.68229) (.11696,.58482) 
  (.27616,.55233)(.48735,.48735)(293.6,7.339)(530.1,26.5)
};

%Kommentare LLZO
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (293.6,7.339){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (530.1,26.5){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (367,36.7){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (187.6,46.89){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (106,53.01){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (.48735,.48735){a,b};
\node [gray,yshift=1mm,xshift=0.5mm,font= \tiny] at (.27616,.55233){a,b};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (.11696,.58482){a,b};
\node [gray,yshift=1mm,xshift=0.5mm,font= \tiny] at (.068229,.68229){a,b};
\node [gray,yshift=1mm,xshift=0.5mm,font= \tiny] at (0.01624,0.6498){a,b};
\node [gray,yshift=1.3mm,xshift=0.5mm,font= \tiny] at (.04061,.8123){a,b};
\node [gray,yshift=1mm,xshift=0.5mm,font= \tiny] at (.1019,2.038){a,b};

%LGPS Fläche
\addplot+ [
  no marks, 
  red!50, 
  mark size=2pt,
  mark options={ thick},
  pattern=crosshatch,
  pattern color = red!50,
] coordinates {
  (2.3936,2.3936) (4.3085,4.3085) (8.2707,8.2707) (7.5188,15.0376) (3.609,18.0451) (2,20) (1.3,14) (0.90957,9.0957) (1.3404,6.7021) (2.1543,4.3085) (2.3936,2.3936)
};

%LGPS Punkte LCO Kathode Indium Anode
\addplot+ [
  only marks, 
  mark=x,
  color=red, 
 % mark size=2pt,
  %mark options={ thick},
] coordinates {
  (2.3936,2.3936) (4.3085,4.3085)(4.7872,9.5745) (3.4468,17.234) (2.2979,11.4894) (1.3404,13.4043)
  (0.90957,9.0957) (1.3404,6.7021) (2.1543,4.3085)
};
\addplot+ [
  only marks, 
  mark=o,
  color=red, 
  %mark size=2pt,
  %mark options={ thick},
] coordinates {
  (2.3936,2.3936) (4.3085,4.3085)(4.7872,9.5745) (3.4468,17.234) (2.2979,11.4894) (1.3404,13.4043)
  (0.90957,9.0957) (1.3404,6.7021) (2.1543,4.3085)
};

%LGPS Punkte LCO Kathode 
\addplot+ [
  only marks, 
  mark=x,
  color=red, 
  %mark size=2pt,
  %mark options={thick},
] coordinates {
(8.2707,8.2707) (7.5188,15.0376) (3.609,18.0451) (2,20) (1.3,14)
};

%Kommentare LGPS
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (8.2707,8.2707){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (7.5188,15.0376){a};
\node [gray,yshift=.1mm,xshift=1.2mm,font= \tiny] at (3.609,18.0451){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (2.3936,2.3936){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (4.3085,4.3085){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (4.7872,9.5745){a};
%\node [darkgray,yshift=-1mm,xshift=1.2mm,font= \tiny] at (3.4468,17.234){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (2.2979,11.4894){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (1.3404,13.4043){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (0.90957,9.0957){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (1.3404,6.7021){a};
\node [gray,yshift=1mm,xshift=1mm,font= \tiny] at (2.1543,4.3085){a};

%beta LPS Fläche
\addplot+ [
  solid,
  no marks, 
  blue!50, 
  mark size=2pt,
  mark options={ thick},
  pattern=north east lines,
  pattern color = blue!50,
] coordinates {
  (106.2048,47.84)(53.5392,81.12)(19,100)(7.04,44)(2.5434,25.434)(2.3976,23.976)(2.16,21.6)(33.66,19.69)(106.2048,47.84)};

%beta LPS Punkte Li Metall anode NMC 622 
  \addplot+ [
  only marks,
  mark=10-pointed star,
  blue!50, 
  mark size=1.5pt,
  %mark options={ thick},
] coordinates {
  (106.2048,47.84)(17.2937,36.0286)(53.5392,81.12)(19,100)(7.04,44)(2.5434,25.434)(2.3976,23.976)(2.16,21.6)(33.66,19.69)};
  
%beta LPS Punkte Li Legierung Anode NMC 622 \addplot+ [ only marks, mark=o, blue!50, % mark size=2pt, %mark options={ thick}, ] coordinates { (2.5434,25.434)(2.3976,23.976)(2.16,21.6)};
\legend{$\sqrt x$,$x2$,$x$}
\end{loglogaxis} \end{tikzpicture} \end{document}

Anbei noch das Bild von dem Problem. Weiß jemand, wie ich hier die Patterns und verschiedenen Kreuze darstellen kann?

Dateianhänge
2021-06-22 09_44_01-Window.png
2021-06-22 09_44_01-Window.png (3.59 KiB) 5288 mal betrachtet