Skip to content

Commit fecc72c

Browse files
committed
doc: clarify in the tutorial that bbox and margin works for Cairo only, closes #752
1 parent 16c7379 commit fecc72c

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

doc/source/tutorial.es.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ Hmm, esto no es demasiado bonito hasta ahora. Una adición trivial sería usar l
543543
>>> color_dict = {"m": "blue", "f": "pink"}
544544
>>> g.vs["color"] = [color_dict[gender] for gender in g.vs["gender"]]
545545
>>> ig.plot(g, layout=layout, bbox=(300, 300), margin=20) # Cairo backend
546-
>>> ig.plot(g, layout=layout, bbox=(300, 300), margin=20, target=ax) # matplotlib backend
546+
>>> ig.plot(g, layout=layout, target=ax) # matplotlib backend
547547

548548
Tenga en cuenta que aquí simplemente estamos reutilizando el objeto de diseño anterior, pero también hemos especificado que necesitamos un gráfico más pequeño (300 x 300 píxeles) y un margen mayor alrededor del grafo para que quepan las etiquetas (20 píxeles). El resultado es:
549549

doc/source/tutorial.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,12 @@ from the ``label`` attribute by default and vertex colors are determined by the
705705
>>> color_dict = {"m": "blue", "f": "pink"}
706706
>>> g.vs["color"] = [color_dict[gender] for gender in g.vs["gender"]]
707707
>>> ig.plot(g, layout=layout, bbox=(300, 300), margin=20) # Cairo backend
708-
>>> ig.plot(g, layout=layout, bbox=(300, 300), margin=20, target=ax) # matplotlib backend
708+
>>> ig.plot(g, layout=layout, target=ax) # matplotlib backend
709709

710-
Note that we are simply re-using the previous layout object here, but we also specified
711-
that we need a smaller plot (300 x 300 pixels) and a larger margin around the graph
712-
to fit the labels (20 pixels). The result is:
710+
Note that we are simply re-using the previous layout object here, but for the Cairo backend
711+
we also specified that we need a smaller plot (300 x 300 pixels) and a larger margin around
712+
the graph to fit the labels (20 pixels). These settings would be ignored for the Matplotlib
713+
backend. The result is:
713714

714715
.. figure:: figures/tutorial_social_network_2.png
715716
:alt: The visual representation of our social network - with names and genders
@@ -869,7 +870,8 @@ Keyword argument Purpose
869870
---------------- ----------------------------------------------------------------
870871
``bbox`` The bounding box of the plot. This must be a tuple containing
871872
the desired width and height of the plot. The default plot is
872-
600 pixels wide and 600 pixels high.
873+
600 pixels wide and 600 pixels high. Ignored for the
874+
Matplotlib backend.
873875
---------------- ----------------------------------------------------------------
874876
``layout`` The layout to be used. It can be an instance of
875877
:class:`~layout.Layout`,
@@ -881,7 +883,7 @@ Keyword argument Purpose
881883
``margin`` The top, right, bottom and left margins of the plot in pixels.
882884
This argument must be a list or tuple and its elements will be
883885
re-used if you specify a list or tuple with less than four
884-
elements.
886+
elements. Ignored for the Matplotlib backend.
885887
================ ================================================================
886888

887889
Specifying colors in plots

doc/source/visualisation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Plotting graphs in Jupyter notebooks
177177
|igraph| supports inline plots within a `Jupyter`_ notebook via both the `Cairo`_ and `matplotlib`_ backend. If you are
178178
calling `igraph.plot` from a notebook cell without a `matplotlib`_ axes, the image will be shown inline in the corresponding
179179
output cell. Use the `bbox` argument to scale the image while preserving the size of the vertices, text, and other artists.
180-
For instance, to get a compact plot::
180+
For instance, to get a compact plot (using the Cairo backend only)::
181181

182182
>>> ig.plot(g, bbox=(0, 0, 100, 100))
183183

0 commit comments

Comments
 (0)