You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the :meth:`boxplot <matplotlib.axes.Axes.boxplot>` method and the
346
+
`matplotlib boxplot documenation <http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.boxplot>`__ for more.
347
+
348
+
349
+
The existing interface ``DataFrame.boxplot`` to plot boxplot still can be used.
350
+
297
351
.. ipython:: python
298
352
:suppress:
299
353
@@ -354,18 +408,23 @@ columns:
354
408
355
409
.. _visualization.box.return:
356
410
357
-
The return type of ``boxplot`` depends on two keyword arguments: ``by`` and ``return_type``.
358
-
When ``by`` is ``None``:
411
+
Basically, plot functions return :class:`matplotlib Axes <matplotlib.axes.Axes>` as a return value.
412
+
In ``boxplot``, the return type can be changed by argument ``return_type``, and whether the subplots is enabled (``subplots=True`` in ``plot`` or ``by`` is specified in ``boxplot``).
413
+
414
+
When ``subplots=False`` / ``by`` is ``None``:
359
415
360
416
* if ``return_type`` is ``'dict'``, a dictionary containing the :class:`matplotlib Lines <matplotlib.lines.Line2D>` is returned. The keys are "boxes", "caps", "fliers", "medians", and "whiskers".
361
-
This is the default.
417
+
This is the default of ``boxplot`` in historical reason.
418
+
Note that ``plot(kind='box')`` returns ``Axes`` as default as the same as other plots.
362
419
* if ``return_type`` is ``'axes'``, a :class:`matplotlib Axes <matplotlib.axes.Axes>` containing the boxplot is returned.
363
420
* if ``return_type`` is ``'both'`` a namedtuple containging the :class:`matplotlib Axes <matplotlib.axes.Axes>`
364
421
and :class:`matplotlib Lines <matplotlib.lines.Line2D>` is returned
365
422
366
-
When ``by`` is some column of the DataFrame, a dict of ``return_type`` is returned, where
367
-
the keys are the columns of the DataFrame. The plot has a facet for each column of
368
-
the DataFrame, with a separate box for each value of ``by``.
423
+
When ``subplots=True`` / ``by`` is some column of the DataFrame:
424
+
425
+
* A dict of ``return_type`` is returned, where the keys are the columns
426
+
of the DataFrame. The plot has a facet for each column of
427
+
the DataFrame, with a separate box for each value of ``by``.
369
428
370
429
Finally, when calling boxplot on a :class:`Groupby` object, a dict of ``return_type``
371
430
is returned, where the keys are the same as the Groupby object. The plot has a
0 commit comments