@@ -99,18 +99,9 @@ def _open_polar_axes(self, ax, props):
9999 )
100100 theta_offset = ax .get_theta_offset ()
101101 theta_direction = ax .get_theta_direction ()
102- angular_gridlines = ax .xaxis .get_gridlines ()
103- radial_gridlines = ax .yaxis .get_gridlines ()
104- angular_grid = (
105- (angular_gridlines [0 ].get_color (), angular_gridlines [0 ].get_visible ())
106- if len (angular_gridlines )
107- else ("#b0b0b0" , True )
108- )
109- radial_grid = (
110- (radial_gridlines [0 ].get_color (), radial_gridlines [0 ].get_visible ())
111- if len (radial_gridlines )
112- else ("#b0b0b0" , True )
113- )
102+ axes = props .get ("axes" , [])
103+ angular_grid = axes [0 ].get ("grid" , {}) if len (axes ) > 0 else {}
104+ radial_grid = axes [1 ].get ("grid" , {}) if len (axes ) > 1 else {}
114105 frame = props .get ("polar_frame" )
115106 self .plotly_fig ["layout" ][self .current_polar_subplot ] = go .layout .Polar (
116107 bgcolor = _export_color (props ["axesbg" ]),
@@ -119,8 +110,8 @@ def _open_polar_axes(self, ax, props):
119110 direction = ("counterclockwise" if theta_direction >= 0 else "clockwise" ),
120111 tickvals = [float (t ) for t in np .degrees (ax .xaxis .get_majorticklocs ())],
121112 ticktext = [t .get_text () for t in ax .xaxis .get_majorticklabels ()],
122- showgrid = angular_grid [ 1 ] ,
123- gridcolor = _export_color (angular_grid [ 0 ] ),
113+ showgrid = angular_grid . get ( "gridOn" , True ) ,
114+ gridcolor = _export_color (angular_grid . get ( "color" , "#B0B0B0" ) ),
124115 showline = frame ["visible" ] if frame else True ,
125116 linecolor = (_export_color (frame ["color" ]) if frame else "black" ),
126117 linewidth = frame ["linewidth" ] if frame else 1 ,
@@ -129,8 +120,8 @@ def _open_polar_axes(self, ax, props):
129120 range = [float (v ) for v in ax .get_ylim ()],
130121 tickvals = [float (t ) for t in ax .yaxis .get_majorticklocs ()],
131122 ticktext = [t .get_text () for t in ax .yaxis .get_majorticklabels ()],
132- showgrid = radial_grid [ 1 ] ,
133- gridcolor = _export_color (radial_grid [ 0 ] ),
123+ showgrid = radial_grid . get ( "gridOn" , True ) ,
124+ gridcolor = _export_color (radial_grid . get ( "color" , "#B0B0B0" ) ),
134125 showline = False ,
135126 ),
136127 )
0 commit comments