pycallgraph2 icon indicating copy to clipboard operation
pycallgraph2 copied to clipboard

Is it possible to change the size of the output image?

Open Mockapapella opened this issue 5 years ago • 2 comments

The graph that I created output an image of size 32767x3822 pixels. The words however are still blurry even when zoomed in all the way. I tried looking through the files to see if I could find something relating to output size but couldn't find anything.

Mockapapella avatar Jul 16 '19 19:07 Mockapapella

Graphviz provides the size option to specify the maximum size of the output, so that could be implemented in the graphviz output script. You'll notice a few attributes such as --font-name are set via command line arguments to graphviz. On my "to-do" list is allowing the user to easily specify arbitrary arguments for graphviz such as the size attribute.

In the meantime, I would recommend outputting to a .dot file instead of a .png file. Call pycallgraph2 from within your script and specify the output type within the the GraphVizOutput:

graphviz = GraphvizOutput()
graphviz.output_type = 'dot'
graphviz.output_file = 'pycallgraph.dot'

with PyCallGraph(output=graphviz):
    #  code_to_profile()

Then call dot on that file with your preferred ratio and/or size. Here is a good guide with details on page 12.

daneads avatar Jul 16 '19 20:07 daneads

I would suggest to use a dot viewer, such as xdot on linux. Besides avoiding the problems with large raster images, it also might support some searching, hightlighting, navigating through the hierarchy, etc.

martinsmid avatar Oct 03 '19 10:10 martinsmid