# Unnecessary large white margin for graph with bezier curve

Compare following visualizations of two simple graphs in Mathematica 11.2:

### K3 Graph[{1 -> 2, 2 -> 3, 3 -> 1}] ### Two-edge multi graph Graph[{1 -> 1, 1 -> 1}]

(try also three-edge multi graph Graph[{1 -> 1, 1 -> 1, 1-> 1}]) : In the second case Mathematica adds unnecessary large margins to all sides. Is there a generic fix for this. I draw many graphs and do not want to adjust this manually.

• noting that PlotRangePadding works with Graph but is ignored in the case of a single-node graph I think this could be labeled as a bug. May 7, 2018 at 13:47

Another work around, adding a dummy vertex at the same coordinate seems to make things happy.

Graph[{1, 2}, {1 -> 1, 1 -> 1, 1 -> 1},
VertexCoordinates -> {{0, 0}, {0, 0}}]


try also:

Graph[{1 -> 1, 1 -> 1, 1 -> 1}, PlotRange -> 0]


With the help from kglr (deleted comment):

Graphics[Show[Graph[{1 -> 1, 1 -> 1}]][]] which works by using Show to convert the graph to a Graphics[] object, and then constructing a new graphic using only the primitives and directives, but none of the options.

In this case PlotRangePadding is the option that causes the extra space, so using something like

Graph[{1 -> 1, 1 -> 1, 1 -> 1}, PlotRange -> 0]


or

Show[Graph[{1 -> 1, 1 -> 1}], PlotRangePadding -> None]


will only affect that particular option.

Right-click on the figure and there is a 'Make standard size' function at the bottom. According to the documentation, there seems to be no way to do it programmatically.

• Thanks for your answer. Do you know how to do this automatically and not using the mouse? May 7, 2018 at 13:16
• No according to the document...
– 梁國淦
May 7, 2018 at 13:17
• This does not do what the OP asks. It resets the figure size. It does not change the plot range or margins. May 7, 2018 at 13:32