Skip to content

Vertex size scaling is broken, it is not resolution-independent #722

@szhorvat

Description

@szhorvat

Describe the bug

When plotting graphs, the size of vertices should be independent of the resolution.

In short, the vertex sizes should be independent of the output format and of the output resolution.

To reproduce

Method 1:

from igraph import Graph, plot
g = Graph.Lattice([3,3])
plot(g, backend='matplotlib')

Now change the resolution and plot again:

import matplotlib as mpl
mpl.rcParams['figure.dpi'] = 300
plot(g, backend='matplotlib')

Notice that the thickness of edges stays constant (they are just rendered at a higher resolution), but the size of vertices changes.

Method 2:

In a Jupyter notebook, set:

%matplotlib inline

Now plot, plot(g, backend='matplotlib')

Then set

%config InlineBackend.figure_format = 'retina'

and plot again.

image

Sizes in an SVG are different again.

image

Version information

0.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions