Skip to content

Commit 343430a

Browse files
authored
Syntax highlighting in README.md (#566)
1 parent 05172f0 commit 343430a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private (not in the system `PATH`) Julia Python distribution (via
4040
Miniconda), then PyPlot will automatically install Matplotlib as needed.
4141

4242
If you are installing PyCall and PyPlot for the first time, just do `ENV["PYTHON"]=""` before running `Pkg.add("PyPlot")`. Otherwise, you can reconfigure PyCall to use Conda via:
43-
```
43+
```julia
4444
ENV["PYTHON"]=""
4545
Pkg.build("PyCall")
4646
```
@@ -64,7 +64,7 @@ Alternatively, you can install the
6464
(which also includes `ipython` and other IJulia dependencies).
6565

6666
Otherwise, you can use the [Homebrew](http://brew.sh/) package manager:
67-
```
67+
```sh
6868
brew install python gcc freetype pyqt
6969
brew link --force freetype
7070
export PATH="/usr/local/bin:$PATH"
@@ -82,7 +82,7 @@ graphics-capable Julia environment such as IJulia, you can simply type
8282
[matplotlib.pyplot](http://matplotlib.org/api/pyplot_api.html) API.
8383
For example:
8484

85-
```
85+
```julia
8686
using PyPlot
8787
# use x = linspace(0,2*pi,1000) in Julia 0.6
8888
x = range(0; stop=2*pi, length=1000); y = sin.(3 * x + 4 * cos.(2 * x));
@@ -159,7 +159,7 @@ for more detail.
159159
On the other hand, you may wish to use one of the Python Matplotlib
160160
backends to open an interactive window for each plot (for interactive
161161
zooming, panning, etcetera). You can do this at any time by running:
162-
```
162+
```julia
163163
pygui(true)
164164
```
165165
to turn on the Python-based GUI (if possible) for subsequent plots,
@@ -182,7 +182,7 @@ when it starts up (based on what you have installed), but you can
182182
force a specific toolkit to be chosen by importing the PyCall module
183183
and using its `pygui` function to set a Python backend *before*
184184
importing PyPlot:
185-
```
185+
```julia
186186
using PyCall
187187
pygui(gui)
188188
using PyPlot
@@ -235,7 +235,7 @@ correspondingly named methods of
235235
We also export the Matlab-like synonyms `surf` for `plot_surface` (or
236236
`plot_trisurf` for 1d-array arguments) and `mesh` for
237237
`plot_wireframe`. For example, you can do:
238-
```
238+
```julia
239239
surf(rand(30,40))
240240
```
241241
to plot a random 30×40 surface mesh.
@@ -263,7 +263,7 @@ To simplify this, PyPlot uses the [LaTeXStrings package](https://github.com/stev
263263
be constructed via `L"...."` without escaping backslashes or dollar
264264
signs. For example, one can simply write `L"$\alpha + \beta$"` for the
265265
abovementioned equation, and thus you can do things like:
266-
```
266+
```jl
267267
title(L"Plot of $\Gamma_3(x)$")
268268
```
269269
If your string contains *only* equations, you can omit the dollar
@@ -280,7 +280,7 @@ Optionally, you can tell PyPlot to display plots in the browser as
280280
which have the advantage of being resolution-independent (so that they
281281
display without pixellation at high-resolutions, for example if you
282282
convert an IJulia notebook to PDF), by running:
283-
```
283+
```julia
284284
PyPlot.svg(true)
285285
```
286286
This is not the default because SVG plots in the browser are much
@@ -297,7 +297,7 @@ command, e.g. `savefig("plot.svg")`.
297297

298298
## Modifying matplotlib.rcParams
299299
You can mutate the `rcParams` dictionary that Matplotlib uses for global parameters following this example:
300-
```jl
300+
```julia
301301
rcParams = PyPlot.PyDict(PyPlot.matplotlib."rcParams")
302302
rcParams["font.size"] = 15
303303
```

0 commit comments

Comments
 (0)