问题
when I use
%matplotlib notebook
import matplotlib.pyplot as plt
I get interactive plots, i.e. I can also zoom into the figure.
For julia this command does not seem to exist. Any ideas?
回答1:
You can get interactive plots by using Plotly, either directly with Plotly.jl or through its Plots backend.
回答2:
Today I am thinking about how to enlarge the plot window interactively without referring to python
or plotly
or something else in Jupiter notebook. And I find a good solution. It is to use the package Interact
. A simple example is as follows. You can get an interactive plot in 3 lines.
import Pkg; Pkg.add("Interact")
using LinearAlgebra, Plots, Interact
@manipulate for n in 10:100, w in 200:1000, h in 200:1000
plot(randn(n),randn(n),seriestype=:scatter,label="n=$(n)",size = (w, h))
end
The result looks like this
来源:https://stackoverflow.com/questions/58014289/inline-interactive-plots-with-julia-in-jupyter-notebook