From 516d6ce5046aab4b48240b4896fea22dbb7e6add Mon Sep 17 00:00:00 2001 From: Lilian Besson Date: Tue, 18 Dec 2018 09:19:33 +0100 Subject: [PATCH] Fixed syntax coloration (bash and python) --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7595da2..85e01bf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ An awesome [iTerm2](https://www.iterm2.com/) backend for Matplotlib, so you can The above is achieved with zero modifications to your Python script. For example, the above plots are generated with the following code: -```{python} +```python import numpy as np import matplotlib.pyplot as plt import networkx as nx @@ -36,7 +36,7 @@ Note: you need to run `plt.show()` to display the figure. ### Reverse video If you use a dark background in your terminal, you can enable "reverse video" mode by adding this to your `.profile`: -``` +```bash export ITERMPLOT=rv ``` @@ -52,7 +52,7 @@ itermplot supports animation created by matplotlib animation module. You'll need to install ImageMagick and have it on the path to use the animation support. The simpliest way to see if ImageMagick is installed and valid is to run: -```{sh} +```bash $ convert -version Version: ImageMagick 7.0.4-4 Q16 x86_64 2017-01-14 http://www.imagemagick.org Copyright: © 1999-2017 ImageMagick Studio LLC @@ -62,12 +62,12 @@ Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib ``` To enable animation support, you need to specifying the desired number of frames in the output animation. For example, specify it before your script with: -``` +```bash $ ITERMPLOT_FRAMES=30 python script.py ``` You can also save the resulting gif file by using `ITERMPLOT_OUTFILE` environment variable: -``` +```bash $ ITERMPLOT_FRAMES=30 ITERMPLOT_OUTFILE=out.gif python script.py ``` @@ -76,7 +76,7 @@ Currently animation does not support reverse video with ITERMPLOT=rv. ### Configure lines You can configure the number of lines used with the `ITERMPLOT_LINES` environment variable. For example: -```{sh} +```bash ITERMPLOT_LINES=5 python3 simple.py ``` @@ -89,12 +89,12 @@ Now supports Python 2, even if this makes me want to cry 😭 ### Using pip Install using `pip` using the command: -```{sh} +```bash pip3 install itermplot ``` itermplot is enabled by setting `MPLBACKEND` in your environment. If you use `bash`, then this can be accomplished using the command: -```{sh} +```bash export MPLBACKEND="module://itermplot" ``` Note: you can add the `export` line above to your `.profile` file so that itermplot is always enabled in your terminal. @@ -102,7 +102,7 @@ Note: you can add the `export` line above to your `.profile` file so that itermp ### Testing To test your installation you can do the following in your iTerm2 console: -``` +```bash $ echo $MPLBACKEND module://itermplot $ python3 @@ -120,7 +120,7 @@ You should see a plot! ## Uninstall You can disable this backend by unsetting the `MPLBACKEND` environment variable. -``` +```bash $ unset MPLBACKEND $ echo $MPLBACKEND @@ -135,7 +135,7 @@ Type "help", "copyright", "credits" or "license" for more information. ``` To remove the package completely, run: -``` +```bash pip3 uninstall itermplot ```