To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 96c583b0 authored by Cyrill Mast's avatar Cyrill Mast
Browse files

changed plot for ARF

parent 9975eba7
Pipeline #90685 passed with stages
in 5 minutes and 4 seconds
......@@ -66,7 +66,10 @@ class PlotGeneral:
ax.lines[0].set_data(self.x_data, self.y_data)
ax.relim()
ax.autoscale_view()
ax.canvas.draw()
try:
ax.canvas.draw()
except AttributeError:
pass
@property
def x_label(self) -> str:
......@@ -74,8 +77,8 @@ class PlotGeneral:
@x_label.setter
def x_label(self, value):
self._ax_semilogy.set_xlabel(value)
self._ax_complex.set_xlabel(value)
for ax in self._axes:
ax.set_xlabel(value)
self._x_label.value = value
@property
......@@ -84,8 +87,8 @@ class PlotGeneral:
@y_label.setter
def y_label(self, value):
self._ax_semilogy.set_ylabel(value)
self._ax_complex.set_ylabel(value)
for ax in self._axes:
ax.set_ylabel(value)
self._y_label.value = value
@property
......@@ -94,8 +97,8 @@ class PlotGeneral:
@title.setter
def title(self, value):
self._ax_semilogy.set_title(value)
self._ax_complex.set_title(value)
for ax in self._axes:
ax.set_title(value)
self._title.value = value
def rescale(self, resolution=None):
......
......@@ -19,8 +19,10 @@ class PlotARF(PlotGeneral):
if wavelength is None:
wavelength = 0.015
self.title = "The radiation force over the position"
self.x_data = np.linspace(-wavelength, wavelength, self.resolution)
self.x_label = "Position"
self.x_data = np.linspace(
-wavelength / 2.0, wavelength / 2.0, self.resolution)
self.x_label = "Position (m)"
self.y_label = "ARF (N)"
_ = []
for dpos in self.x_data:
self.arf.position = dpos
......
......@@ -57,4 +57,5 @@ class TestPlotARF(BaseTestComposite):
def test_plot_arf(self) -> None:
a = PlotAcoustofluidics(ARF=self.cls)
a.plot_ARF()
a.plot_ARF(res=1000, wavelength=0.0015)
print(self.cls.field.lambda_f)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment