Skip to content

Commit 405ec1d

Browse files
authored
fixes notebook resolution examples (#206)
1 parent 065c527 commit 405ec1d

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

ctaplot/plots/plots.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ def plot_impact_point_heatmap(reco_x, reco_y, ax=None, outfile=None, **kwargs):
279279
outfile: string
280280
path to the output file. If None, the figure is not saved.
281281
"""
282-
282+
from matplotlib import colormaps
283283
ax = plt.gca() if ax is None else ax
284284

285285
unit = reco_x.unit
286286

287287
kwargs.setdefault('norm', LogNorm())
288-
kwargs.setdefault('cmap', plt.cm.get_cmap('PuBu'))
288+
kwargs.setdefault('cmap', colormaps['PuBu'])
289289
kwargs.setdefault('bins', 50)
290290
h = ax.hist2d(reco_x.to_value(unit), reco_y.to_value(unit), **kwargs)
291291
cb = plt.colorbar(h[3], ax=ax)

examples/notebooks/resolution_examples.ipynb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,21 @@
9595
"outputs": [],
9696
"source": [
9797
"fig, axes = plt.subplots(1, 2, figsize=(20,5))\n",
98-
"ctaplot.plot_theta2(reco_alt, reco_az, simu_alt, simu_az, bins=40, ax=axes[0])\n",
99-
"ctaplot.plot_angular_resolution_per_energy(reco_alt, reco_az, simu_alt, simu_az, simu_energy, ax=axes[1]) \n",
98+
"ctaplot.plot_theta2(simu_alt, reco_alt, simu_az, reco_az, bins=40, ax=axes[0])\n",
99+
"ctaplot.plot_angular_resolution_per_energy(simu_alt, reco_alt, simu_az, reco_az, simu_energy, ax=axes[1]) \n",
100+
"ctaplot.plot_angular_resolution_cta_requirement('south', ax=axes[1], color='black')\n",
101+
"axes[1].legend();\n",
102+
"plt.show()"
103+
]
104+
},
105+
{
106+
"cell_type": "code",
107+
"execution_count": null,
108+
"metadata": {},
109+
"outputs": [],
110+
"source": [
111+
"reco_az, , simu_az, bins=40, ax=axes[0])\n",
112+
"ctaplot.plot_angular_resolution_per_energy(simu_alt, reco_alt, simu_az, reco_az, simu_energy, ax=axes[1]) \n",
100113
"ctaplot.plot_angular_resolution_cta_requirement('south', ax=axes[1], color='black')\n",
101114
"axes[1].legend();\n",
102115
"plt.show()"
@@ -127,7 +140,7 @@
127140
" bias_correction=True,\n",
128141
" ax=axes[0])\n",
129142
"\n",
130-
"ctaplot.plot_angular_resolution_per_energy(reco_alt, reco_az, simu_alt, simu_az, simu_energy,\n",
143+
"ctaplot.plot_angular_resolution_per_energy(simu_alt, reco_alt, simu_az, reco_az, simu_energy,\n",
131144
" bias_correction=True,\n",
132145
" ax=axes[1])\n",
133146
"\n",

0 commit comments

Comments
 (0)