Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 48
    • Issues 48
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Please use the issue tracker only to report bugs (i.e. errors in the library that need to be fixed) or feature requests.

For questions about how to compile, install or use the library, please use instead the web forum at https://forum.skewed.de/c/graph-tool.


(If unsure, use the forum first.)


IMPORTANT: When opening new issues, please choose the BUG template from the drop-down menu, and fill out the required information.

  • Tiago Peixoto
  • graph-toolgraph-tool
  • Issues
  • #461
Closed
Open
Issue created Apr 29, 2018 by Grall Arnaud@folkvir

Matplotlib legends and title example using graph-tool

Hi, Firstly, Thank you for your work.

I am using your project to graph a big network. And now I want to add legends and titles.

Is it possible to post an example of how to do this?

For the moment I have a piece of code which is not working. And I cant find anything clear on how to do this in the documentation. This issue is more a request for a more accurate description of the documentation in this specific domain.

And it could be very usefull for people googling this.

# cairo backend is enabled
<...>
fig, ax = plt.subplots()
    width = 1000
    height = 1000

    ax.set_title('A title')

    graph_draw(g,
        vertex_text=g.vertex_index,
        #groups=g.vertex_properties["type"],
        vertex_fill_color=g.vp.color,
        vertex_font_size=13,
        output_size=[width, height],
        mplfig=ax, # this var is here
        output=filename+'-'+type+"-graph.png")

    plt.savefig(filename+'-'+type+"-graph.png")
Assignee
Assign to
Time tracking