matplotlib: Bindings to Matplotlib; a Python plotting library

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Matplotlib is probably the most full featured plotting library out there. These bindings provide a quick, easy, and extensible way to use it in Haskell.

onscreen $ contourF (\a b -> sin (a*pi/180.0) + cos (b*pi/180.0)) (-100) 100 (-200) 200 10

[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0, 0.1.2.1, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.4.1, 0.4.3, 0.4.4, 0.4.5, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5, 0.7.6, 0.7.7, 0.7.7
Change log None available
Dependencies aeson, base (>=4.7 && <5), bytestring, containers, deepseq, filepath, process, split, temporary [details]
License BSD-3-Clause
Copyright 2017 Andrei Barbu
Author Andrei Barbu
Maintainer andrei@0xab.com
Category Graphics
Home page https://github.com/abarbu/matplotlib-haskell
Source repo head: git clone https://github.com/abarbu/matplotlib-haskell
Uploaded by AndreiBarbu at 2021-11-08T21:14:33Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for matplotlib-0.7.7

[back to package description]

matplotlib contour plot

Matplotlib for Haskell

Build Status Hackage

Haskell bindings to Python's Matplotlib. It's high time that Haskell had a fully-fledged plotting library! Examples below.

Documentation is available on Hackage.

In GHCi:

:set -XExtendedDefaultRules
import Graphics.Matplotlib
onscreen $ contourF (\a b -> sin (a*pi/180.0) + cos (b*pi/180.0)) (-100) 100 (-200) 200 10

Or in a standalone file

{-# LANGUAGE ExtendedDefaultRules #-}

import Graphics.Matplotlib

main = onscreen $ contourF (\a b -> sin (a*pi/180.0) + cos (degreesRadians b)) (-100) 100 (-200) 200 10

We need -XExtendedDefaultRules to avoid having to manually having to specify certain types.

Installation

You will need several python libraries to run this code which can be installed on Ubuntu machines with the following command:

sudo apt-get install -y python3 python3-pip python3-matplotlib python3-numpy python3-tk python-mpltoolkits.basemap python3-scipy dvipng

If you're using conda

conda install -y matplotlib scipy tk

If you have instructions for other machines or OSes let me know. We require the python3 binary to be available somewhere in the PATH. We run with env python3.

Once you have the prerequisites you can install using the standard incantation

stack install matplotlib

If you use LaTeX markup you will need the requisite packages

sudo apt-get install -y texlive-full

Or with conda

conda install -y -c conda-forge texlive-core

Examples

Click on any of the examples below to go to the corresponding test that generates it. Depending on your matplotlib version default colors might be different.

integral griddata streamplot hist2DLog quadratic spines annotation corr bivariateNormal images labelled-histogram projections histogram pcolorlog scatter stacked legend errorbar line-options quiver-fancy contour boxplot show-matrix scatterhist hinton density violinplot histMulti cumulative polar hists tex eventplot line-function density-bandwidth quiver pie