Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[convert]{standalone}
- usepackage{pgfplots, pgfplotstable}
- begin{document}
- pgfdeclareplotmark{a}{pgfuseplotmark{*}}
- pgfdeclareplotmark{b}{pgfuseplotmark{triangle*}}
- pgfdeclareplotmark{c}{pgfuseplotmark{square*}}
- pgfplotstableread{%
- x y label
- 0.1 0.15 a
- 0.45 0.27 c
- 0.02 0.17 a
- 0.06 0.1 a
- 0.9 0.5 b
- 0.5 0.3 c
- 0.85 0.52 b
- 0.12 0.05 a
- 0.73 0.45 b
- 0.53 0.25 c
- 0.76 0.5 b
- 0.55 0.32 c
- }{tab}
- begin{tikzpicture}
- begin{axis}[legend pos=south east]
- addplot[%
- scatter,
- only marks,
- % visualization depends on=value thisrow{label}aslabel,
- % scatter/@pre marker code/.append style={/tikz/mark=label},
- ]
- table[x=x,y=y]{tab};
- legend{Class 1,Class 2,Class 3}
- end{axis}
- end{tikzpicture}
- begin{tikzpicture}
- begin{axis}[legend pos=south east]
- addplot[%
- scatter,
- only marks,
- visualization depends on=value thisrow{label}aslabel,
- scatter/@pre marker code/.append style={/tikz/mark=label},
- ]
- table[x=x,y=y]{tab};
- legend{Class 1,Class 2,Class 3}
- end{axis}
- end{tikzpicture}
- begin{tikzpicture}
- begin{axis}[legend pos=south east]
- addplot[%
- scatter,
- only marks,
- visualization depends on=value thisrow{label}aslabel,
- scatter/@pre marker code/.append style={/tikz/mark=label},
- ]
- table[x=x,y=y]{
- x y label
- 0.1 0.15 a
- 0.45 0.27 c
- 0.02 0.17 a
- 0.06 0.1 a
- 0.9 0.5 b
- 0.5 0.3 c
- 0.85 0.52 b
- 0.12 0.05 a
- 0.73 0.45 b
- 0.53 0.25 c
- 0.76 0.5 b
- 0.55 0.32 c
- };
- legend{Class 1,Class 2,Class 3}
- end{axis}
- end{tikzpicture}
- end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement