Skip to content

Commit f20eeb4

Browse files
committed
update docs
1 parent 627bf56 commit f20eeb4

File tree

5 files changed

+13
-36
lines changed

5 files changed

+13
-36
lines changed

docs/src/contributing.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ Navigate to the repo site (https://github.com/JuliaPlots/Plots.jl) and click the
201201

202202
#### Set up the git remote
203203

204-
Navigate to the local repo. Note: I'm assuming that you do development in your Julia directory, and using Mac/Linux. Adjust as needed.
204+
Navigate to the local repo.
205+
Note: I'm assuming that you do development in your Julia directory, and using Mac/Linux.
206+
Adjust as needed.
205207

206-
```
208+
```bash
207209
cd ~/.julia/v0.5/Plots
208210
git remote add forked git@github.com:user123/Plots.jl.git
209211
```
@@ -214,7 +216,7 @@ After running these commands, `git remote -v` should show two remotes: `origin`
214216

215217
If you're just starting work on a new feature:
216218

217-
```
219+
```bash
218220
git fetch origin
219221
git checkout master
220222
git merge --ff-only origin/master
@@ -228,7 +230,7 @@ The first three lines are meant to ensure you start from the main repo's master
228230

229231
If you have an ongoing development branch (say, `user123-dev`) which you'd prefer to use (and which has previously been merged into master!) then you can get that up to date with:
230232

231-
```
233+
```bash
232234
git fetch origin
233235
git checkout user123-dev
234236
git merge --ff-only origin/master
@@ -239,7 +241,7 @@ We update our local copy of origin, checkout the dev branch, then attempt to "fa
239241

240242
#### Write code, and format
241243

242-
Power up your favorite editor (maybe [Juno](https://junolab.org/)?) and make some code changes to the repo.
244+
Power up your favorite editor (maybe [Juno](https://junolab.org)?) and make some code changes to the repo.
243245

244246
Format your changes (code style consistency) using:
245247
```bash
@@ -250,12 +252,15 @@ $ julia -e 'using Runic; exit(Runic.main(ARGS))' -- --inplace .
250252

251253
After applying changes, you'll want to "commit" or save a snapshot of all the changes you made. After committing, you can "push" those changes to your forked repo on Github:
252254

253-
```
255+
```bash
254256
git add src/my_new_file.jl
255257
git commit -am "my commit message"
256258
git push forked user123-dev
257259
```
258260

261+
`Plots` has some [pre-commit](https://pre-commit.com) hooks configuration set in order to enhance code quality.
262+
One can run the `pre-commit` checks using `pre-commit run --all-files`, they should be automatically ran when using `git commit` if installed.
263+
259264
The first line is optional, and is used when adding new files to the repo. The `-a` means "commit all my changes", and the `-m` lets you write a note about the commit (you should always do this, and hopefully make it descriptive).
260265

261266
#### Submit a PR
@@ -268,7 +273,7 @@ Make sure the "base" branch is JuliaPlots `master` and the "compare" branch is `
268273

269274
After all of this, you will likely want to go back to using `master` (or possibly using a tagged release, once your feature is tagged). To clean up:
270275

271-
```
276+
```bash
272277
git fetch origin
273278
git checkout master
274279
git merge --ff-only origin/master
@@ -311,7 +316,7 @@ From the Julia REPL, run `Pkg.test(name="Plots")`. This will try to plot the te
311316

312317
After the reference images have been updated, navigate to PlotReferenceImages and push the changes to Github:
313318

314-
```
319+
```bash
315320
cd ~/.julia/v0.5/PlotReferenceImages
316321
git add Plots/*
317322
git commit -am "a useful message"

docs/src/ecosystem.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ In a paper, Tupper presents a method for graphing two-dimensional implicit equat
7373

7474
![](https://camo.githubusercontent.com/950ef704a0601ed9429addb35e6b7246ca5da149/687474703a2f2f692e696d6775722e636f6d2f4c4368547a43312e706e67)
7575

76-
77-
7876
## [ControlSystems](https://github.com/JuliaControl/ControlSystems.jl)
7977

8078
A control systems design toolbox for Julia. This toolbox works similar to that of other major computer-aided control systems design (CACSD) toolboxes. Systems can be created in either a transfer function or a state space representation. These systems can then be combined into larger architectures, simulated in both time and frequency domain, and analyzed for stability/performance properties.

docs/src/output.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
1-
21
# [Output](@id output)
32

4-
53
**A Plot is only displayed when returned** (a semicolon will suppress the return), or if explicitly displayed with `display(plt)`, `gui()`, or by adding `show = true` to your plot command.
64

75

86
!!! tip
97
You can have MATLAB-like interactive behavior by setting the default value: default(show = true)
108

119
### Standalone window
12-
1310
Calling `gui(plt)` will open a standalone window. `gui()`, like `plot!(...)`, applies to the "current" Plot. Returning a Plot object to the REPL is like calling `gui(plt)`.
1411

1512

1613
### Jupyter / IJulia
17-
1814
Plots are shown inline when returned to a cell. The default output format is `svg` for backends that support it.
1915
This can be changed by the `html_output_format` attribute, with alias `fmt`:
2016

@@ -23,12 +19,10 @@ plot(rand(10), fmt = :png)
2319
```
2420

2521
### Juno / Atom
26-
2722
Plots are shown in the Atom PlotPane when possible, either when returned to the console or to an inline code block. At any time, the plot can be opened in a standalone window using the `gui()` command.
2823
The PlotPane can be disabled in Juno's settings.
2924

3025
### savefig / format
31-
3226
Plots support 2 different versions per save-command.
3327
Command `savefig` chooses file type automatically based on the file extension.
3428

@@ -48,15 +42,13 @@ png(plot_ref, filename_string) # save the fig referenced by plot_ref as png with
4842
```
4943

5044
#### File formats supported by most graphical backends
51-
5245
- png (default output format for `savefig`, if no file extension is given)
5346
- svg
5447
- PDF
5548

5649
When not using `savefig`, the default output format depends on the environment (e.g., when using IJulia/Jupyter).
5750

5851
#### Supported output file formats
59-
6052
Note: not all backends support every output file format !
6153
A simple table showing which format is supported by which backend
6254

docs/src/recipes.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ using Plots; gr()
33
PlotsBase.reset_defaults()
44
```
55

6-
76
# [Recipes](@id recipes)
87

98
Recipes are a way of defining visualizations in your own packages and code, without having to depend on Plots. The functionality relies on [RecipesBase](https://github.com/JuliaPlots/Plots.jl/tree/v2/RecipesBase), a super lightweight but powerful package which allows users to create advanced plotting logic without Plots. The `@recipe` macro in RecipesBase will add a method definition for `RecipesBase.apply_recipe`. Plots adds to and calls this same function, and so your package and Plots can communicate without ever knowing about the other. Magic!
@@ -37,17 +36,13 @@ If `MyVec` was a subtype of AbstractVector, there would not be anything to do...
3736

3837
Afterwards, all plot commands which work for vectors will also work for your datatype.
3938

40-
4139
### Series Recipes
42-
4340
Lets quickly discuss a mainstay of data visualization: the histogram. Hadley Wickham has explored the nature of histograms as part of his [Layered Grammar of Graphics](https://vita.had.co.nz/papers/layered-grammar.pdf). In it, he discusses how a histogram is really nothing more than a bar graph which has its data pre-binned. This is true, and it can be taken further. A bar-graph is really an extension of a step-graph, in which zeros are interwoven among the x-values. A step-graph is really nothing more than a path (line) which can travel only horizontally or vertically. Of course, a similar decomposition could be had by treating the bars as filled polygons.
4441

4542
The point to be had is that a graphics package need only be able to draw lines and polygons, and they can support drawing a histogram. The path from data to histogram is normally very complicated, but we can avoid the complexity and define a recipe to convert it to its subcomponents. In a few lines of readable code, we can implement a key statistical visualization. See the [tutorial on series recipes](https://github.com/tbreloff/ExamplePlots.jl/tree/master/notebooks/series_recipes.ipynb) for a better understanding of how you might use them.
4643

4744

48-
4945
## Recipe Types
50-
5146
Above we described `Type recipes` and `Series Recipes`. In total there are four main types of recipes in Plots (listed in the order they are processed):
5247

5348
- User Recipes

docs/src/tutorial.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ PlotsBase.reset_defaults()
44
```
55

66
# [Tutorial](@id tutorial)
7-
87
This is a guide for getting you up and running with Plots.jl. Its main goal is
98
to introduce you to the terminology used in the package, how to use Plots.jl in
109
common use cases, and put you in a position to easily understand the rest of
1110
the manual. It is recommended that the code examples be followed inside
1211
the REPL or an interactive notebook.
1312

1413
## Basic Plotting: Line Plots
15-
1614
After you have installed Plots.jl via `Pkg.add("Plots")`, the first step is to
1715
initialize the package. Depending on your computer, this will take a few seconds:
1816

@@ -182,7 +180,6 @@ Note that `y3` is being plotted as a dotted line. This is distinct from a
182180
scatter plot of the data.
183181

184182
### Logarithmic Scale Plots
185-
186183
Sometimes data needs to be plotted across orders of magnitude. The attributes
187184
`xscale` and `yscale` can be set to `:log10` in this case. They can also be
188185
set to `:identity` to keep them linear-scale.
@@ -205,7 +202,6 @@ More information about attributes can be found in the
205202
[Attributes](@ref attributes) section of the Manual.
206203

207204
### LaTeX Equation Strings
208-
209205
Plots.jl works with LaTeXStrings.jl, a package that allows the user to type
210206
LaTeX equations in string literals. To install this, type in
211207
`Pkg.add("LaTeXStrings")`. The easiest way to use it is to prepend `L` to a
@@ -285,7 +281,6 @@ ylabel!("y")
285281
```
286282

287283
## [Plotting Backends](@id plotting-backends)
288-
289284
Plots.jl is a plotting metapackage: it's an interface over many different plotting libraries.
290285
What Plots.jl is actually doing is interpreting your commands and then
291286
generating the plots using another plotting library, called the **backend**.
@@ -344,7 +339,6 @@ For more information on backends, see the [backends page](@ref backends).
344339
For examples of plots from the various backends, see the Examples section.
345340

346341
## Plotting in Scripts
347-
348342
At the start of the tutorial, we recommended following along the code examples
349343
in an interactive session for the following reason: try adding those same
350344
plotting commands to a script. Now call the script... and the plot doesn't
@@ -366,7 +360,6 @@ Finally, if we have a plot object `p`, we can type `display(p)` to
366360
display the plot.
367361

368362
## Combining Multiple Plots as Subplots
369-
370363
We can combine multiple plots together as subplots using **layouts**.
371364
There are many methods for doing this, and we will show two simple methods
372365
for generating simple layouts. More advanced layouts are shown in the
@@ -413,7 +406,6 @@ individual plots, while the attribute `legend=false` in the final `plot`
413406
call is applied to all of the subplots.
414407

415408
## Plot Recipes and Recipe Libraries
416-
417409
You now know all of the basic terminology of Plots.jl and can roam the
418410
documentation freely to become a plotting master. However, there is one
419411
thing left: **recipes**. Plotting recipes are extensions to the Plots.jl
@@ -442,7 +434,6 @@ Besides recipes, StatsPlots.jl also provides a specialized macro `@df` from plot
442434
directly from data tables.
443435

444436
### Using User Recipes
445-
446437
A user recipe says how to interpret plotting commands on a new data type.
447438
In this case, StatsPlots.jl has a macro `@df` which allows you to plot
448439
a `DataFrame` directly by using the column names. Let's build a `DataFrame`
@@ -472,7 +463,6 @@ There's not much you have to do here: all of the commands from before
472463
```
473464

474465
### Using a Type Recipe
475-
476466
In addition, StatsPlots.jl extends Distributions.jl by adding a type recipe
477467
for its distribution types, so they can be directly interpreted as plotting
478468
data:
@@ -486,7 +476,6 @@ Type recipes are a very convenient way to plot a specialized type which
486476
requires no more intervention!
487477

488478
### Using Plot Recipes
489-
490479
StatsPlots.jl adds the `marginhist` multiplot via a plot recipe. For our data,
491480
we will pull in the famous `iris` dataset from RDatasets:
492481

@@ -507,7 +496,6 @@ Thus a plot recipe is not just a series, but also something like a new
507496
`plot` command.
508497

509498
### Using Series Recipes
510-
511499
StatsPlots.jl also introduces new series recipes. The key is that you don't have
512500
to do anything differently. After `using StatsPlots`, you can simply use those
513501
new series recipes as though they were built into the plotting libraries. Let's
@@ -525,7 +513,6 @@ boxplot!(["Series 1" "Series 2" "Series 3" "Series 4"], y, legend=false)
525513
```
526514

527515
## Additional Addons To Try
528-
529516
Given the easy extendability of Plots.jl, there are many other things you can
530517
try. Here's a short list of very usable addons to check out:
531518

0 commit comments

Comments
 (0)