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

ax.set_aspect('equal') doesn't work in the latest matplotlib #52

Closed
kaizu opened this issue Jun 2, 2019 · 1 comment
Closed

ax.set_aspect('equal') doesn't work in the latest matplotlib #52

kaizu opened this issue Jun 2, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@kaizu
Copy link
Member

kaizu commented Jun 2, 2019

from ecell4 import *
from ecell4_base.core import *

with species_attributes():
    A | {'D': 1, 'location': 'M'}
    M | {'dimension': 2}

surface = Sphere(ones() * 0.5, 0.4).surface()
obs = FixedIntervalTrajectoryObserver(1e-4)

run_simulation(
    0.4, model=m, y0={'A': 10}, structures={'M': surface},
    solver='spatiocyte', observers=obs, return_type=None)

viz.plot_trajectory(obs, interactive=False)

The code above fails:

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-27-dfdbcd4e632b> in <module>
     13     solver='spatiocyte', observers=obs, return_type=None)
     14 
---> 15 viz.plot_trajectory(obs, interactive=False)

~\Miniconda3\lib\site-packages\ecell4\util\viz.py in plot_trajectory(*args, **kwargs)
    126         plot_trajectory_with_elegans(*args, **kwargs)
    127     else:
--> 128         plot_trajectory_with_matplotlib(*args, **kwargs)
    129 
    130 def plot_number_observer_with_matplotlib(*args, **kwargs):

~\Miniconda3\lib\site-packages\ecell4\util\viz.py in plot_trajectory_with_matplotlib(obs, max_count, figsize, legend, angle, wireframe, grid, noaxis, plot_range, **kwargs)
   1185     fig, ax = __prepare_mplot3d_with_matplotlib(
   1186         __get_range_of_trajectories(data, plot_range),
-> 1187         figsize, grid, wireframe, angle, noaxis)
   1188 
   1189     lines = []

~\Miniconda3\lib\site-packages\ecell4\util\viz.py in __prepare_mplot3d_with_matplotlib(wrange, figsize, grid, wireframe, angle, noaxis)
   1047     fig = plt.figure(figsize=(figsize, figsize))
   1048     ax = fig.gca(projection='3d')
-> 1049     ax.set_aspect('equal')
   1050 
   1051     if wireframe:

~\Miniconda3\lib\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

The version of matplotlib is matplotlib==3.1.0.

@kaizu kaizu added the bug Something isn't working label Jun 2, 2019
@kaizu
Copy link
Member Author

kaizu commented Jun 3, 2019

See matplotlib/matplotlib#1077

@kaizu kaizu self-assigned this Jun 3, 2019
kaizu added a commit to kaizu/ecell4 that referenced this issue Jun 3, 2019
@kaizu kaizu closed this as completed Jun 3, 2019
kaizu added a commit to kaizu/ecell4 that referenced this issue Jun 4, 2019
@kaizu kaizu mentioned this issue Jun 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant