Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #236 from spacetelescope/loaders
Browse files Browse the repository at this point in the history
fix scatterplot and histogram bugs
  • Loading branch information
nmearl authored Dec 9, 2016
2 parents f03bc96 + 2e0a6e3 commit 131dadd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions specviz/core/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,20 @@ def update(self, autoscale=False):
data = self.layer.data.compressed().value
uncert = self.layer.raw_uncertainty.compressed().value

disp = np.append(disp, disp[-1]) if self.mode is 'histogram' else disp
# data = data[:-1] if self.mode is 'histogram' else data
#-- Changes specific for scatter plot rendering
symbol = 'o' if self.mode == 'scatter' else None
pen = None if self.mode == 'scatter' else self.pen

self._plot.setData(disp, data, symbol='o' if self.mode is 'scatter' else None,
stepMode=True if self.mode is 'histogram' else False,
pen=None if self.mode is 'scatter' else self.pen)
#-- changes specific for histrogram rendering
stepMode = True if self.mode == 'histogram' else False
disp = np.append(disp, disp[-1]) if self.mode == 'histogram' else disp

self._plot.setData(disp,
data,
symbol=symbol,
stepMode=stepMode,
pen=pen)

if self.error is not None:
self.error.setData(x=disp[:-1] if self.mode is 'histogram' else disp,
self.error.setData(x=disp[:-1] if self.mode == 'histogram' else disp,
y=data, height=uncert)

0 comments on commit 131dadd

Please sign in to comment.