plt.plot marker
时间: 2023-10-29 09:58:04 浏览: 127
plt.plot() is a function in the Matplotlib library that is used to plot lines and markers on a graph. The "marker" parameter allows you to specify the marker style to use for the data points on the plot. Some commonly used marker styles include:
- 'o': circles
- 's': squares
- '^': triangles pointing upwards
- 'v': triangles pointing downwards
- '+': plus signs
- '*': asterisks
You can pass the desired marker style as an argument to the "marker" parameter in the plt.plot() function. Here's an example:
```python
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5]
y = [2, 4, 6, 8, 10]
plt.plot(x, y, marker='o')
plt.show()
```
This will plot the points (1, 2), (2, 4), (3, 6), (4, 8), and (5, 10) as circles on the graph.
阅读全文