Adjust plot range for sed fitting tutorial
"for d in datasets:\n",
" d.data.plot(label=d.name, **kwargs)\n",
"\n",
- "pwl.plot(energy_bounds=[1e-4, 1e2] * u.TeV, color=\"k\", **kwargs)\n",
- "pwl.plot_error(energy_bounds=[1e-4, 1e2] * u.TeV, **kwargs)\n",
+ "energy_bounds = [1e-4, 1e2] * u.TeV\n",
+ "pwl.plot(energy_bounds=energy_bounds, color=\"k\", **kwargs)\n",
+ "pwl.plot_error(energy_bounds=energy_bounds, **kwargs)\n",
"ax.set_ylim(1e-13, 1e-11);\n",
+ "ax.set_xlim(energy_bounds);\n",
"ax.legend()"
]
},
"source": [
"datasets.models = model\n",
"result_ecpl = fitter.run(datasets=datasets)\n",
- "print(model.to_dict())"
+ "print(model)"
]
},
{
"for d in datasets:\n",
" d.data.plot(label=d.name,**kwargs)\n",
"\n",
- "ecpl.plot(energy_bounds=[1e-4, 1e2] * u.TeV, color=\"k\", **kwargs)\n",
- "ecpl.plot_error(energy_bounds=[1e-4, 1e2] * u.TeV, **kwargs)\n",
+ "ecpl.plot(energy_bounds=energy_bounds, color=\"k\", **kwargs)\n",
+ "ecpl.plot_error(energy_bounds=energy_bounds, **kwargs)\n",
"ax.set_ylim(1e-13, 1e-11);\n",
+ "ax.set_xlim(energy_bounds)\n",
"ax.legend()"
]
},
"for d in datasets:\n",
" d.data.plot(label=d.name, **kwargs)\n",
"\n",
- "log_parabola.plot(energy_bounds=[1e-4, 1e2] * u.TeV, color=\"k\", **kwargs)\n",
- "log_parabola.plot_error(energy_bounds=[1e-4, 1e2] * u.TeV, **kwargs)\n",
+ "log_parabola.plot(energy_bounds=energy_bounds, color=\"k\", **kwargs)\n",
+ "log_parabola.plot_error(energy_bounds=energy_bounds, **kwargs)\n",
"ax.set_ylim(1e-13, 1e-11);\n",
+ "ax.set_xlim(energy_bounds)\n",
"ax.legend()"
]
},
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.7.0"
+ "version": "3.9.0"
}
},
"nbformat": 4,
