Skip to content

Commit

Permalink
Fix attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
dpodvyaznikov committed Feb 13, 2020
1 parent 679641f commit 8377ae4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions seismicpro/src/plot_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class IndexTracker:
"""Provides onscroll and update methods for matplotlib scroll_event."""
def __init__(self, ax, frames, frame_names, scroll_step=1, **kwargs):
self.ax = ax
self._ax = ax
self.frames = frames
self.step = scroll_step
self.frame_names = frame_names
Expand All @@ -27,21 +27,21 @@ def onscroll(self, event):

def update(self):
"""Update method."""
self.ax.clear()
self._ax.clear()
img = self.frames[self.ind]
img = np.squeeze(img)
if img.ndim == 2:
self.ax.imshow(img.T, **self.img_kwargs)
self._ax.imshow(img.T, **self.img_kwargs)
elif img.ndim == 1:
self.ax.plot(img.T, **self.img_kwargs)
self._ax.plot(img.T, **self.img_kwargs)
else:
raise ValueError('Invalid ndim to plot data.')

self.ax.set_title('%s' % self.frame_names[self.ind])
self.ax.set_aspect('auto')
self._ax.set_title('%s' % self.frame_names[self.ind])
self._ax.set_aspect('auto')
if img.ndim == 2:
self.ax.set_ylim([img.shape[1], 0])
self.ax.set_xlim([0, img.shape[0]])
self._ax.set_ylim([img.shape[1], 0])
self._ax.set_xlim([0, img.shape[0]])

def seismic_plot(arrs, wiggle=False, xlim=None, ylim=None, std=1, # pylint: disable=too-many-branches, too-many-arguments
pts=None, s=None, scatter_color=None, names=None, figsize=None,
Expand Down

0 comments on commit 8377ae4

Please sign in to comment.