Skip to content

Commit

Permalink
doc: clarify specification of same color for all vertices when plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
ntamas committed Feb 13, 2024
1 parent beefef0 commit a95e22f
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 4 deletions.
109 changes: 109 additions & 0 deletions doc/source/sg_execution_times.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

:orphan:

.. _sphx_glr_sg_execution_times:


Computation times
=================
**00:10.013** total execution time for 25 files **from all galleries**:

.. container::

.. raw:: html

<style scoped>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.13.6/css/dataTables.bootstrap5.min.css" rel="stylesheet" />
</style>
<script src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.13.6/js/dataTables.bootstrap5.min.js"></script>
<script type="text/javascript" class="init">
$(document).ready( function () {
$('table.sg-datatable').DataTable({order: [[1, 'desc']]});
} );
</script>

.. list-table::
:header-rows: 1
:class: table table-striped sg-datatable

* - Example
- Time
- Mem (MB)
* - :ref:`sphx_glr_tutorials_visualize_cliques.py` (``../examples_sphinx-gallery/visualize_cliques.py``)
- 00:02.970
- 0.0
* - :ref:`sphx_glr_tutorials_ring_animation.py` (``../examples_sphinx-gallery/ring_animation.py``)
- 00:01.287
- 0.0
* - :ref:`sphx_glr_tutorials_cluster_contraction.py` (``../examples_sphinx-gallery/cluster_contraction.py``)
- 00:00.759
- 0.0
* - :ref:`sphx_glr_tutorials_betweenness.py` (``../examples_sphinx-gallery/betweenness.py``)
- 00:00.735
- 0.0
* - :ref:`sphx_glr_tutorials_visual_style.py` (``../examples_sphinx-gallery/visual_style.py``)
- 00:00.711
- 0.0
* - :ref:`sphx_glr_tutorials_delaunay-triangulation.py` (``../examples_sphinx-gallery/delaunay-triangulation.py``)
- 00:00.504
- 0.0
* - :ref:`sphx_glr_tutorials_configuration.py` (``../examples_sphinx-gallery/configuration.py``)
- 00:00.416
- 0.0
* - :ref:`sphx_glr_tutorials_online_user_actions.py` (``../examples_sphinx-gallery/online_user_actions.py``)
- 00:00.332
- 0.0
* - :ref:`sphx_glr_tutorials_erdos_renyi.py` (``../examples_sphinx-gallery/erdos_renyi.py``)
- 00:00.313
- 0.0
* - :ref:`sphx_glr_tutorials_connected_components.py` (``../examples_sphinx-gallery/connected_components.py``)
- 00:00.216
- 0.0
* - :ref:`sphx_glr_tutorials_complement.py` (``../examples_sphinx-gallery/complement.py``)
- 00:00.201
- 0.0
* - :ref:`sphx_glr_tutorials_generate_dag.py` (``../examples_sphinx-gallery/generate_dag.py``)
- 00:00.194
- 0.0
* - :ref:`sphx_glr_tutorials_visualize_communities.py` (``../examples_sphinx-gallery/visualize_communities.py``)
- 00:00.176
- 0.0
* - :ref:`sphx_glr_tutorials_bridges.py` (``../examples_sphinx-gallery/bridges.py``)
- 00:00.169
- 0.0
* - :ref:`sphx_glr_tutorials_spanning_trees.py` (``../examples_sphinx-gallery/spanning_trees.py``)
- 00:00.161
- 0.0
* - :ref:`sphx_glr_tutorials_isomorphism.py` (``../examples_sphinx-gallery/isomorphism.py``)
- 00:00.153
- 0.0
* - :ref:`sphx_glr_tutorials_quickstart.py` (``../examples_sphinx-gallery/quickstart.py``)
- 00:00.142
- 0.0
* - :ref:`sphx_glr_tutorials_minimum_spanning_trees.py` (``../examples_sphinx-gallery/minimum_spanning_trees.py``)
- 00:00.137
- 0.0
* - :ref:`sphx_glr_tutorials_simplify.py` (``../examples_sphinx-gallery/simplify.py``)
- 00:00.079
- 0.0
* - :ref:`sphx_glr_tutorials_bipartite_matching_maxflow.py` (``../examples_sphinx-gallery/bipartite_matching_maxflow.py``)
- 00:00.073
- 0.0
* - :ref:`sphx_glr_tutorials_articulation_points.py` (``../examples_sphinx-gallery/articulation_points.py``)
- 00:00.067
- 0.0
* - :ref:`sphx_glr_tutorials_topological_sort.py` (``../examples_sphinx-gallery/topological_sort.py``)
- 00:00.058
- 0.0
* - :ref:`sphx_glr_tutorials_bipartite_matching.py` (``../examples_sphinx-gallery/bipartite_matching.py``)
- 00:00.058
- 0.0
* - :ref:`sphx_glr_tutorials_shortest_path_visualisation.py` (``../examples_sphinx-gallery/shortest_path_visualisation.py``)
- 00:00.052
- 0.0
* - :ref:`sphx_glr_tutorials_maxflow.py` (``../examples_sphinx-gallery/maxflow.py``)
- 00:00.052
- 0.0
2 changes: 1 addition & 1 deletion doc/source/tutorial.es.rst
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Especificación de colores en los gráficos

***Nombres de colores X11***

Consulta la `lista de nombres de colores X11 <https://en.wikipedia.org/wiki/X11_color_names>`_ en Wikipedia para ver la lista completa. Los nombres de los colores no distinguen entre mayúsculas y minúsculas en |igraph|, por lo que "DarkBLue" puede escribirse también como "darkblue".
Consulta la `lista de nombres de colores X11 <https://en.wikipedia.org/wiki/X11_color_names>`_ en Wikipedia para ver la lista completa. Los nombres de los colores no distinguen entre mayúsculas y minúsculas en |igraph|, por lo que ``"DarkBLue"`` puede escribirse también como ``"darkblue"``.

***Especificación del color en la sintaxis CSS***

Expand Down
23 changes: 20 additions & 3 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -895,9 +895,9 @@ color (e.g., edge, vertex or label colors in the respective attributes):
X11 color names
See the `list of X11 color names <https://en.wikipedia.org/wiki/X11_color_names>`_
in Wikipedia for the complete list. Alternatively you can see the
keys of the igraph.drawing.colors.known_colors dictionary. Color
names are case insensitive in igraph so "DarkBlue" can be written as
"darkblue" as well.
keys of the ``igraph.drawing.colors.known_colors`` dictionary. Color
names are case insensitive in igraph so ``"DarkBlue"`` can be written as
``"darkblue"`` as well.

Color specification in CSS syntax
This is a string according to one of the following formats (where *R*, *G* and
Expand All @@ -913,6 +913,23 @@ Color specification in CSS syntax
Lists or tuples of RGB values in the range 0-1
Example: ``(1.0, 0.5, 0)`` or ``[1.0, 0.5, 0]``.

Note that when specifying the same color for all vertices or edges, you can use
a string as-is but not the tuple or list syntax as tuples or lists would be
interpreted as if the *items* in the tuple are for individual vertices or
edges. So, this would work::

>>> ig.plot(g, vertex_color="green")

But this would not, as it would treat the items in the tuple as palette indices
for the first, second and third vertoces::

>>> ig.plot(g, vertex_color=(1, 0, 0))

In this latter case, you need to expand the color specification for each vertex
explicitly::

>>> ig.plot(g, vertex_color=[(1, 0, 0)] * g.vcount())


Saving plots
^^^^^^^^^^^^
Expand Down

0 comments on commit a95e22f

Please sign in to comment.