mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 11:41:49 +02:00
feat(figure): changes to support direct plot functionality
This commit is contained in:
@ -59,7 +59,7 @@ def test_bec_dock_area_add_remove_dock(bec_dock_area, qtbot):
|
||||
def test_add_remove_bec_figure_to_dock(bec_dock_area):
|
||||
d0 = bec_dock_area.add_dock()
|
||||
fig = d0.add_widget_bec("BECFigure")
|
||||
plt = fig.plot("samx", "bpm4i")
|
||||
plt = fig.plot(x_name="samx", y_name="bpm4i")
|
||||
im = fig.image("eiger")
|
||||
mm = fig.motor_map("samx", "samy")
|
||||
|
||||
|
@ -65,7 +65,7 @@ def test_bec_figure_add_remove_plot(bec_figure):
|
||||
|
||||
|
||||
def test_add_different_types_of_widgets(bec_figure):
|
||||
plt = bec_figure.plot("samx", "bpm4i")
|
||||
plt = bec_figure.plot(x_name="samx", y_name="bpm4i")
|
||||
im = bec_figure.image("eiger")
|
||||
motor_map = bec_figure.motor_map("samx", "samy")
|
||||
|
||||
@ -228,7 +228,7 @@ def test_clear_all(bec_figure):
|
||||
|
||||
|
||||
def test_shortcuts(bec_figure):
|
||||
plt = bec_figure.plot("samx", "bpm4i")
|
||||
plt = bec_figure.plot(x_name="samx", y_name="bpm4i")
|
||||
im = bec_figure.image("eiger")
|
||||
motor_map = bec_figure.motor_map("samx", "samy")
|
||||
|
||||
|
@ -304,6 +304,18 @@ def test_set_custom_curve_data(bec_figure, qtbot):
|
||||
assert np.array_equal(y_new, [7, 8, 9])
|
||||
|
||||
|
||||
def test_custom_data_2D_array(bec_figure, qtbot):
|
||||
|
||||
data = np.random.rand(10, 2)
|
||||
|
||||
plt = bec_figure.plot(data)
|
||||
|
||||
x, y = plt.curves[0].get_data()
|
||||
|
||||
assert np.array_equal(x, data[:, 0])
|
||||
assert np.array_equal(y, data[:, 1])
|
||||
|
||||
|
||||
def test_get_all_data(bec_figure):
|
||||
w1 = bec_figure.add_plot()
|
||||
|
||||
|
Reference in New Issue
Block a user