Skip to main content

练习题

  1. What is Matplotlib?

  2. How do you install Matplotlib?

  3. How you import Matplotlib?What are the common aliases used while importing these modules?

  4. What is the purpose of the magic command %matplotlib inline?

  5. What is a line chart?

  6. How do you plot a line chart in Python? Illustrate with an example.

  7. How do you specify values for the X-axis of a line chart?

  8. How do you specify labels for the axes of a chart?

  9. How do you plot multiple line charts on the same axes?

  10. How do you show a legend for a line chart with multiple lines?

  11. How you set a title for a chart?

  12. How do you show markers on a line chart?

  13. What are the different options for styling lines and markers in line charts? Illustrate with examples.

  14. What is the purpose of the fmt argument to plt.plot?

  15. Where can you see a list of all the arguments accepted by plt.plot?

  16. How do you change the size of the figure using Matplotlib?

  17. What is a scatter plot?

  18. How is a scatter plot different from a line chart?

  19. How do you decide when to use a scatter plot vs a line chart?

  20. How do you specify the colors for dots on a scatter plot using a categorical variable?

  21. What is a histogram?

  22. When should you use a histogram vs a line chart?

  23. How do you draw a histogram using Matplotlib? Illustrate with an example.

  24. What are "bins" in a histogram?

  25. How do you change the sizes of bins in a histogram?

  26. How do you change the number of bins in a histogram?

  27. How do you show multiple histograms on the same axes?

  28. How do you stack multiple histograms on top of one another?

  29. What is a bar chart?

  30. How do you draw a bar chart using Matplotlib? Illustrate with an example.

  31. What is the difference between a bar chart and a histogram?

  32. What is the difference between a bar chart and a line chart?

  33. How do you stack bars on top of one another?

  34. How do you show bar plots side-by-side?

  35. How do you draw a horizontal bar plot?

  36. How do you show the original values from the dataset on a heat map?

  37. How do you turn off the axes and gridlines in a chart?

  38. What is the purpose of the plt.subplots function?

  39. How do you export a plot into a PNG image file using Matplotlib?