Skip to content

Commit

Permalink
docs: recreated plots with new, stacked color bars and added example …
Browse files Browse the repository at this point in the history
…for ax argument
  • Loading branch information
tiuri101 committed Oct 7, 2022
1 parent 6b29827 commit 60bc691
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 2 deletions.
Binary file modified docs/figures/examples/userguide_plotting_1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/examples/userguide_plotting_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/examples/userguide_plotting_3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/examples/userguide_plotting_4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/figures/examples/userguide_plotting_5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion docs/userguide.plotting.rst
Expand Up @@ -71,11 +71,19 @@ hiding all the nodes.

.. image:: figures/examples/userguide_plotting_5.png

The figure can also be customized by using the ``ax`` argument. For instance, here we create a plot with a certain size and DPI count:

.. literalinclude:: /../examples/userguide_plotting.py
:language: python
:lines: 25-26

.. image:: figures/examples/userguide_plotting_5.png

Don't forget to show the plots:

.. literalinclude:: /../examples/userguide_plotting.py
:language: python
:lines: 25
:lines: 28

Plotting Animations
^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 4 additions & 1 deletion examples/userguide_plotting.py
Expand Up @@ -20,6 +20,9 @@
net.plot(nodes=p_reduced, links=f, robust=True, truncate_nodes=True)

diameters = on.get_diameter(net)
net.plot(linkwidth=diameters, links=f, markersize=0)
net.plot(linkwidth=diameters, markersize=0)

fig, ax = plt.subplots(figsize=(12, 9), dpi=250)
net.plot(ax=ax, nodes=p, links=f, robust=True)

plt.show()

0 comments on commit 60bc691

Please sign in to comment.