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


Download files

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

Source Distribution

wraplot-0.1.1.tar.gz (19.1 kB view hashes)

Uploaded Source

Built Distribution

wraplot-0.1.1-py3-none-any.whl (19.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page