23 Apr Set the Marker face color in Matplotlib
In Matplotlib, you set the marker face color using the markerfacecolor (or its shorthand mfc) parameter in plotting functions like plot() or scatter(). This controls the fill color inside the marker, separate from the edge color.
Let us see an example:
# Set the Marker face color in Matplotlib import matplotlib.pyplot as plt import numpy as np ypts = np.array([7, 3, 9, 1, 5]) plt.plot(ypts, marker='*', ms = 25, mec = 'b',mfc = 'g', linestyle='-', color='red') plt.show()
Output
If you liked the tutorial, spread the word and share the link and our website, Studyopedia, with others.
For Videos, Join Our YouTube Channel: Join Now
Read more:
- Machine Learning Tutorial
- Deep Learning Tutorial
- Statistics for ML
- Numpy Tutorial
- Pandas Tutorial
- Matplotlib Tutorial
- Google Colab Tutorial
- Anaconda Tutorial
- Python Libraries Tutorial
No Comments