123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- % Thanks to Jake for helping me with this one:
- % http://tex.stackexchange.com/a/198531/5645
- \documentclass[varwidth=true, border=5pt]{article}
- \usepackage[active,tightpage]{preview}
- \usepackage[latin1]{inputenc}
- \usepackage{amsmath}
- \usepackage{pgfplots}
- \pgfplotsset{compat=1.10}
- \usepackage{tikz}
- \usetikzlibrary{arrows, positioning}
- \usepackage{helvet}
- \usepackage[eulergreek]{sansmath}
- \begin{document}
- \begin{preview}
- \begin{tikzpicture}
- \begin{axis}[
- clip mode=individual,
- width=13.4cm,
- height=10.0cm,
- % Grid
- grid = major,
- % size
- xmin= 40, % start the diagram at this x-coordinate
- xmax= 90, % end the diagram at this x-coordinate
- ymin= 0, % start the diagram at this y-coordinate
- ymax= 60, % end the diagram at this y-coordinate
- % Legende
- legend style={
- font=\large\sansmath\sffamily,
- at={(0.5,-0.18)},
- anchor=north,
- legend cell align=left,
- legend columns=-1,
- column sep=0.5cm
- },
- % Ticks
- tick align=inside,
- every axis/.append style={font=\large\sansmath\sffamily},
- minor tick style={thick},
- scaled y ticks = false,
- % Axis
- axis line style = {very thick,shorten <=-0.5\pgflinewidth},
- axis lines = middle,
- axis line style = very thick,
- xlabel=Gesamtausgaben,
- x label style={at={(axis description cs:0.5,-0.05)},
- anchor=north,
- font=\boldmath\sansmath\sffamily\Large},
- ylabel=Luxusausgaben,
- y label style={at={(axis description cs:-0.05,0.5)},
- anchor=south,
- rotate=90,
- font=\boldmath\sansmath\sffamily\Large}
- ]
- \addplot[
- scatter,
- only marks,
- point meta=explicit symbolic,
- scatter/classes={
- a={mark=x,red!90!black,fill opacity=0.2},%
- b={mark=x,cyan!50!black,fill opacity=0.2}},
- ]
- table[col sep=comma, meta=label] {data.csv};
- \addplot[domain=40:90, thick, dashed, black!60!white,samples=10] {0.5*x-2.5};
- \filldraw [fill=red!30!white, draw=black, thick] (axis cs:70,40) circle [radius=5pt];
- \filldraw [fill=cyan!30!white, draw=black, thick] (axis cs:60,20) circle [radius=5pt];
- \filldraw [fill=green!70!black, draw=black, thick] (axis cs:65,35) circle [radius=5pt] node [label={[inner sep=1pt, fill=white,text=black, fill opacity=0.75, text opacity=1]above left:$(65, 35)$}] {};
- % \addlegendentry{Gruppe 1}
- % \addlegendentry{Gruppe 2}
- \end{axis}
- \end{tikzpicture}
- \end{preview}
- \end{document}
|