Skip to content

Commit

Permalink
Add the example to api doc
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxiLi committed Jan 9, 2022
1 parent 8b7ae35 commit cc3f179
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions qutip/visualization.py
Expand Up @@ -226,6 +226,21 @@ def hinton(rho, xlabels=None, ylabels=None, title=None, ax=None, cmap=None,
ValueError
Input argument is not a quantum object.
Examples
--------
>>> import qutip
>>>
>>> dm = qutip.rand_dm(4)
>>> fig, ax = qutip.hinton(dm)
>>> fig.show()
>>>
>>> qutip.settings.colorblind_safe = True
>>> fig, ax = qutip.hinton(dm, color_style="threshold")
>>> fig.show()
>>> qutip.settings.colorblind_safe = False
>>>
>>> fig, ax = qutip.hinton(dm, color_style="phase")
>>> fig.show()
"""

# Apply default colormaps.
Expand Down

0 comments on commit cc3f179

Please sign in to comment.