Skip to content

Commit

Permalink
function plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Apr 7, 2017
1 parent c34b200 commit df97b2f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
Binary file added docs/src/assets/normalized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 20 additions & 3 deletions docs/src/basics/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,21 @@ default).
In the plot command, one can choose the variables to be plotted in each plot. The
master form is:

```julia
vars = [(f1,0,1), (f2,1,3), (f3,4,5)]
```

where this would mean plot f1(variable 1, variable 2), f2(variable 1, variable 3),
f3(variable 4, variable 5) all on the same graph. (0 is considered to be time,
or the independent variable). The function `f1` should take in scalars and return
a tuple. If no function is given, for example,

```julia
vars = [(0,1), (1,3), (4,5)]
```

where this would mean plot variable 0 vs 1, 1 vs 3, and 4 vs 5 all on the same graph
(0 is considered to be time, or the independent variable). While this can be used
for everything, the following conveniences are provided:
where this would mean plot variable 0 vs 1, 1 vs 3, and 4 vs 5 all on the same graph.
While this can be used for everything, the following conveniences are provided:

* Everywhere in a tuple position where we only find an integer, this
variable is plotted as a function of time. For example, the list above
Expand Down Expand Up @@ -132,6 +140,15 @@ plot(plot(xyzt,xyz),plot(xy, xz, yz, layout=(1,3),w=1), layout=(2,1))

![lorenz_plot](../assets/vars_plotting_example.png)

An example using the functions:

```julia
f(x,y,z) = (sqrt(x^2+y^2+z^2),x)
plot(sol,vars=(f,:x,:y,:z))
```

![norm_plot](../assets/normalized.png)

## Animations

Using the iterator interface over the solutions, animations can also be generated
Expand Down

0 comments on commit df97b2f

Please sign in to comment.