This commit is contained in:
Thomas Breloff 2015-09-10 13:51:16 -04:00
parent 8e88b5a890
commit dded3a5c82

View File

@ -4,7 +4,9 @@
Plotting interface and wrapper for several plotting packages. Plotting interface and wrapper for several plotting packages.
#### This is under development... please add your wishlist for the plotting interface to issue #1. Please add wishlist items, bugs, or any other comments/questions to the issues list.
## Installation
First, clone the package, and get any plotting packages you need: First, clone the package, and get any plotting packages you need:
@ -14,6 +16,8 @@ Pkg.clone("https://github.com/tbreloff/Qwt.jl.git") # [optional] requires pyqt
Pkg.add("Gadfly") # [optional] Pkg.add("Gadfly") # [optional]
``` ```
## Use
Load it in. The underlying plotting backends are not imported until `plotter()` is called (which happens Load it in. The underlying plotting backends are not imported until `plotter()` is called (which happens
on your first call to `plot`). This means that you don't need any backends to be installed when you call `using Plots`. on your first call to `plot`). This means that you don't need any backends to be installed when you call `using Plots`.
For now, the default backend is Qwt. For now, the default backend is Qwt.
@ -48,22 +52,22 @@ which saves:
# plot and plotter! interface (WIP) ## plot and plotter! interface (WIP)
The main plot command. Call `plotter!(:module)` to set the current plotting backend. The main plot command. Call `plotter!(:module)` to set the current plotting backend.
Commands are converted into the relevant plotting commands for that package: Commands are converted into the relevant plotting commands for that package:
``` ```
plotter!(:gadfly) plotter!(:gadfly)
plot(1:10) # this calls `y = 1:10; Gadfly.plot(x=1:length(y), y=y)` plot(1:10) # this effectively calls `y = 1:10; Gadfly.plot(x=1:length(y), y=y)`
plotter!(:qwt) plotter!(:qwt)
plot(1:10) # this calls `Qwt.plot(1:10)` plot(1:10) # this effectively calls `Qwt.plot(1:10)`
``` ```
Use `plot` to create a new plot object, and `plot!` to add to an existing one: Use `plot` to create a new plot object, and `plot!` to add to an existing one:
``` ```
plot(args...; kw...) # creates a new plot window, and sets it to be the currentPlot plot(args...; kw...) # creates a new plot window, and sets it to be the `currentPlot`
plot!(args...; kw...) # adds to the `currentPlot` plot!(args...; kw...) # adds to the `currentPlot`
plot!(plotobj, args...; kw...) # adds to the plot `plotobj` plot!(plotobj, args...; kw...) # adds to the plot `plotobj`
``` ```