Fine-tuning marker styles with keyword arguments

We can have further refined control over marker styles with some more keyword arguments. For example, for plt.plot(), we can change the markeredgecolor, markeredgewidth, and markerfacecolor.

Here is a code example:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors

# Prepare data points
x = list(range(5))
y = [1]*5

# Set the face color, edge color, and edge width of markers
plt.plot(x,y,marker='o',ms=36,markerfacecolor='floralwhite',markeredgecolor='slateblue',markeredgewidth=10)

plt.show()

This is the result of adding the extra keyword arguments:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.110.38