plotting improvements
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import colorcet as cc
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from plotapp import PlotApp
|
||||
@@ -104,16 +105,6 @@ def compute_manual():
|
||||
prop.append(spec)
|
||||
z.append(stat["z"])
|
||||
|
||||
# with PlotApp(i=range(len(z))) as app:
|
||||
# o = np.argsort(p.l)
|
||||
# sax = app["spectrum"]
|
||||
# tax = app["field"]
|
||||
|
||||
# @app.update
|
||||
# def draw(i):
|
||||
# sax.set_line_data("spectrum", p.l[o], sc.abs2(prop[i][o]))
|
||||
# tax.set_line_data("field", p.t, sc.abs2(np.fft.ifft(prop[i])))
|
||||
|
||||
|
||||
def compute_auto():
|
||||
sc.compute(params, True, "examples/dudley2006")
|
||||
@@ -122,11 +113,10 @@ def compute_auto():
|
||||
def plot():
|
||||
prop = sc.propagation("examples/dudley_manual.zip")
|
||||
newprop = sc.propagation("examples/dudley2006.zip")
|
||||
wl_r = sc.PlotRange(450, 2500, "nm")
|
||||
fig, (top, bot) = plt.subplots(2, 2)
|
||||
z = np.linspace(0, prop.parameters.length, len(prop))
|
||||
sc.plotting.summary_plot(prop[:], z, axes=top, wl_range=wl_r)
|
||||
sc.plotting.summary_plot(newprop[:], newprop.parameters.z_targets, axes=bot, wl_range=wl_r)
|
||||
sc.plotting.summary_plot(prop[:], z, axes=top)
|
||||
sc.plotting.summary_plot(newprop[:], newprop.parameters.z_targets, axes=bot)
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user