Top Banner
Life after matplotlib: Harder, better, faster, stronger Kayla Iacovino http://code.google.com/p/avoplot
23

Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

May 12, 2015

Download

Technology

PyData

Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Life after matplotlib:Harder, better, faster, stronger

Kayla Iacovino

http://code.google.com/p/avoplot

Page 2: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

A brief history of me.

Page 3: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

A brief history of me.

Page 4: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

A brief history of me.

Page 5: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

It all started with a bang...

Page 6: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

...and a rather chilly garage

Page 7: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Data Problems

+

Existing Python tools

● Aims● Design● Current state● Future

=

Page 8: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Science in a nutshell.

Data Import

Processing

Visualisation

Page 9: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

What is the problem?● Need general tools that can be specialised for the task at hand.

● Specialisations should be easily reusable.

Page 10: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Python solves all?

Data Import

Processing

Visualisation

● xlrd● NumPy● csv● Pandas

● SciPy● NumPy

● matplotlib

Page 11: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

What is the real problem?● Scientists are not (usually) programmers.

● Scientists are usually in a hurry.

● Scientists are stupid (outside of their field).

● Scripting is a frustrating way to achieve visualisation tasks.

Page 12: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

AvoPlot: Aims● Graphical frontend to matplotlib.

● Graphical import of common data formats (txt, csv, xls etc.).

● Basic data processing capabilities.

Page 13: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

● Drag and drop replacement for matplotlib's pyplot interface.

● Easily customisable.

● Framework for scientists to create GUIs for their processing tools.

AvoPlot: Aims 2

Page 14: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

GUI interface for easy data visualisation

Plugins mean AvoPlot isversatile – and extensible!

Powered by Python with apowerful scripting interface

Anatomy of AvoPlot

Page 15: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

“Open-source software is written by a bunch of hippies living in a commune in Palo Alto. With their beards down to their socks and sandals, living on nothing but organic avocados. Look at me, I am so moral.”

- Talfan Barnie, 2010 (somewhere in Ethiopia)

But what has this got to do with avocados?

Page 16: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino
Page 17: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

import matplotlib.pyplot as pltimport numpy

xdata = numpy.linspace(0, 7, 500)ydata = numpy.cos(xdata)

plt.plot(xdata, ydata, 'r-')plt.show() import avoplot.pyplot as plt

import numpy

xdata = numpy.linspace(0, 7, 500)ydata = numpy.cos(xdata)

plt.plot(xdata, ydata, 'r-')plt.show()

Scripting interface

Page 18: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Plugins● Python module or Python package

● Allow import of new data types, and provision of new manipulation or processing tools.

● Distributed with distutils.

● Highly integrated with the GUI.

Page 19: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino
Page 20: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

FTIR Plugin#define new data series type for FTIR dataclass FTIRSpectrumData(series.XYDataSeries): def __init__(self, *args, **kwargs): super(FTIRSpectrumData, self).__init__(*args, **kwargs)

self.add_control_panel(BackgroundCalcCtrl(self)) @staticmethod def get_supported_subplot_type(): return FTIRSpectrumSubplot

class FTIRPlugin(plugins.AvoPlotPluginSimple): def __init__(self): super(FTIRPlugin, self).__init__("FTIR Plugin", FTIRSpectrumData) self.set_menu_entry(['FTIR', 'New Spectrum'], "Plot an FTIR spectrum")

Page 21: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

AvoPlot: the future X Y0.3 0.2960.4 0.3890.5 0.4790.6 0.5650.7 0.6440.8 0.7670.9 0.7831.0 0.8411.1 0.8911.2 0.932

Page 22: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Overview/Conclusions● It works (sort of).

● It's useful (at least we think so).

● More developers are needed!

Page 23: Life after Matplotlib: Harder, Better, Faster, Stronger by Kayla Lacovino

Questions

http://code.google.com/p/avoplot