Skip to content

Commit

Permalink
improvements to applications.MorphPlotter 2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Mar 11, 2024
1 parent adf5c6b commit 9e68ef2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/snippets/test_compare_fit1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def fit_function(x, A, beta, B, mu, sigma):
label="Fit function",
)
h.add_legend()
h.show(zoom="tight")
h.show(zoom="tight", interactive=False)

if settings.dry_run_mode:
exit(0)
Expand Down
4 changes: 1 addition & 3 deletions vedo/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def slider_function_z(widget, event):
class MorphPlotter(Plotter):
"""
A Plotter with 3 renderers to show the source, target and warped meshes.
Examples:
- [warp4b.py](https://github.com/marcomusy/vedo/tree/master/examples/advanced/warp4b.py)
Expand Down Expand Up @@ -615,7 +615,6 @@ def on_keypress(self, evt):
self.target.pickable(False)
self.update()
if evt.keypress == "z" or evt.keypress == "a":
self.nbins = 25
dists = self.warped.distance_to(self.target, signed=True)
v = np.std(dists) * 2
self.warped.cmap(self.cmap_name, dists, vmin=-v, vmax=+v)
Expand Down Expand Up @@ -643,7 +642,6 @@ def gauss(x, A, B, sigma):
from scipy.optimize import curve_fit
inits = [0, len(dists)/self.nbins*2.5, v/2]
popt, _ = curve_fit(gauss, xdata=h.centers, ydata=h.frequencies, p0=inits)
print(inits, popt)
x = np.linspace(-v, v, 300)
h += vedo.pyplot.plot(x, gauss(x, *popt), like=h, lw=1, lc="k2")
h["Axes"]["xtitle"].text(f":sigma = {abs(popt[2]):.3f}", font="VictorMono")
Expand Down
2 changes: 1 addition & 1 deletion vedo/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version = '2024.5.1+dev06'
_version = '2024.5.1+dev07'

0 comments on commit 9e68ef2

Please sign in to comment.