Skip to content

Commit

Permalink
Merge pull request #116 from geoscixyz/fix_linear_inversion_app
Browse files Browse the repository at this point in the history
modify style for data plot
  • Loading branch information
sgkang authored Jul 26, 2018
2 parents e905862 + 0b3421f commit 500e2fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions em_examples/LinearInversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,10 @@ def plot_model(
elif i == 2:
if add_noise:
# this is just for visualization of uncertainty
visualization_factor = 1.
ax.errorbar(
x=self.jk, y=self.data,
yerr=self.uncertainty*visualization_factor,
color='k'
yerr=self.uncertainty,
color='k', lw=1
)
ax.plot(self.jk, self.data, 'ko')
else:
Expand Down Expand Up @@ -382,6 +381,11 @@ def plot_inversion(
if run:
axes[0].plot(self.mesh.vectorCCx, self.model[i_plot])
axes[0].set_ylim([-2.5, 2.5])
axes[1].errorbar(
x=self.jk, y=self.data,
yerr=self.uncertainty,
color='k', lw=1
)
axes[1].plot(self.jk, self.data, 'ko')
if run:
axes[1].plot(self.jk, self.pred[i_plot], 'bx')
Expand All @@ -407,7 +411,6 @@ def plot_inversion(
axes[1].plot(self.jk, self.pred[i_iteration], 'bx')
# axes[0].legend(("True", "Pred", ("%ith")%(i_iteration)))
# axes[1].legend(("Observed", "Predicted", ("%ith")%(i_iteration)))
axes[0].legend(("True", "Pred"))
axes[1].legend(("Observed", "Predicted"))

if i_iteration == 0:
Expand Down Expand Up @@ -485,7 +488,7 @@ def interact_plot_model(self):
min=-2, max=2, step=0.05, value=0.2, continuous_update=False, description="m1$_{center}$",
),
dm1 =FloatSlider(
min=0, max=0.5, step=0.05, value=0.2, continuous_update=False, description="m1_{width}",
min=0, max=0.5, step=0.05, value=0.2, continuous_update=False, description="m1$_{width}$",
),
m2_center=FloatSlider(
min=-2, max=2, step=0.05, value=0.75, continuous_update=False, description="m2$_{center}$",
Expand Down
4 changes: 2 additions & 2 deletions em_examples/MarineCSEM1D.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,15 @@ def csem_data_app(
srcloc, rxlocs, depth, res, aniso, frequency,
rx_direction='x'
)
data_ex = csem_layered_earth(
data_ex_bg = csem_layered_earth(
srcloc, rxlocs, depth_bg, res_bg, aniso_bg, frequency_bg,
rx_direction='x'
)
data_hy = csem_layered_earth(
srcloc, rxlocs, depth_bg, res_bg, aniso_bg, frequency_bg,
rx_direction='y', rx_type="magnetic"
)
data_hy = csem_layered_earth(
data_hy_bg = csem_layered_earth(
srcloc, rxlocs, depth_bg, res_bg, aniso_bg, frequency_bg,
rx_direction='y', rx_type="magnetic"
)
Expand Down

0 comments on commit 500e2fc

Please sign in to comment.