Skip to content

Commit 8da435d

Browse files
committed
Merge pull request #5501 from mdboom/axisbg
Use facecolor instead of axisbg/axis_bgcolor
2 parents f90367a + 7840328 commit 8da435d

23 files changed

+94
-59
lines changed

doc/api/api_changes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ sources of the changes you are experiencing.
1111
For new features that were added to matplotlib, please see
1212
:ref:`whats-new`.
1313

14+
Changes in 2.0.0
15+
================
16+
17+
Color of Axes
18+
-------------
19+
20+
The ``axisbg`` and ``axis_bgcolor`` properties on ``Axes`` have been
21+
deprecated in favor of ``facecolor``.
22+
1423
Changes in 1.5.0
1524
================
1625

doc/users/plotting/colormaps/Lfunction.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
for i in range(red.shape[1]):
5050

5151
# LHS: additive
52-
ax1 = fig.add_subplot(nrows,2,i*2+1, axisbg=tuple(rgb_add[0,i,:]))
52+
ax1 = fig.add_subplot(nrows,2,i*2+1, facecolor=tuple(rgb_add[0,i,:]))
5353

5454
# RHS: multiplicative
55-
ax2 = fig.add_subplot(nrows,2,i*2+2, axisbg=tuple(rgb_geometric[0,i,:]))
55+
ax2 = fig.add_subplot(nrows,2,i*2+2, facecolor=tuple(rgb_geometric[0,i,:]))
5656

5757
# ylabels
5858
if i!=0:
@@ -122,10 +122,10 @@
122122
for i in range(nrows):
123123

124124
# LHS: additive
125-
ax1 = fig.add_subplot(nrows,ncols,i*2+1, axisbg=tuple(rgb_add[0,i,:]))
125+
ax1 = fig.add_subplot(nrows,ncols,i*2+1, facecolor=tuple(rgb_add[0,i,:]))
126126

127127
# middle: multiplicative
128-
ax2 = fig.add_subplot(nrows,ncols,i*2+2, axisbg=tuple(rgb_geometric[0,i,:]))
128+
ax2 = fig.add_subplot(nrows,ncols,i*2+2, facecolor=tuple(rgb_geometric[0,i,:]))
129129

130130
# ylabels
131131
if i!=0:

examples/pylab_examples/axes_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
plt.title('Gaussian colored noise')
1717

1818
# this is an inset axes over the main axes
19-
a = plt.axes([.65, .6, .2, .2], axisbg='y')
19+
a = plt.axes([.65, .6, .2, .2], facecolor='y')
2020
n, bins, patches = plt.hist(s, 400, normed=1)
2121
plt.title('Probability')
2222
plt.xticks([])
2323
plt.yticks([])
2424

2525
# this is another inset axes over the main axes
26-
a = plt.axes([0.2, 0.6, .2, .2], axisbg='y')
26+
a = plt.axes([0.2, 0.6, .2, .2], facecolor='y')
2727
plt.plot(t[:len(r)], r)
2828
plt.title('Impulse response')
2929
plt.xlim(0, 0.2)

examples/pylab_examples/color_demo.py

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import matplotlib.pyplot as plt
1717
import numpy as np
1818

19-
plt.subplot(111, axisbg='darkslategray')
20-
#subplot(111, axisbg='#ababab')
19+
plt.subplot(111, facecolor='darkslategray')
20+
#subplot(111, facecolor='#ababab')
2121
t = np.arange(0.0, 2.0, 0.01)
2222
s = np.sin(2*np.pi*t)
2323
plt.plot(t, s, 'y')

examples/pylab_examples/finance_work2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ def moving_average_convergence(x, nslow=26, nfast=12):
9999
fig = plt.figure(facecolor='white')
100100
axescolor = '#f6f6f6' # the axes background color
101101

102-
ax1 = fig.add_axes(rect1, axisbg=axescolor) # left, bottom, width, height
103-
ax2 = fig.add_axes(rect2, axisbg=axescolor, sharex=ax1)
102+
ax1 = fig.add_axes(rect1, facecolor=axescolor) # left, bottom, width, height
103+
ax2 = fig.add_axes(rect2, facecolor=axescolor, sharex=ax1)
104104
ax2t = ax2.twinx()
105-
ax3 = fig.add_axes(rect3, axisbg=axescolor, sharex=ax1)
105+
ax3 = fig.add_axes(rect3, facecolor=axescolor, sharex=ax1)
106106

107107

108108
# plot the relative strength indicator

examples/pylab_examples/fonts_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from matplotlib.font_manager import FontProperties
88
import matplotlib.pyplot as plt
99

10-
plt.subplot(111, axisbg='w')
10+
plt.subplot(111, facecolor='w')
1111

1212
font0 = FontProperties()
1313
alignment = {'horizontalalignment': 'center', 'verticalalignment': 'baseline'}

examples/pylab_examples/fonts_demo_kw.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import matplotlib.pyplot as plt
88
import numpy as np
99

10-
plt.subplot(111, axisbg='w')
10+
plt.subplot(111, facecolor='w')
1111
alignment = {'horizontalalignment': 'center', 'verticalalignment': 'baseline'}
1212

1313
# Show family options

examples/pylab_examples/image_origin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
interp = 'bilinear'
1414
#interp = 'nearest'
1515
lim = -2, 11, -2, 6
16-
plt.subplot(211, axisbg='g')
16+
plt.subplot(211, facecolor='g')
1717
plt.title('blue should be up')
1818
plt.imshow(x, origin='upper', interpolation=interp, cmap='jet')
1919
#plt.axis(lim)
2020

21-
plt.subplot(212, axisbg='y')
21+
plt.subplot(212, facecolor='y')
2222
plt.title('blue should be down')
2323
plt.imshow(x, origin='lower', interpolation=interp, cmap='jet')
2424
#plt.axis(lim)

examples/pylab_examples/logo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# 0.0005 is the sample interval
1616
t = 0.0005 * np.arange(len(x))
1717
plt.figure(1, figsize=(7, 1), dpi=100)
18-
ax = plt.subplot(111, axisbg='y')
18+
ax = plt.subplot(111, facecolor='y')
1919
plt.plot(t, x)
2020
plt.text(0.5, 0.5, 'matplotlib', color='r',
2121
fontsize=40, fontname=['Courier', 'DejaVu Sans Mono'],

examples/pylab_examples/mathtext_demo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
fig = figure()
1010
fig.subplots_adjust(bottom=0.2)
1111

12-
ax = fig.add_subplot(111, axisbg='y')
12+
ax = fig.add_subplot(111, facecolor='y')
1313
ax.plot([1, 2, 3], 'r')
1414
x = np.arange(0.0, 3.0, 0.1)
1515

0 commit comments

Comments
 (0)