igraph / python-igraph

Python interface for igraph
GNU General Public License v2.0
1.28k stars 247 forks source link

`vertex_label_color` does not work in matplotlib backend #709

Closed pournaki closed 11 months ago

pournaki commented 1 year ago

Describe the bug When plotting a graph inside a matplotlib axis, the vertex_label_color stays black no matter what.

To reproduce

import igraph as ig
import matplotlib.pyplot as plt

G = ig.Graph.Erdos_Renyi(10,0.1)
G.vs['label'] = range(10)

fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ig.plot(G,
        target=ax,
        vertex_size=.4,
        vertex_color='black',
        vertex_label_color='white',
       )
plt.show()

Version information '0.10.8', installed through pypi

iosonofabio commented 1 year ago

Could you please try the develop branch? Lots of mpl change there

pournaki commented 11 months ago

Thanks for your answer. I just uninstalled igraph and reinstalled it using

pip install git+https://github.com/igraph/python-igraph@develop

Running the above code produces significantly smaller vertices, but the label color is still black instead of white.

iosonofabio commented 11 months ago

Ok I'll take a look today

iosonofabio commented 11 months ago

I committed a fix in #717 which was straightforward. Should be there in the next version as soon as the PR is merged.

Thank you for reporting!

pournaki commented 11 months ago

Thank you very much for fixing it! Looking forward to the new version.