Commit e5a4f4e3 authored by Philipp Arras's avatar Philipp Arras
Browse files

Tweak plots

parent 46bfc36c
Pipeline #106018 passed with stages
in 20 minutes and 54 seconds
......@@ -77,14 +77,11 @@
``` python
import numpy as np
import nifty8 as ift
import matplotlib.pyplot as plt
# use more realistic screen dpi (default is 72)
plt.rcParams['figure.dpi'] = 166
# conversion factor cm -> inch
cm = 1./2.54
plt.style.use("seaborn-notebook")
```
%% Cell type:markdown id: tags:
#### Implement Propagator
......@@ -176,11 +173,10 @@
# Get signal data and reconstruction data
s_data = HT(sh).val
m_data = HT(m).val
d_data = d.val
plt.figure(figsize=(15*cm,10*cm))
plt.plot(s_data, 'r', label="Signal", linewidth=2)
plt.plot(d_data, 'k.', label="Data")
plt.plot(m_data, 'k', label="Reconstruction",linewidth=2)
plt.title("Reconstruction")
plt.legend()
......@@ -188,11 +184,10 @@
```
%% Cell type:code id: tags:
``` python
plt.figure(figsize=(15*cm,10*cm))
plt.plot(s_data - s_data, 'r', label="Signal", linewidth=2)
plt.plot(d_data - s_data, 'k.', label="Data")
plt.plot(m_data - s_data, 'k', label="Reconstruction",linewidth=2)
plt.axhspan(-noise_amplitude,noise_amplitude, facecolor='0.9', alpha=.5)
plt.title("Residuals")
......@@ -207,11 +202,10 @@
%% Cell type:code id: tags:
``` python
s_power_data = ift.power_analyze(sh).val
m_power_data = ift.power_analyze(m).val
plt.figure(figsize=(15*cm,10*cm))
plt.loglog()
plt.xlim(1, int(N_pixels/2))
ymin = min(m_power_data)
plt.ylim(ymin, 1)
xs = np.arange(1,int(N_pixels/2),.1)
......@@ -305,11 +299,10 @@
```
%% Cell type:code id: tags:
``` python
fig = plt.figure(figsize=(15*cm,10*cm))
plt.axvspan(l, h, facecolor='0.8',alpha=0.5)
plt.fill_between(range(N_pixels), m_data - uncertainty, m_data + uncertainty, facecolor='0.5', alpha=0.5)
plt.plot(s_data, 'r', label="Signal", alpha=1, linewidth=2)
plt.plot(d_data, 'k.', label="Data")
plt.plot(m_data, 'k', label="Reconstruction", linewidth=2)
......@@ -388,11 +381,11 @@
cmap = ['magma', 'inferno', 'plasma', 'viridis'][1]
mi = np.min(s_data)
ma = np.max(s_data)
fig, axes = plt.subplots(1, 2, figsize=(15*cm, 7*cm))
fig, axes = plt.subplots(1, 2)
data = [s_data, d_data]
caption = ["Signal", "Data"]
for ax in axes.flat:
......@@ -409,11 +402,11 @@
``` python
mi = np.min(s_data)
ma = np.max(s_data)
fig, axes = plt.subplots(3, 2, figsize=(15*cm, 22.5*cm))
fig, axes = plt.subplots(3, 2, figsize=(10, 15))
sample = HT(curv.draw_sample(from_inverse=True)+m).val
post_mean = (m_mean + HT(m)).val
data = [s_data, m_data, post_mean, sample, s_data - m_data, uncertainty]
caption = ["Signal", "Reconstruction", "Posterior mean", "Sample", "Residuals", "Uncertainty Map"]
......@@ -435,9 +428,8 @@
``` python
precise = (np.abs(s_data-m_data) < uncertainty)
print("Error within uncertainty map bounds: " + str(np.sum(precise) * 100 / N_pixels**2) + "%")
plt.figure(figsize=(15*cm,10*cm))
plt.imshow(precise.astype(float), cmap="brg")
plt.colorbar()
```
......
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