Giter VIP home page Giter VIP logo

Comments (4)

theengineear avatar theengineear commented on May 5, 2024

Alright, so, there's no simple way to tell from mpl upon figure opening if the figure is going to need to be bigger. However, the reason you see the long annotation is b.c. you're using mpl in IPython! Try this:
http://nbviewer.ipython.org/gist/theengineear/61fc798db51672299785

You'll note that the GUI that opens clips off the text just like Plotly would, and that's because that's just where the figure ends!

This may not be a real issue. I might suggest we throw a warning when an annotation runs over the edge of a plot in matplotylib.

What do you think?

from plotly.py.

etpinard avatar etpinard commented on May 5, 2024

Oh wow! I did not see that coming!

Randal's figure rendered with .show() yields:

screenshot from 2014-07-04 15 25 08

But, with plt.savefig() and within the notebook, the figure's margins are adjusted.

I suspect that plt.savefig() has no affect on the mpl object.

from plotly.py.

etpinard avatar etpinard commented on May 5, 2024

I think issuing a warning is the right call.

The warning should make a reference to the Margin object and the Annotation object(s) that caused the issue.

Moreover, maybe we include a few words about how plt.savefig() and IPython NBs adjust the margins so that matplotlylib user can correct their mpl code accordingly.

from plotly.py.

theengineear avatar theengineear commented on May 5, 2024

I don't know if the NB actually adjusts anything, the margins are still the same, it's just that the background of the notebook is white, so there's extra canvas to draw on perhaps? i'm not sure how mpl draws in a NB. Nevermind, yeah IPython definitely adjust accordingly.

Yeah, i'll just work on a warning.

from plotly.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.