mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
fix(plot_base): set_xy autorange moved to plotbase from waveform
This commit is contained in:
@ -2057,6 +2057,19 @@ class BECWaveformWidget(RPCBase):
|
||||
legend_label_size(int): Size of the legend labels.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_auto_range(self, enabled: "bool", axis: "str" = "xy"):
|
||||
"""
|
||||
Set the auto range of the plot widget.
|
||||
|
||||
Args:
|
||||
enabled(bool): If True, enable the auto range.
|
||||
axis(str, optional): The axis to enable the auto range.
|
||||
- "xy": Enable auto range for both x and y axis.
|
||||
- "x": Enable auto range for x axis.
|
||||
- "y": Enable auto range for y axis.
|
||||
"""
|
||||
|
||||
@rpc_call
|
||||
def set_grid(self, x_grid: "bool", y_grid: "bool"):
|
||||
"""
|
||||
|
@ -291,6 +291,19 @@ class BECPlotBase(BECConnector, pg.GraphicsLayout):
|
||||
"""
|
||||
self.plot_item.setAspectLocked(lock)
|
||||
|
||||
def set_auto_range(self, enabled: bool, axis: str = "xy"):
|
||||
"""
|
||||
Set the auto range of the plot widget.
|
||||
|
||||
Args:
|
||||
enabled(bool): If True, enable the auto range.
|
||||
axis(str, optional): The axis to enable the auto range.
|
||||
- "xy": Enable auto range for both x and y axis.
|
||||
- "x": Enable auto range for x axis.
|
||||
- "y": Enable auto range for y axis.
|
||||
"""
|
||||
self.plot_item.enableAutoRange(axis, enabled)
|
||||
|
||||
def export(self):
|
||||
"""Show the Export Dialog of the plot widget."""
|
||||
scene = self.plot_item.scene()
|
||||
|
@ -47,6 +47,7 @@ class BECWaveformWidget(BECWidget, QWidget):
|
||||
"set_x_lim",
|
||||
"set_y_lim",
|
||||
"set_legend_label_size",
|
||||
"set_auto_range",
|
||||
"set_grid",
|
||||
"lock_aspect_ratio",
|
||||
"export",
|
||||
|
Reference in New Issue
Block a user