Skip to content

Commit 30a112b

Browse files
committed
Rename 3DAxes-->ThreeAxes, sync figure background with axes
1 parent 59c85f0 commit 30a112b

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

proplot/axes/three.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22
"""
33
The "3D" axes class.
44
"""
5-
from ..config import rc
6-
from . import base
5+
from . import plot, shared
76

87
try:
9-
from mpl_toolkits.mplot3d import Axes3D as Axes3DBase
8+
from mpl_toolkits.mplot3d import Axes3D
109
except ImportError:
11-
Axes3DBase = object
10+
Axes3D = object
1211

1312

14-
class Axes3D(base.Axes, Axes3DBase):
13+
class ThreeAxes(shared._SharedAxes, plot.PlotAxes, Axes3D):
1514
"""
16-
Simple mix-in of `proplot.axes.Axes` with `~mpl_toolkits.mplot3d.Axes3D`.
15+
Simple mix-in of `proplot.axes.PlotAxes` with `~mpl_toolkits.mplot3d.Axes3D`.
1716
"""
1817
#: The registered projection name.
19-
name = 'proplot_3d'
18+
name = 'proplot_three'
2019

2120
def __init__(self, *args, **kwargs):
22-
# No additions for now
2321
import mpl_toolkits.mplot3d # noqa: F401 verify package is available
2422
# Initialize axes
2523
super().__init__(*args, **kwargs)
2624

27-
def format(self, **kwargs):
28-
# No additions for now
29-
rc_kw, rc_mode, kwargs = self._parse_format(**kwargs)
30-
with rc.context(rc_kw, mode=rc_mode):
31-
return super().format(**kwargs)
25+
def _update_background(self, **kwargs):
26+
# Force the figure face color to the axes patch color or else the axes
27+
# look haphazardly thrown onto a square background patch and the spines
28+
# and labels bleed into the figure edge region.
29+
super()._update_background(**kwargs)
30+
self.figure.patch.set_facecolor(self.patch.get_facecolor())

0 commit comments

Comments
 (0)