diff --git a/README.md b/README.md index a5761e6..d8c1e1c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,26 @@ # MPL-Colormaps-Mathematica -Mathematica port of matplotlib colormaps Magma, Inferno, Plasma, Viridis, and Cividis \ No newline at end of file +Mathematica port of matplotlib colormaps Magma, Inferno, Plasma, Viridis, and Cividis. + +![alt text](examples/gallery.png "Gallery of color maps 'Magma', 'Inferno', 'Plasma', 'Viridis', and 'Cividis'") + +## Usage + +To import this package, either download `MPLColorMap.m` and import the file using +``` +<< "path/to/MPLColorMap.m"; +``` +or import the file from this web server using +``` +<< "https://git.mieling.net/Thomas/MPL-Colormaps-Mathematica/raw/\ +branch/master/MPLColorMap.m"; +``` + +The various color maps are then available as `MPLColorMap["Viridis"]` etc. +For example +``` +DensityPlot[Sin[x] Sin[y], {x, 0, 2 \[Pi]}, {y, 0, 2 \[Pi]}, + ColorFunction -> MPLColorMap["Viridis"]] +``` +produces the following image: +![alt text](examples/densityplot.png "Density plot of sin(x) sin(y) using the 'Viridis' color map") diff --git a/examples/densityplot.png b/examples/densityplot.png new file mode 100644 index 0000000..f22dcaf Binary files /dev/null and b/examples/densityplot.png differ diff --git a/examples/gallery.png b/examples/gallery.png new file mode 100644 index 0000000..23f1226 Binary files /dev/null and b/examples/gallery.png differ