Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: recommend plot instead of PlutoPlot(Plot(...)) #41

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading