Skip to content

matplotlib deprecated w_xaxis/w_yaxis/w_zaxis #53

@seanbruno

Description

@seanbruno

Goofing around today and noted that matplot lib has deprecated and changed the variables in Axes3d:
https://matplotlib.org/3.8.0/api/prev_api_changes/api_changes_3.8.0.html#axes3d

Seems to work correctly by just subbing in the new "xaxis/yaxis/zaxis" variables:

diff --git a/src/foom004_orbit_propagation/circular_orbit_no_awp.py b/src/foom004_orbit_propagation/circular_orbit_no_awp.py
index 34c6aa8..8bcdec7 100644
--- a/src/foom004_orbit_propagation/circular_orbit_no_awp.py
+++ b/src/foom004_orbit_propagation/circular_orbit_no_awp.py
@@ -127,7 +127,7 @@ def plot_orbits( rs, args ):
                                          azim = _args[ 'azimuth'   ] )
        
        if _args[ 'axes_no_fill' ]:
-               ax.w_xaxis.pane.fill = False
+               ax.axis.pane.fill = False^M
                ax.w_yaxis.pane.fill = False
                ax.w_zaxis.pane.fill = False            
 
diff --git a/src/python_tools/plotting_tools.py b/src/python_tools/plotting_tools.py
index fc5a331..29dd37d 100644
--- a/src/python_tools/plotting_tools.py
+++ b/src/python_tools/plotting_tools.py
@@ -184,9 +184,9 @@ def plot_reference_frames( frames, args, vectors = [], plots = [], planes = [] )
                ax.set_axis_off()
 
        if _args[ 'axes_no_fill' ]:
-               ax.w_xaxis.pane.fill = False
-               ax.w_yaxis.pane.fill = False
-               ax.w_zaxis.pane.fill = False
+               ax.xaxis.pane.fill = False^M
+               ax.yaxis.pane.fill = False^M
+               ax.zaxis.pane.fill = False^M
 
        if _args[ 'azimuth' ] is not None:
                ax.view_init( elev = _args[ 'elevation' ],
@@ -316,9 +316,9 @@ def plot_orbits( rs, args, vectors = [] ):
                                          azim = _args[ 'azimuth'   ] )
        
        if _args[ 'axes_no_fill' ]:
-               ax.w_xaxis.pane.fill = False
-               ax.w_yaxis.pane.fill = False
-               ax.w_zaxis.pane.fill = False            
+               ax.xaxis.pane.fill = False^M
+               ax.yaxis.pane.fill = False^M
+               ax.zaxis.pane.fill = False              ^M
 
        if _args[ 'hide_axes' ]:
                ax.set_axis_off()
@@ -953,9 +953,9 @@ def plot_cr3bp_3d( mu, rs, args, vectors = [] ):
                                          azim = _args[ 'azimuth'   ] )
 
        if _args[ 'axes_no_fill' ]:
-               ax.w_xaxis.pane.fill = False
-               ax.w_yaxis.pane.fill = False
-               ax.w_zaxis.pane.fill = False
+               ax.xaxis.pane.fill = False^M
+               ax.yaxis.pane.fill = False^M
+               ax.zaxis.pane.fill = False^M
 
        if _args[ 'hide_axes' ]:
                ax.set_axis_off()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions