@@ -100,7 +100,7 @@ def _get_layout(nplots: int, layout=None, layout_type: str = "box") -> Tuple[int
100
100
# copied from matplotlib/pyplot.py and modified for pandas.plotting
101
101
102
102
103
- def _subplots (
103
+ def create_subplots (
104
104
naxes : int ,
105
105
sharex : bool = False ,
106
106
sharey : bool = False ,
@@ -194,7 +194,7 @@ def _subplots(
194
194
fig = plt .figure (** fig_kw )
195
195
else :
196
196
if is_list_like (ax ):
197
- ax = _flatten (ax )
197
+ ax = flatten_axes (ax )
198
198
if layout is not None :
199
199
warnings .warn (
200
200
"When passing multiple axes, layout keyword is ignored" , UserWarning
@@ -221,7 +221,7 @@ def _subplots(
221
221
if squeeze :
222
222
return fig , ax
223
223
else :
224
- return fig , _flatten (ax )
224
+ return fig , flatten_axes (ax )
225
225
else :
226
226
warnings .warn (
227
227
"To output multiple subplots, the figure containing "
@@ -264,7 +264,7 @@ def _subplots(
264
264
for ax in axarr [naxes :]:
265
265
ax .set_visible (False )
266
266
267
- _handle_shared_axes (axarr , nplots , naxes , nrows , ncols , sharex , sharey )
267
+ handle_shared_axes (axarr , nplots , naxes , nrows , ncols , sharex , sharey )
268
268
269
269
if squeeze :
270
270
# Reshape the array to have the final desired dimension (nrow,ncol),
@@ -297,7 +297,7 @@ def _remove_labels_from_axis(axis: "Axis"):
297
297
axis .get_label ().set_visible (False )
298
298
299
299
300
- def _handle_shared_axes (
300
+ def handle_shared_axes (
301
301
axarr : Iterable ["Axes" ],
302
302
nplots : int ,
303
303
naxes : int ,
@@ -351,15 +351,15 @@ def _handle_shared_axes(
351
351
_remove_labels_from_axis (ax .yaxis )
352
352
353
353
354
- def _flatten (axes : Union ["Axes" , Sequence ["Axes" ]]) -> Sequence ["Axes" ]:
354
+ def flatten_axes (axes : Union ["Axes" , Sequence ["Axes" ]]) -> Sequence ["Axes" ]:
355
355
if not is_list_like (axes ):
356
356
return np .array ([axes ])
357
357
elif isinstance (axes , (np .ndarray , ABCIndexClass )):
358
358
return axes .ravel ()
359
359
return np .array (axes )
360
360
361
361
362
- def _set_ticks_props (
362
+ def set_ticks_props (
363
363
axes : Union ["Axes" , Sequence ["Axes" ]],
364
364
xlabelsize = None ,
365
365
xrot = None ,
@@ -368,7 +368,7 @@ def _set_ticks_props(
368
368
):
369
369
import matplotlib .pyplot as plt
370
370
371
- for ax in _flatten (axes ):
371
+ for ax in flatten_axes (axes ):
372
372
if xlabelsize is not None :
373
373
plt .setp (ax .get_xticklabels (), fontsize = xlabelsize )
374
374
if xrot is not None :
@@ -380,7 +380,7 @@ def _set_ticks_props(
380
380
return axes
381
381
382
382
383
- def _get_all_lines (ax : "Axes" ) -> List ["Line2D" ]:
383
+ def get_all_lines (ax : "Axes" ) -> List ["Line2D" ]:
384
384
lines = ax .get_lines ()
385
385
386
386
if hasattr (ax , "right_ax" ):
@@ -392,7 +392,7 @@ def _get_all_lines(ax: "Axes") -> List["Line2D"]:
392
392
return lines
393
393
394
394
395
- def _get_xlim (lines : Iterable ["Line2D" ]) -> Tuple [float , float ]:
395
+ def get_xlim (lines : Iterable ["Line2D" ]) -> Tuple [float , float ]:
396
396
left , right = np .inf , - np .inf
397
397
for l in lines :
398
398
x = l .get_xdata (orig = False )
0 commit comments