Skip to content

Commit c982502

Browse files
reformat transforms example
1 parent 6606e6d commit c982502

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/source/examples/transforms_example.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ This example will demonstrate how to use the functions in the
1010

1111
1) Converting from ``q`` to ``2theta`` or ``d``:
1212
If you have a 1D ``q``-array, you can use the ``q_to_tth`` and ``q_to_d`` functions
13-
to convert it to ``2theta`` or ``d``. ::
13+
to convert it to ``2theta`` or ``d``.
14+
15+
.. code-block:: python
1416
1517
# Example: convert q to 2theta
1618
from diffpy.utils.transforms import q_to_tth
@@ -24,7 +26,9 @@ This example will demonstrate how to use the functions in the
2426
d = q_to_d(q)
2527
2628
(2) Converting from ``2theta`` to ``q`` or ``d``:
27-
For a 1D ``2theta`` array, you can convert it to ``q`` or ``d`` in a similar way. ::
29+
For a 1D ``2theta`` array, you can convert it to ``q`` or ``d`` in a similar way.
30+
31+
.. code-block:: python
2832
2933
# Example: convert 2theta to q
3034
from diffpy.utils.transforms import tth_to_q
@@ -39,7 +43,9 @@ This example will demonstrate how to use the functions in the
3943
d = tth_to_d(tth, wavelength)
4044
4145
(3) Converting from ``d`` to ``q`` or ``2theta``:
42-
For a 1D ``d`` array, you can convert it to ``q`` or ``2theta``. ::
46+
For a 1D ``d`` array, you can convert it to ``q`` or ``2theta``.
47+
48+
.. code-block:: python
4349
4450
# Example: convert d to q
4551
from diffpy.utils.transforms import d_to_q

0 commit comments

Comments
 (0)