Skip to content

Commit

Permalink
Speed up the plot_line() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ejeschke committed Jul 23, 2024
1 parent 9b4b8f3 commit 5f34a53
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions ginga/gw/PlotView.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,9 @@ def plot_line(self, x_data, y_data, name=None,
'color': color,
'alpha': alpha,
}
self.w.x_combo.set_enabled(False)
self.w.y_combo.set_enabled(False)

try:
self.line_plot.plot(
x_data, y_data,
xtitle=None, ytitle=None,
marker=None, **plt_kw)

# if not reset_xlimits:
# self.set_xlim_cb()
self.set_xlimits_widgets()

# if not reset_ylimits:
# self.set_ylim_cb()
self.set_ylimits_widgets()
ax = self.line_plot.ax
ax.plot(x_data, y_data, **plt_kw)

except Exception as e:
self.logger.error(str(e), exc_info=True)
Expand All @@ -287,6 +274,19 @@ def plot_text(self, x, y, text, rot_deg=0,
def set_titles(self, title=None, x_axis=None, y_axis=None):
self.line_plot.set_titles(xtitle=x_axis, ytitle=y_axis, title=title)

def update_limits(self):
self.w.x_combo.set_enabled(False)
self.w.y_combo.set_enabled(False)

# if not reset_xlimits:
# self.set_xlim_cb()
self.set_xlimits_widgets()

# if not reset_ylimits:
# self.set_ylim_cb()
self.set_ylimits_widgets()


def do_plot(self, reset_xlimits=True, reset_ylimits=True):
"""Simple line plot."""
self.clear_plot()
Expand Down

0 comments on commit 5f34a53

Please sign in to comment.