Skip to content

Commit

Permalink
Merge pull request #767 from nkeim/fix-issue-759
Browse files Browse the repository at this point in the history
  • Loading branch information
nkeim authored Jun 7, 2024
2 parents c1faf16 + 10674d9 commit 09ad08f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/releases/v0.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ trackpy v0.6.3 is a minor compatibility update for newer Pandas verisons.
Dependencies
~~~~~~~~~~~~
- Improves support for latest Pandas in emsd function (@hz-xiaxz, #758)
- Fix deprecated matplotlib usage in 3D plotting (@jacopoabramo, #767)


v0.6.2
Expand Down
2 changes: 1 addition & 1 deletion trackpy/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def wrapper(*args, **kwargs):
if kwargs.get('ax') is None:
if not hasattr(plt.gca(), 'zaxis'):
plt.figure() # initialize new Fig when current axis is not 3d
kwargs['ax'] = plt.gca(projection='3d')
kwargs['ax'] = plt.subplot(projection='3d')
show_plot = True
else:
if not hasattr(plt.gca(), 'zaxis'):
Expand Down
6 changes: 6 additions & 0 deletions trackpy/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ def test_ptraj_t_column(self):
df.columns = cols
plots.plot_traj(df, t_column='arbitrary name')

def test_ptraj3d(self):
sparse3d = self.sparse.copy()
sparse3d['z'] = 0
# smoke test
plots.plot_traj3d(sparse3d)

def test_annotate(self):
suppress_plotting()
f = DataFrame({'x': [0, 1], 'y': [0, 1], 'frame': [0, 0],
Expand Down

0 comments on commit 09ad08f

Please sign in to comment.