Skip to main content

Matplot extension for easy plotting

Project description

lpplot

A user-friendy wrapper for matplotlib.pyplot linear plots.

Table of contents

  1. Introduction
  2. Installation
  3. Usage
  4. Tutorial
  5. Donations
  6. License

Introduction

Customizing matplotlib plots is not always intuitive. Changing grids, labels, pads, etc. often needs searching internet for a time, and probably you will need to repeat these searches after a while. lpplotlib.pyplot is a small project that intends this customization to be simple, and repetitive.

For now, only line2d plots are covered (i.e. plots using the famous matplotlib.pyplot.plotcommand). Yet you may find that even at this level lpplotlib.pyplot can be very helpful!.

Installation

Use the package manager pip to install,

pip install lpplot

Usage

lpplotlib.pyplot is intended to be used in a notebook enviroment, although you can also use the package in any python script. The required imports are

import matplotlib.pyplot as plt
import lpplotlib.pyplot as lpp

A main feature in lpplotlib.pyplot is to collect all plot parameters in an object of the class plot_parameters. Parameters are defined through a key, using the method plot_parameters.set(key, value). Use the method plot_parameters.set() to see all possible parameters for your plot, or plot_parameters.set(keyword) to see the list of parameters including this keyword in its key.

This example shows how to plot a curve with a title:

import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
import lpplotlib.pyplot as lpp

fig,ax=plt.subplots(1,1, figsize=(5,2), frameon=False)

xp=np.linspace(-20,20,40)
yp=np.random.rand(40)

x=np.linspace(-20,20,200)

f = interp1d(xp,yp, kind='quadratic')
y=f(x)

params=lpp.plot_parameters() # initialize params as an instance of class parameters
params.set('title says','Plot example') # set the plot's title

line,axis=lpp.plot(ax,x,y, pars=params)

Tutorial

You will find a notebook in the package distribution with the basic explanations and examples.

Donations

This is a first version of what lpplot can be! In the future it will be desirable to make also simpler plotting in polar corrdinates and, of course, plottnf 2d functions (contours, density, surfaces...).

For this I need time, but also caffeine. Unless you are some kind of wizard, I don't see the way you can help me with time, but you can buy me a coffee if you have found lpplot useful for you!

Buy Me A Coffee

License

MIT License

Copyright (c) 2023 Luis Plaja

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

lpplotlib-0.0.12.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

lpplotlib-0.0.12-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file lpplotlib-0.0.12.tar.gz.

File metadata

  • Download URL: lpplotlib-0.0.12.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for lpplotlib-0.0.12.tar.gz
Algorithm Hash digest
SHA256 2cbb7d727f21bc1ce35135bc9c3c752031cbd0c9d78890bb6e9979409f40b56b
MD5 bc0f67d81fdd15fbdad978cbd0c6ea21
BLAKE2b-256 6cb705bbb19642f3e26a177a3b8ef0a8bbfb663882e26e9f81e7b77839739c8c

See more details on using hashes here.

File details

Details for the file lpplotlib-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: lpplotlib-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for lpplotlib-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 f05add6232736223c45d1f488de5bce91d1f9ab1f73523870a0dc223141fd389
MD5 b964de0953508c443598c8067d0d4141
BLAKE2b-256 0e0aa1632f8cf7ae022c994cd48fd71e3bd3ac8c56cb1e93245dbe9b09c429e3

See more details on using hashes here.

Supported by

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