background preloader

Matplotlib

Facebook Twitter

Spiral for John Hunter. Python - Using multiple colors in matplotlib plot. User_interfaces example code: svg_tooltip.py — Matplotlib 1.3.x documentation. Pylab_examples example code: hyperlinks.py — Matplotlib 1.3.0 documentation. Navigation This Page Show Source Quick search.

pylab_examples example code: hyperlinks.py — Matplotlib 1.3.0 documentation

Minesweeper in Matplotlib. Lately I've been playing around with interactivity in matplotlib.

Minesweeper in Matplotlib

A couple weeks ago, I discussed briefly how to use event callbacks to implement simple 3D visualization and later used this as a base for creating a working 3D Rubik's cube entirely in matplotlib. Today I have a different goal: re-create minesweeper, that ubiquitous single-player puzzle game that most of us will admit to having binged on at least once or twice in their lives. In minesweeper, the goal is to discover and avoid hidden mines within a gridded minefield, and the process takes some logic and quick thinking.

To implement this in matplotlib, at its most stripped-down level, simply requires us to register mouse clicks on the plot window, and to have the window respond in the appropriate way. The rest is just the logic underneath. Matplotlib: python plotting — Matplotlib 1.2.1 documentation. Thumbnail gallery. Color example code: colormaps_reference.py — Matplotlib 1.3.0 documentation. (Source code) """Reference for colormaps included with Matplotlib.

color example code: colormaps_reference.py — Matplotlib 1.3.0 documentation

This reference example shows all colormaps included with Matplotlib. Note thatany colormap listed here can be reversed by appending "_r" (e.g., "pink_r").These colormaps are divided into the following categories: Sequential: These colormaps are approximately monochromatic colormaps varying smoothly between two color tones---usually from low saturation (e.g. white) to high saturation (e.g. a bright blue). Matplotlib - Python city shapefiles. Python - shapefile and matplotlib: plot polygon collection of shapefile coordinates.

Python - Possible to make labels appear when hovering over a point in matplotlib. User_interfaces example code: svg_histogram.py — Matplotlib 1.3.x documentation.