Set Background Color For Subplot
Say I have an image made of 4 sub plots like so: import matplotlib.pyplot as plt import numpy as np # Simple data to display in various forms x = np.linspace(0, 2 * np.pi, 400) y =
Solution 1:
You can simply do axarr[1,0].set_facecolor('grey')
to change the axis color for any particular axis manually.
matplotlib
accepts many different color strings (examples here and here) as well as hex
values in HTML strings (for example '#eeefff'
).
Solution 2:
Axes.set_axis_bgcolor() has been deprecated since version 2.0. Use set_facecolor() now.
Post a Comment for "Set Background Color For Subplot"