Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. documentclass[convert]{standalone}
  2. usepackage{pgfplots, pgfplotstable}
  3. begin{document}
  4.  
  5. pgfdeclareplotmark{a}{pgfuseplotmark{*}}
  6. pgfdeclareplotmark{b}{pgfuseplotmark{triangle*}}
  7. pgfdeclareplotmark{c}{pgfuseplotmark{square*}}
  8.  
  9. pgfplotstableread{%
  10. x y label
  11. 0.1 0.15 a
  12. 0.45 0.27 c
  13. 0.02 0.17 a
  14. 0.06 0.1 a
  15. 0.9 0.5 b
  16. 0.5 0.3 c
  17. 0.85 0.52 b
  18. 0.12 0.05 a
  19. 0.73 0.45 b
  20. 0.53 0.25 c
  21. 0.76 0.5 b
  22. 0.55 0.32 c
  23. }{tab}
  24.  
  25. begin{tikzpicture}
  26. begin{axis}[legend pos=south east]
  27. addplot[%
  28. scatter,
  29. only marks,
  30. % visualization depends on=value thisrow{label}aslabel,
  31. % scatter/@pre marker code/.append style={/tikz/mark=label},
  32. ]
  33. table[x=x,y=y]{tab};
  34. legend{Class 1,Class 2,Class 3}
  35. end{axis}
  36. end{tikzpicture}
  37. begin{tikzpicture}
  38. begin{axis}[legend pos=south east]
  39. addplot[%
  40. scatter,
  41. only marks,
  42. visualization depends on=value thisrow{label}aslabel,
  43. scatter/@pre marker code/.append style={/tikz/mark=label},
  44. ]
  45. table[x=x,y=y]{tab};
  46. legend{Class 1,Class 2,Class 3}
  47. end{axis}
  48. end{tikzpicture}
  49. begin{tikzpicture}
  50. begin{axis}[legend pos=south east]
  51. addplot[%
  52. scatter,
  53. only marks,
  54. visualization depends on=value thisrow{label}aslabel,
  55. scatter/@pre marker code/.append style={/tikz/mark=label},
  56. ]
  57. table[x=x,y=y]{
  58. x y label
  59. 0.1 0.15 a
  60. 0.45 0.27 c
  61. 0.02 0.17 a
  62. 0.06 0.1 a
  63. 0.9 0.5 b
  64. 0.5 0.3 c
  65. 0.85 0.52 b
  66. 0.12 0.05 a
  67. 0.73 0.45 b
  68. 0.53 0.25 c
  69. 0.76 0.5 b
  70. 0.55 0.32 c
  71. };
  72. legend{Class 1,Class 2,Class 3}
  73. end{axis}
  74. end{tikzpicture}
  75. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement