i use igraph in linux ,it cannot display Chinese labels when i use function igraph.plot(g)
igraph’s support for non-Latin characters depends on the underlying plotting backend. The default is Cairo, and I’m not sure whether Cairo is sophisticated enough to deal with it; chances are that its default font does not support Chinese characters.
Recent versions of python-igraph
support Matplotlib as an alternative plotting backend; basically you need to construct a Matplotlib Axes
object and then call igraph.plot(g, target=axes)
, which will in turn use Matplotlib to draw the graph on the given Axes
using Matplotlib. I believe that Matplotlib has better support for non-Latin characters so I would try that first if I were you.