Fix formating of spectral model docs examples
@@ -505,6 +505,8 @@ class PowerLaw(SpectralModel):
--------
This is how to plot the default `PowerLaw` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import PowerLaw
@@ -707,6 +709,8 @@ class PowerLaw2(SpectralModel):
--------
This is how to plot the default `PowerLaw2` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import PowerLaw2
@@ -826,6 +830,8 @@ class ExponentialCutoffPowerLaw(SpectralModel):
--------
This is how to plot the default `ExponentialCutoffPowerLaw` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import ExponentialCutoffPowerLaw
@@ -920,6 +926,8 @@ class ExponentialCutoffPowerLaw3FGL(SpectralModel):
--------
This is how to plot the default `ExponentialCutoffPowerLaw3FGL` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import ExponentialCutoffPowerLaw3FGL
@@ -976,6 +984,8 @@ class PLSuperExpCutoff3FGL(SpectralModel):
--------
This is how to plot the default `PLSuperExpCutoff3FGL` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import PLSuperExpCutoff3FGL
@@ -1033,6 +1043,8 @@ class LogParabola(SpectralModel):
--------
This is how to plot the default `LogParabola` model:
+ .. code::
+
from astropy import units as u
from gammapy.spectrum.models import LogParabola
