Coder Social home page Coder Social logo

blume's Introduction

Blume

Better Looking Universal Matplotlib Engine.

Blume provides a replacement for the matplotlib table module.

Displaying data as tables in matplotlib.

It fixes a number of issues with the existing table and has:

  • more reliable code for automatically setting the font size to make best use of the space available.
  • Padding between text and the cell edges which works better across a range of text sizes.
  • First row of cell data is now row 0 regardless of whether the table has a row header. The row header is row -1.
  • New options to allow cell edge colours to be specified.

To use the new table, just import blume.table and use that to create your tables instead of the matplotlib.table.table.

from blume import table

tab = table(ax, ..)

The first parameter to table should be an matplotlib.axes.

If you are using the pyplot interface, note that calling pyplot.table will use matplotlib.table.table.

Instead import table from blume and use as follows:

from blume.table import table
tab = table(plt.gca(), ...)

And lots more

The general theme is how to create generic tools to explore tables of data, visualising the data with matplotlib.

Tools that also help with managing open data.

For small datasets, there is an evolving example of working with simple csv files, stored in a git repository. See blume.examples.ocixx.

Install

From source code

Get the latest code:

git clone http://github.com/swfiua/blume

Instal:

python setup.py install

Using pip:

pip3 install blume

Examples

The blume/examples folder has a number of demonstrations of what can be done with this table.

You can run these with python3:

python3 -m blume.example.cpr

Or you can run a folder full of examples by using blume.eggshow.

Requirements

The package will only require an appropriate version of matplotlib.

This is to make it easy for anyone who is only here for the table.

Universal

The U in blume.

This for now is the blume.cpr module.

Testing

Run tests using:

pytest tests

blume's People

Contributors

swfiua avatar

Stargazers

 avatar  avatar André Kruger avatar  avatar PD Hall avatar Liung avatar Max avatar ozkan avatar Hassan Kibirige avatar Andy Piper avatar  avatar Lea Hermann avatar Zhang Zhanluo avatar  avatar Gabriel Linder avatar trefecta avatar Philip Nelson avatar Carlos H. Grohmann avatar Mustafa Al Ibrahim avatar  avatar Nico Müller avatar  avatar  avatar Matthew Turk avatar Roderick Brown avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

Forkers

jimmy-moqin

blume's Issues

Compatibility with matplotlib 3.8?

With a fresh install of matplotlib (version 3.8) and blume (version 0.2.5.4) on python 3.10, when I try to import blume.table I get the following error:

>>> from blume import table
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/billbrod/miniconda3/envs/test/lib/python3.10/site-packages/blume/table.py", line 23, in <module>
    from matplotlib import artist, cbook, docstring
ImportError: cannot import name 'docstring' from 'matplotlib' (/home/billbrod/miniconda3/envs/test/lib/python3.10/site-packages/matplotlib/__init__.py)

it looks like matplotlib is removing their docstring API. Is it possible to remove this behavior?

"KeyError: Text" when trying an example

Python 3.9.5, ubuntu, running in a pyenv. (Reproduced outside of my larger project)

$ pip install blume
$ python3 multiline.py

brian@Baudrillard:~/people/ray/blume$ python3 multiline.py 
Traceback (most recent call last):
  File "/home/brian/people/ray/blume/multiline.py", line 8, in <module>
    from blume.table import table
  File "/home/brian/people/ray/blume/.direnv/python-3.9.5/lib/python3.9/site-packages/blume/table.py", line 31, in <module>
    class Cell(Rectangle):
  File "/home/brian/people/ray/blume/.direnv/python-3.9.5/lib/python3.9/site-packages/blume/table.py", line 261, in Cell
    def set_text_props(self, **kwargs):
  File "/home/brian/people/ray/blume/.direnv/python-3.9.5/lib/python3.9/site-packages/matplotlib/docstring.py", line 40, in __call__
    func.__doc__ = inspect.cleandoc(func.__doc__) % self.params
KeyError: 'Text'

I... suspect it's me that has the error, but I can't figure out what could be causing it from a clean venv.

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.