Skip to content

Commit f3bea53

Browse files
Deprecating the trellis rplot module (GH3445)
1 parent 7e3212e commit f3bea53

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

doc/source/visualization.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,16 @@ when plotting a large number of points.
16071607
Trellis plotting interface
16081608
--------------------------
16091609

1610+
.. warning::
1611+
1612+
The ``rplot`` trellis plotting interface is deprecated and will be removed
1613+
in a future version. We refer to external packages like
1614+
`seaborn <https://github.com/mwaskom/seaborn>`_ for similar but more
1615+
refined functionality.
1616+
1617+
The docs below include some example on how to convert your existing code to
1618+
these packages.
1619+
16101620
.. ipython:: python
16111621
:suppress:
16121622
@@ -1622,7 +1632,6 @@ Trellis plotting interface
16221632
iris_data = read_csv('data/iris.data')
16231633
from pandas import read_csv
16241634
from pandas.tools.plotting import radviz
1625-
import pandas.tools.rplot as rplot
16261635
plt.close('all')
16271636
16281637
@@ -1641,6 +1650,7 @@ Trellis plotting interface
16411650
We import the rplot API:
16421651

16431652
.. ipython:: python
1653+
:okwarning:
16441654
16451655
import pandas.tools.rplot as rplot
16461656

doc/source/whatsnew/v0.16.0.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,10 +365,25 @@ The behavior of a small sub-set of edge cases for using ``.loc`` have changed (:
365365
In [4]: df.loc[2:3]
366366
TypeError: Cannot do slice indexing on <class 'pandas.tseries.index.DatetimeIndex'> with <type 'int'> keys
367367

368+
369+
.. _whatsnew_0160.deprecations:
370+
368371
Deprecations
369372
~~~~~~~~~~~~
370373

371-
.. _whatsnew_0160.deprecations:
374+
- The ``rplot`` trellis plotting interface is deprecated and will be removed
375+
in a future version. We refer to external packages like
376+
`seaborn <http://stanford.edu/~mwaskom/software/seaborn/>`_ for similar
377+
but more refined functionality (:issue:`3445`).
378+
379+
The documentation includes some examples how to convert your existing code
380+
using ``rplot`` to seaborn: - :ref:`rplot docs <rplot>`
381+
382+
383+
.. _whatsnew_0160.prior_deprecations:
384+
385+
Removal of prior version deprecations/changes
386+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
372387

373388
- ``DataFrame.pivot_table`` and ``crosstab``'s ``rows`` and ``cols`` keyword arguments were removed in favor
374389
of ``index`` and ``columns`` (:issue:`6581`)

pandas/tools/rplot.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import random
2+
import warnings
23
from copy import deepcopy
34
from pandas.core.common import _values_from_object
45

@@ -9,6 +10,16 @@
910
# * Make sure legends work properly
1011
#
1112

13+
14+
warnings.warn("\n"
15+
"The rplot trellis plotting interface is deprecated and will be "
16+
"removed in a future version. We refer to external packages "
17+
"like seaborn for similar but more refined functionality. \n\n"
18+
"See our docs http://pandas.pydata.org/pandas-docs/stable/visualization.html#rplot "
19+
"for some example how to convert your existing code to these "
20+
"packages.", FutureWarning)
21+
22+
1223
class Scale:
1324
"""
1425
Base class for mapping between graphical and data attributes.

0 commit comments

Comments
 (0)