Skip to content
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

detect and display plots in tuple/list/arrays #135

Closed
gdementen opened this issue Feb 5, 2018 · 2 comments
Closed

detect and display plots in tuple/list/arrays #135

gdementen opened this issue Feb 5, 2018 · 2 comments

Comments

@gdementen
Copy link
Collaborator

The editor detects return values of type "matplotlib.axes._subplots.AxesSubplot" and displays them, but some functions (notably Pandas "hist" method) or any plot with argument subplots=True produces an array of AxesSubplot and are thus not displayed. This is unfortunate and confusing for our users.

>>> a = ndtest('sex=M,F;year=2000..2017')
>>> # this should work out of the box
>>> # a.plot(subplots=True)
>>> p = a.plot(subplots=True)
>>> p[0]
<matplotlib.axes._subplots.AxesSubplot at 0x20a9900ff98>
>>> type(p)
numpy.ndarray
>>> p.shape
(2,)
>>> type(p[0])
matplotlib.axes._subplots.AxesSubplot

We need to avoid examining all elements of arrays systematically, but I think checking the first element of arrays should be enough anyway.

@gdementen
Copy link
Collaborator Author

It also needs to work for arrays with ndim > 1. For example:

a = ndrange('sex=M,F;nat=BE,FO;year=2000..2017')
a.plot(subplots=True)

@alixdamman alixdamman added this to the 0.28 milestone Feb 5, 2018
alixdamman added a commit to alixdamman/larray-editor that referenced this issue Feb 23, 2018
@alixdamman
Copy link
Contributor

ndim > 1:

  a = ndtest('sex=M,F;nat=BE,FO;year=2000..2017')
  a.plot(subplots=True, layout=(2, 2))

alixdamman added a commit to alixdamman/larray-editor that referenced this issue Mar 6, 2018
gdementen pushed a commit to gdementen/larray-editor that referenced this issue Sep 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants