Skip to content

Commit

Permalink
Merge pull request #101 from traja-team/fix/trip-grid
Browse files Browse the repository at this point in the history
Fix histogram rotation to keep y as first dimension
  • Loading branch information
JustinShenk committed Oct 11, 2022
2 parents f347c8c + 5968833 commit d4c5ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion traja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from .trajectory import *

__author__ = "justinshenk"
__version__ = "0.2.13"
__version__ = "22.0.0"

logging.basicConfig(level=logging.INFO)

Expand Down
5 changes: 4 additions & 1 deletion traja/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,14 @@ def trip_grid(
ymin, ymax = ylim

x, y = zip(*df.values)
# FIXME: Remove redundant histogram calculation

hist, x_edges, y_edges = np.histogram2d(
x, y, bins, range=((xmin, xmax), (ymin, ymax)), normed=normalize
)

# rotate to keep y as first dimension
hist = np.rot90(hist)

if log:
hist = np.log(hist + np.e)
if hist_only: # TODO: Evaluate potential use cases or remove
Expand Down

0 comments on commit d4c5ff3

Please sign in to comment.