Git Product home page Git Product logo

xpyplot's Introduction

xpyplot

A small utility library that captures calls to matplotlib's pyplot interface and saves the data being plotted together with the plotting commands. In this way it allows easy re-plotting when the user's otherwise omitted to keep proper record of the data.

For example:

import xpyplot as plt
import numpy

x=numpy.array([1,2,3])
plt.plot(x, x*2+1)
plt.savefig("testsample.png")

will produce the expected plot `testsample.png but also a script testsample.script.py`:

plot1=numpy.load(open("testsample.plot1.npy", "rb"))
plot0=numpy.load(open("testsample.plot0.npy", "rb"))
pyplot.plot(*[plot0, plot1, ], **{}, scalex=True, scaley=True, data=None, )
pyplot.savefig(fname="testsample.png", )

and two numpy array files `testsample.plot1.npy and testsample.plot0.npy`. Running the generated script will reproduce the original plot.

See also

There is a short write-up at: http://www.bnikolic.co.uk/blog/python/2020/01/06/xpyplot.html

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.