|
2 | 2 | """
|
3 | 3 | The "3D" axes class.
|
4 | 4 | """
|
5 |
| -from ..config import rc |
6 |
| -from . import base |
| 5 | +from . import plot, shared |
7 | 6 |
|
8 | 7 | try:
|
9 |
| - from mpl_toolkits.mplot3d import Axes3D as Axes3DBase |
| 8 | + from mpl_toolkits.mplot3d import Axes3D |
10 | 9 | except ImportError:
|
11 |
| - Axes3DBase = object |
| 10 | + Axes3D = object |
12 | 11 |
|
13 | 12 |
|
14 |
| -class Axes3D(base.Axes, Axes3DBase): |
| 13 | +class ThreeAxes(shared._SharedAxes, plot.PlotAxes, Axes3D): |
15 | 14 | """
|
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`. |
17 | 16 | """
|
18 | 17 | #: The registered projection name.
|
19 |
| - name = 'proplot_3d' |
| 18 | + name = 'proplot_three' |
20 | 19 |
|
21 | 20 | def __init__(self, *args, **kwargs):
|
22 |
| - # No additions for now |
23 | 21 | import mpl_toolkits.mplot3d # noqa: F401 verify package is available
|
24 | 22 | # Initialize axes
|
25 | 23 | super().__init__(*args, **kwargs)
|
26 | 24 |
|
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