Ask Your Question

Revision history [back]

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

image description

As you can see, the tight box backgrounf is white while the rest is transparent.

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

image description

As you can see, see if you download the image, the tight box backgrounf is white while the rest is transparent.

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

image descriptionno tight

As you can see if you download the image, the tight box backgrounf background is white while the rest is transparent.transparent, so if you need to use the image in another context, you can also set the transparent to True

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False, transparent=True)

transparent

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

no tight

As you can see if you download the image, the tight box background is white while the rest is transparent, so if you need to use the image in another context, you can also set the transparent to True

G = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False, transparent=True)

transparent

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

no tight

As you can see if you download the image, the tight box background is white while the rest is transparent, so if you need to use the image in another context, you can also set the transparent to True

T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False, transparent=True)

transparent

EDIT Let me provide some more information, here is how i could find the options you were looking for:

First, you should notice that the show method does not return anything, but performs the action of displaying the plot of the graph:

sage: a = T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5))                                                                                                                          Launched png viewer for Graphics object consisting of 6 graphics primitives 
sage: type(a) 
<class 'NoneType'> 
sage: a is None 
True

The documentation of this method for graphs is only about the tools that could display the graph, namely, the available viewers, see:

sage: T.show?

The plot method however does return the plot (as a Python object):

sage: b = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5)) 
sage: type(b) 
<class 'sage.plot.graphics.Graphics'>

If we look at its documentation, the options we will get are about how to transform the graph into a graphics (layout, colors, labels, ...):

sage: T.plot?

Now, this Graphics object can be viewed, but as a generic object (compared to a graph), hence its options will provide informations on showing generic pictures, including its precision (dots per inches), its aspect ratio, tightness of the bounding box, transparency, ...:

sage: b.show?

I agree that the various options about plotting are spread among different methods, and that it is pretty annoying.

Apparently, the tightness of the graph plot is not well computed. You can set fig_tight option to False:

T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False)

no tight

As you can see if you download the image, the tight box background is white while the rest is transparent, so if you need to use the image in another context, you can also set the transparent to True

T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5),vertex_size=800, fig_tight=False, transparent=True)

transparent

EDIT Let me provide some more information, here is how i could find the options you were looking for:

First, you should notice that the show method does not return anything, but performs the action of displaying the plot of the graph:

sage: a = T.show(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5))                                                                                                                          Launched png viewer for Graphics object consisting of 6 graphics primitives 
sage: type(a) 
<class 'NoneType'> 
sage: a is None 
True

The documentation of this method for graphs is only about the tools that could display the graph, namely, the available viewers, see:

sage: T.show?

The plot method however does return the plot of the graph (as a Python object):

sage: b = T.plot(layout='tree',tree_root=3,tree_orientation='down',figsize=(2,1.5)) 
sage: type(b) 
<class 'sage.plot.graphics.Graphics'>

If we look at its documentation, the options we will get are about how to transform the graph into a graphics object (layout, colors, labels, ...):

sage: T.plot?

Now, this Graphics object can be viewed, but as a generic object (compared to a graph), hence its options will provide informations on showing generic pictures, including its precision (dots per inches), its aspect ratio, tightness of the bounding box, transparency, ...:

sage: b.show?

I agree that the various options about plotting are spread among different methods, and that it is pretty annoying.