Skip to main content

A simple python wrapper of matplotlib

Project description

wraplot

A simple pythonic matplotlib wrapper: plot, subplot and animate with ease.

Installation

git clone git@github.com:LucaMoschella/wraplot.git
cd wraplot
poetry install 

Sample usage

Spy

spyplot = Spy()
spyobj = Spy.Object(matrix=dense_matrix > 0.5,
                    axis_visibility='off',
                    markersize=4)
o = spyplot(spyobj)

Imagesc

spyplot = Spy()
spyobj = Spy.Object(matrix=dense_matrix > 0.5,
                    axis_visibility='off',
                    markersize=4)
o = spyplot(spyobj)

PlotCloud

cloudplot = PlotCloud2D()
cloudobj = PlotCloud2D.Object(points=points,
                              axis_visibility='off',
                              xlim=[0, 1],
                              ylim=[0, 1],
                              markersize=500)
o = cloudplot(cloudobj, outfile="sample/cloudplot.png")

Subplotting

subplotter = Subplotter()
o = subplotter(objs=[[spyobj, cloudobj],
                     [imagescobj, spyobj]],
               plot_functions=[[spyplot, cloudplot],
                               [imagescplot, spyplot]],
               outfile="sample/subplot.png")

Animation

animator = Animator()
for i in range(50):
    dense_matrix = dense_matrix @ dense_matrix
    o = imagescplot(Imagesc.Object(matrix=np.random.rand(100, 100).astype(np.float)))
    animator.add_figure(o)
animator.save("sample/video.mp4", fps=15)

Live sample

streamlit run sample/demo

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for wraplot, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size wraplot-0.1.1-py3-none-any.whl (19.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size wraplot-0.1.1.tar.gz (19.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page