Code Monkey home page Code Monkey logo

Comments (3)

takluyver avatar takluyver commented on August 25, 2024

I think that fix sounds reasonable if you want to send a PR. We don't have any good option to compare PDFs, unless nbdime can do that now (@vidartf?).

from nbval.

vidartf avatar vidartf commented on August 25, 2024

Jupyterlab is getting a PDF renderer, so nbdime should be able to display that when it propagates down. However, it is not currently possible as far as I know, no.

from nbval.

chrisjsewell avatar chrisjsewell commented on August 25, 2024

Yeh will do. I think, as I've seen discussed a bit in the other issues here, comparing images/pdf out of matplotlib is probably not going to be robust enough anyway. To add my 2 cents, its not the cleanest thing to do with matplotlib, but a model-view type approach could be a simpler compromise:

from IPython.display import display
import matplotlib.pyplot as plt
import io
def show_fig(model):
    file_obj = io.BytesIO()
    plt.savefig(file_obj, format='png')
    plt.close()
    display({'image/png':file_obj.getvalue(),
                 'application/json':model}, raw=True)

x = [1, 2]
y = [3, 4]
plt.plot(x, y)
show_fig({'x':x, 'y':y})

Then just compare the json

from nbval.

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.