March 2014
Beginner to intermediate
222 pages
4h 7m
English
Fine controls, such as edge color, interior color, and so on, are possible on markers. It is, for instance, possible to draw a curve with markers of a different color than the color of the curve. In this recipe, we will look at how to have a fine control on a marker's aspect.
We have learned about the optional parameters to set the shape, color, and size of markers. There are plenty of others to play with, as demonstrated in the following script:
import numpy as np import matplotlib.pyplot as plt X = np.linspace(-6, 6, 1024) Y = np.sinc(X) plt.plot(X, Y, linewidth = 3., color = 'k', markersize = 9, markeredgewidth = 1.5, markerfacecolor = '.75', markeredgecolor = 'k', marker = 'o', markevery = 32) ...
Read now
Unlock full access