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

plot_kep breaks with recent matplotlib #188

Open
craigim opened this issue Mar 19, 2020 · 3 comments
Open

plot_kep breaks with recent matplotlib #188

craigim opened this issue Mar 19, 2020 · 3 comments

Comments

@craigim
Copy link

craigim commented Mar 19, 2020

When I try to use plot_kep, I get :

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-119-76c4fc158eb2> in <module>
----> 1 plot_kep(kep, data[:, 1:4])

~/anaconda3/lib/python3.7/site-packages/orbitdeterminator-1.0-py3.7.egg/orbitdeterminator/kep_determination/ellipse_fit.py in plot_kep(kep, data)
    386     fig = plt.figure()
    387     ax = Axes3D(fig)
--> 388     ax.axis('equal')
    389 
    390     # plot

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_base.py in axis(self, *args, **kwargs)
   1675                 # self.apply_aspect()
   1676                 if s == 'equal':
-> 1677                     self.set_aspect('equal', adjustable='datalim')
   1678                 elif s == 'scaled':
   1679                     self.set_aspect('equal', adjustable='box', anchor='C')

~/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_base.py in set_aspect(self, aspect, adjustable, anchor, share)
   1279         if (not cbook._str_equal(aspect, 'auto')) and self.name == '3d':
   1280             raise NotImplementedError(
-> 1281                 'It is not currently possible to manually set the aspect '
   1282                 'on 3D axes')
   1283 

NotImplementedError: It is not currently possible to manually set the aspect on 3D axes

It appears to be related to matplotlib/matplotlib#1077 where, rather than fixing an issue with setting the aspect ratio, they instead just shut off the feature.

@Allan-Perez
Copy link

Allan-Perez commented Mar 25, 2020

I have tried it, and you're right. It seems to be an open issue within the matplotlib library. I suggest to put it as a try-except block, trying the matplotlib function, but if there's this error (NotImplementedError), then try another way. This way would be to put a numerical limit on the axes, where these limits would be the largest (and smallest) value of all the axes, and then set it to all of the axes (original idea of tauran). I tried it with the orbit.csv dataset, and it seems to work just fine. I'll do a pull request so that they can test it and improve it further.

@tacaswell
Copy link

Setting the aspect of 3D plots never actually worked (which is why we now raise NotImplemented).

@hornig
Copy link
Collaborator

hornig commented Mar 25, 2021

@tacaswell @craigim @Allan-Perez can we close this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants