matplotlib.txt 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. plt.plot(range(10), linestyle='--', marker='o', color='b')
  2. A short form for the above: plt.plot (range(10), '--bo')
  3. List of line and marker styles:
  4. - solid line style
  5. -- dashed line style
  6. -. dash-dot line style
  7. : dotted line style
  8. . point marker
  9. , pixel marker
  10. o circle marker
  11. v triangle_down marker
  12. ^ triangle_up marker
  13. < triangle_left marker
  14. > triangle right marker
  15. 1 tri_down marker
  16. 2 tri_up marker
  17. 3 tri_left marker
  18. 4 tri_right marker
  19. s square marker
  20. p pentagon marker
  21. * star marker
  22. h hexagon1 marker
  23. H hexagon2 marker
  24. + plus marker
  25. x x marker
  26. D diamond marker
  27. d thin_diamond marker
  28. | vline marker
  29. _ hline marker
  30. # Text rendering with LaTeX
  31. plt.title('alpha > beta') # plain text
  32. plt.title(r'$\alpha > \beta$') # math text
  33. Reference:
  34. Named Colors: https://matplotlib.org/3.1.0/gallery/color/named_colors.html
  35. Line Bars and Markers: https://matplotlib.org/3.1.3/gallery/lines_bars_and_markders/
  36. Style Sheets: https://matplotlib.org/3.2.1/gallery/style_sheets/style_sheets_reference.html
  37. Text rendering with LaTeX: https://matplotlib.org/tutorials/text/usetex.html#sphx-glr-tutorials-text-usetex-py