Skip to content

Commit

Permalink
Merge pull request #41 from JuliaPluto/readme-plot-plot
Browse files Browse the repository at this point in the history
  • Loading branch information
disberd authored Feb 21, 2024
2 parents 8c26155 + c5eb1a8 commit a0241e3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@ This package provides a wrapper type `PlutoPlot` around the `Plot` type from [Pl

The wrapper mostly defines a custom `show` method specifically optimized for displaying inside of [Pluto.jl](https://github.com/fonsp/Pluto.jl/) and adds the options of providing custom javascript functions to attach to the [plolty JS events](https://plotly.com/javascript/plotlyjs-events/)

Basic use of this package is to load this inside Pluto instead of PlotlyBase or PlotlyJS, and then simply wrap the intended `Plot` objects from PlotlyBase inside a PlutoPlot as
You can load the PlutoPlotly package *instead of* PlotlyBase or PlotlyJS, and replace `Plot` with `plot` from PlutoPlotly. For example:

```julia
p = Plot(args...)
PlutoPlot(p)
plot([5,6,7,2]; line_color="red")
```

One could also used the convenience exported function `plot`:
```julia
function plot(args...;kwargs...)
@nospecialize
PlutoPlot(Plot(args...;kwargs...))
You can also create a PlotlyBase `Plot`, and then wrap it inside a `PlutoPlot` object:
```julia
let
# create a PlotlyBase function
p = Plot(args...)
# wrap it
PlutoPlot(p)
end
```

(The function `plot(args...)` from PlutoPlotly is the same as `PlutoPlot(Plot(args...))`.)

# Features

## Persistent Layout
Expand Down

0 comments on commit a0241e3

Please sign in to comment.