Skip to content

Can the plot be scaled to show fine detail? #103

Closed

Description

@pbowyer

I have an issue with making the plot from a mprof run legible. This is how mine looks:
plot

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:

figure.figsize   : 200, 10    # figure size in inches
savefig.dpi      : 100

but it still plotted at 1400x600.

Do you know a way to make this possible?

Activity

  1. fabianp commented on Oct 23, 2015

    @fabianp
    Collaborator

    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?

  2. pbowyer commented on Oct 23, 2015

    @pbowyer
    ContributorAuthor

    I gave it a test by doubling the width on Line 454 - unfortunately it stretches the markers:
    plot

  3. fabianp commented on Oct 23, 2015

    @fabianp
    Collaborator

    I see. What you would like is to have the legend outside the plot, right?

  4. fabianp commented on Oct 23, 2015

    @fabianp
    Collaborator

    I pushed a fix (fdab5be) that moves the legend out. I see things like this, tell me if that fixes it for you.

    figure_1

  5. pbowyer commented on Oct 23, 2015

    @pbowyer
    ContributorAuthor

    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.

  6. fabianp commented on Oct 23, 2015

    @fabianp
    Collaborator

    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?

  7. pbowyer commented on Oct 23, 2015

    @pbowyer
    ContributorAuthor

    No, my knowledge is limited too - I will try and find out.

  8. fabianp commented on Oct 23, 2015

    @fabianp
    Collaborator

    Cool, thanks. If you find a solution, please tell me :-)

  9. pgervais commented on Oct 25, 2015

    @pgervais
    Collaborator

    @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...

  10. pgervais commented on Oct 25, 2015

    @pgervais
    Collaborator

    Ahem. height_ratio determines the height of the bracket relative to the vertical axis. But my point this holds.

  11. astrojuanlu commented on Oct 19, 2017

    @astrojuanlu
    Collaborator

    Unsure whether this can be closed?

  12. astrojuanlu commented on May 17, 2018

    @astrojuanlu
    Collaborator

    I assume #105 addressed this, so I'm closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions