Skip to content

DOC : add note about np.matrix and pandas objects #3394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 22, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions doc/faq/usage_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ idea). When the figure is rendered, all of the artists are drawn to
the **canvas**. Most Artists are tied to an Axes; such an Artist
cannot be shared by multiple Axes, or moved from one to another.

.. _input_types:

Types of inputs to plotting functions
=====================================

All of plotting functions expect `np.array` or `np.ma.masked_array` as
input. Classes that are 'array-like' such as `pandas` data objects
and `np.matrix` may or may not work as intended. It is best to
convert these to `np.array` objects prior to plotting.

For example, to covert a `pandas.DataFrame` ::

a = pandas.DataFrame(np.random.rand(4,5), columns = list('abcde'))
a_asndarray = a.values

and to covert a `np.matrix` ::

b = np.matrix([[1,2],[3,4]])
b_asarray = np.asarray(b)



.. _pylab:

Expand Down