Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed syntax coloration (bash and python) #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
```

Expand All @@ -52,7 +52,7 @@ itermplot supports animation created by matplotlib animation module.
<img src="docs/animated.gif" width="500">

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
Expand All @@ -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
```

Expand All @@ -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
```

Expand All @@ -89,20 +89,20 @@ 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.

### Testing

To test your installation you can do the following in your iTerm2 console:
```
```bash
$ echo $MPLBACKEND
module://itermplot
$ python3
Expand All @@ -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

Expand All @@ -135,7 +135,7 @@ Type "help", "copyright", "credits" or "license" for more information.
```

To remove the package completely, run:
```
```bash
pip3 uninstall itermplot
```

Expand Down