Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • graph-tool graph-tool
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 47
    • Issues 47
    • 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 mailing list at https://graph-tool.skewed.de/mailing
(If unsure, use the mailing list first.)



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
  • #651
Closed
Open
Created Apr 20, 2020 by Lex Fridman@lexfridman

Choppy video of a mobile network

I am creating a video of a mobile network (graph). For this case, they are following a simple mobility model: everyone moves right a small amount at every time step. Each image is written to file and loaded back in and written to video (via OpenCV).

As far as I can tell the layout is turned off, but their movement is strangely choppy, plus their y-position changes a bit too. The resulting video of 1,000 steps is attached.

The drawing code for one frame is as follows:

gt.graph_draw(g,
              g.vp.locs, # i thought this enforces node position & turns off layout
              vertex_size = 10,
              vertex_pen_width = 0.8, # default is 0.8
              vertex_color = color['black'], # vertex stroke color
              vertex_fill_color = color['red'],
              edge_color = color['white'],
              edge_pen_width = 0.8, # default is 1
              vertex_anchor = 0,
              bg_color = color['black'],
              output_size = [iw, ih],
              adjust_aspect = False,
              output = img_out_path)
img = cm.imread(img_out_path) # this is my image reading function

graph.mkv

In addition, if I try to set fit_view = False to test if that fixes things I get the following error:

File "/usr/lib/python3/dist-packages/graph_tool/draw/cairo_draw.py", line 1146, in graph_draw
    x, y, zoom = x, y, 1
UnboundLocalError: local variable 'x' referenced before assignment
Edited Apr 20, 2020 by Lex Fridman
Assignee
Assign to
Time tracking