Skip to content

Commit

Permalink
Refs #39. Tried to fix auto scale with plot.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Nov 1, 2018
1 parent 67c8c81 commit c313cff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyrs/interface/ui/diffdataviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,11 @@ def plot_scatter(self, vec_x, vec_y, x_label, y_label):
if x_label != self.get_label_x():
self.reset_viewer()

# plot data in a scattering plot
# plot data in a scattering plot with auto re-scale
ref_id = self.add_plot(vec_x, vec_y, line_style='', marker='.',
color='red', x_label=x_label, y_label=y_label)
# TODO - 20181101 - Enable after auto_scale is fixed: self.auto_rescale()

self._line_reference_list.append(ref_id)
self._last_line_reference = ref_id
self._current_x_axis_name = x_label
Expand Down
2 changes: 2 additions & 0 deletions pyrs/interface/ui/mplgraphicsview1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def auto_rescale(self, row_index=None, col_index=None, percent_room=0.05,
:param upper_y_boundary:
:return:
"""
# TODO FIXME - 20181101 - This is a broken method. Fix it!
if row_index is not None and col_index is not None:
# check
assert isinstance(row_index, int), 'row index {0} must be an integer but not a {1}' \
Expand All @@ -305,6 +306,7 @@ def auto_rescale(self, row_index=None, col_index=None, percent_room=0.05,
max_y_list = list()

# get line IDs
#
subplot_line_indexes = self._myCanvas.get_line_keys(row_index, col_index)

for line_key in subplot_line_indexes:
Expand Down

0 comments on commit c313cff

Please sign in to comment.