To be able to edit code and run cells, you need to run the notebook yourself. Where would you like to run the notebook?

This notebook takes about 40 seconds to run.

In the cloud (experimental)

Binder is a free, open source service that runs scientific notebooks in the cloud! It will take a while, usually 2-7 minutes to get a session.

On your computer

(Recommended if you want to store your changes.)

  1. Copy the notebook URL:
  2. Run Pluto

    (Also see: How to install Julia and Pluto)

  3. Paste URL in the Open box

Frontmatter

If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and social media.

Author 1
👀 Reading hidden code
begin
using Plots
plotly()
end
Failed to load integration with PlotlyBase & PlotlyKaleido.
exception
Error message

The package PlotlyBase.jl could not load because it failed to initialize.

That's not nice! Things you could try:

  • Restart the notebook.
  • Try a different Julia version.
  • Contact the developers of PlotlyBase.jl about this error.

You might find useful information in the package installation log:

6.4 s
👀 Reading hidden code
begin
@eval Plots begin
plotlylower(x) = x
plotlylower(x::Vector{<:Number}) = x
plotlylower(x::AbstractVector) = Any[plotlylower(z) for z in x]
plotlylower(d::Dict) = Dict(
for (k,v) in d
)

function _show(io::IO, ::MIME"text/html", plt::Plot{PlotlyBackend})
write(io, html_head(plt))
write(io, """
<div>
<div></div>
<script>
const PLOT = currentScript.parentElement.firstElementChild;
Plotly.plot(PLOT, $(plotly_series_json(plt)), $(plotly_layout_json(plt)));
</script>
</div>
""")
end

plotly_series_json(plt::Plot) = Main.PlutoRunner.publish_to_js(
plotly_series(plt) |> plotlylower
6.1 ms
using PlutoUI
👀 Reading hidden code
81.9 ms
x1 = rand(20)
👀 Reading hidden code
14.2 μs
x2 = rand(20)
👀 Reading hidden code
15.7 μs
p1 = plot(1:20, [x1 x2 rand(20)])
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
3.1 s
plotly()
👀 Reading hidden code
30.2 μs
x; plot(rand(x))
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
52.3 ms
@bind x Slider(1:30000)
👀 Reading hidden code
184 ms
methods (generic function with 6 methods)
methods
👀 Reading hidden code
9.0 μs
p2 = plot(1:20, [x1 x2 rand(20)])
👀 Reading hidden code
Deprecated, use `AbstractPlutoDingetjes.Display.published_to_js(x)` instead of `PlutoRunner.publish_to_js(x)`.
625 μs
MIME type image/svg+xml
s = MIME"image/svg+xml"()
👀 Reading hidden code
2.5 ms
Error message

MethodError: no method matching _show(::IOBuffer, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.PlotlyBackend})

Closest candidates are:

_show(::IO, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.GRBackend}) at ~/.julia/packages/Plots/uiCPf/src/backends/gr.jl:2075

_show(::IO, ::MIME{Symbol("application/vnd.plotly.v1+json")}, ::Plots.Plot{Plots.PlotlyBackend}) at ~/.julia/packages/Plots/uiCPf/src/backends/plotly.jl:1134

_show(::IO, ::MIME{Symbol("text/html")}, ::Plots.Plot{Plots.PlotlyBackend}) at ~/work/disorganised-mess/disorganised-mess/very fast plotly.jl#==#94b5dd13-6a3d-4d7f-ba52-25cb67169ca2:11

...

Stack trace

Here is what happened, the most recent locations are first:

  1. #invokelatest#2
  2. invokelatest
  3. show
  4. __binrepr
  5. _textrepr
  6. #repr#1
  7. repr(s,p1) |> clipboard
repr(s,p1) |> clipboard
👀 Reading hidden code
---
Error message

MethodError: no method matching _show(::IOBuffer, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.PlotlyBackend})

Closest candidates are:

_show(::IO, ::MIME{Symbol("image/svg+xml")}, ::Plots.Plot{Plots.GRBackend}) at ~/.julia/packages/Plots/uiCPf/src/backends/gr.jl:2075

_show(::IO, ::MIME{Symbol("application/vnd.plotly.v1+json")}, ::Plots.Plot{Plots.PlotlyBackend}) at ~/.julia/packages/Plots/uiCPf/src/backends/plotly.jl:1134

_show(::IO, ::MIME{Symbol("text/html")}, ::Plots.Plot{Plots.PlotlyBackend}) at ~/work/disorganised-mess/disorganised-mess/very fast plotly.jl#==#94b5dd13-6a3d-4d7f-ba52-25cb67169ca2:11

...

Stack trace

Here is what happened, the most recent locations are first:

  1. #invokelatest#2
  2. invokelatest
  3. show
  4. __binrepr
  5. _textrepr
  6. #repr#1
  7. repr(s,p2) |> clipboard
repr(s,p2) |> clipboard
👀 Reading hidden code
---