0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

fix(figure): subplot methods consolidated; added subplot factory

This commit is contained in:
2024-06-27 16:38:08 +02:00
parent 797f73c39a
commit 4a97105e4b
4 changed files with 37 additions and 117 deletions

View File

@ -10,7 +10,7 @@ from bec_widgets.cli.client import BECFigure, BECImageShow, BECMotorMap, BECWave
def test_rpc_waveform1d_custom_curve(rpc_server_figure):
fig = BECFigure(rpc_server_figure)
ax = fig.add_plot()
ax = fig.plot()
curve = ax.plot(x=[1, 2, 3], y=[1, 2, 3])
curve.set_color("red")
curve = ax.curves[0]
@ -26,7 +26,7 @@ def test_rpc_plotting_shortcuts_init_configs(rpc_server_figure, qtbot):
plt = fig.plot(x_name="samx", y_name="bpm4i")
im = fig.image("eiger")
motor_map = fig.motor_map("samx", "samy")
plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
plt_z = fig.plot(x_name="samx", y_name="samy", z_name="bpm4i", new=True)
# Checking if classes are correctly initialised
assert len(fig.widgets) == 4

View File

@ -9,7 +9,7 @@ def test_rpc_register_list_connections(rpc_server_figure):
plt = fig.plot(x_name="samx", y_name="bpm4i")
im = fig.image("eiger")
motor_map = fig.motor_map("samx", "samy")
plt_z = fig.add_plot(x_name="samx", y_name="samy", z_name="bpm4i")
plt_z = fig.plot(x_name="samx", y_name="samy", z_name="bpm4i", new=True)
# keep only class names from objects, since objects on server and client are different
# so the best we can do is to compare types (rpc register is unit-tested elsewhere)