You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with making the plot from a mprof run legible. This is how mine looks:
I'd like to be able to stretch/zoom the plot - make it much larger, so the function markers don't overlap.
I have tried changing matplotlib's savefig.dpi and figure.figsize values, and both result in the graph being scaled, rather than the canvas being larger and the line/function markers becoming thinner and separated, and the text smaller.
I tried a really wide figure using these settings in my matplotlibrc:
I see. What you would like is to have the legend outside the plot, right?
Not quite :) I'd like to be able to make the graph much bigger, so that all the function bracketing between 150-250 seconds on the graph don't overlap, and I can make out what's going on. I don't mind if the graph is 10000px wide to do this.
Currently if I change the graph size, it scales everything: line thickness, size of function bracket, size of text. I'd like the canvas size to be independent of these features, so I can "zoom in" on the PNG and see what's going on.
Brackets are drawn as lines and they scale like the axis instead of having a constant size. There must be a way of doing the latter but I haven't spent enough time to find it. A stop gap would be to pass the aspect ratio as a parameter to mprof.
Activity
fabianp commentedon Oct 23, 2015
Hi!
The code that creates the figure is here:
https://github.com/fabianp/memory_profiler/blob/master/mprof#L454
Right now the figsize is hard-coded but it would totally make sense to be able to set it via a command line option. Would that solve your problem?
pbowyer commentedon Oct 23, 2015
I gave it a test by doubling the width on Line 454 - unfortunately it stretches the markers:

fabianp commentedon Oct 23, 2015
I see. What you would like is to have the legend outside the plot, right?
fabianp commentedon Oct 23, 2015
I pushed a fix (fdab5be) that moves the legend out. I see things like this, tell me if that fixes it for you.
pbowyer commentedon Oct 23, 2015
Not quite :) I'd like to be able to make the graph much bigger, so that all the function bracketing between 150-250 seconds on the graph don't overlap, and I can make out what's going on. I don't mind if the graph is 10000px wide to do this.
Currently if I change the graph size, it scales everything: line thickness, size of function bracket, size of text. I'd like the canvas size to be independent of these features, so I can "zoom in" on the PNG and see what's going on.
fabianp commentedon Oct 23, 2015
I see. Unfortunately my matplotlib knowledge is limited ... do you have an idea of what matplotlib code could give you what you are looking for?
pbowyer commentedon Oct 23, 2015
No, my knowledge is limited too - I will try and find out.
fabianp commentedon Oct 23, 2015
Cool, thanks. If you find a solution, please tell me :-)
pgervais commentedon Oct 25, 2015
@pbowyer: what you want is change the height_ratio here: https://github.com/fabianp/memory_profiler/blob/master/mprof#L258
Brackets are drawn as lines and they scale like the axis instead of having a constant size. There must be a way of doing the latter but I haven't spent enough time to find it. A stop gap would be to pass the aspect ratio as a parameter to
mprof.Hope this help...
pgervais commentedon Oct 25, 2015
Ahem.
height_ratiodetermines the height of the bracket relative to the vertical axis. But my point this holds.astrojuanlu commentedon Oct 19, 2017
Unsure whether this can be closed?
astrojuanlu commentedon May 17, 2018
I assume #105 addressed this, so I'm closing.