Plotting not being displayed in Juno IDE
KaioBenedetti opened this issue · 3 comments
I am trying to replicate an example from your tutorials:
https://juliadynamics.github.io/DynamicalSystems.jl/latest/chaos/orbitdiagram/#ChaosTools.poincaresos
and the plotting seems to be broken. Here is the code:
using DynamicalSystems
using PyPlot
ds = Systems.shinriki([-2, 0, 0.2])
pvalues = range(19, stop = 22, length = 401)
i = 1
plane = (2, 0.0)
tf = 200.0
p_index = 1
output = produce_orbitdiagram(ds, plane, i, p_index, pvalues;
tfinal = tf, Ttr = 200.0)
figure()
for (j, p) in enumerate(pvalues)
plot(fill(p, length(output[j])), output[j], lw = 0,
marker = "o", ms = 0.2, color = "black")
end
xlabel("\$R_1\$"); ylabel("\$V_1\$")
tight_layout()
I have got errors in the "figure()" command, which seems to be inexistent. I have tried to change to plots, with the following code:
using DynamicalSystems
using Plots
ds = Systems.shinriki([-2, 0, 0.2])
pvalues = range(19, stop = 22, length = 401)
i = 1
plane = (2, 0.0)
tf = 200.0
p_index = 1
output = produce_orbitdiagram(ds, plane, i, p_index, pvalues;
tfinal = tf, Ttr = 200.0)
pyplot()
for (j, p) in enumerate(pvalues)
plot(fill(p, length(output[j])), output[j], lw = 0,
marker = "o", ms = 0.2, color = "black")
end
The program did get executed, but I have got no graph output.
I tried to rebuild the Plots package, with no success either.
Is output
valid? Can you paste what output
is? If output
is valid, and produce_orbitdiagram
works as expected, then this issue is unrelated with DynamicalSystems.jl and you will have much better luck finding out why it doesn't plot if you ask in the plotting community's forum, or the Juno issue tracker.
Does plot(rand(10))
by itself work?
Unfortunately I can't help you with plotting problems, simply because I Don't know enough about their internals...
The plot(rand(10))
works only when typed directly in the REPL. Not in a .jl file.
About the output
:
julia> typeof(output) Array{Array{Float64,1},1}
Okay, thanks. This issue is not related with DynamicalSystems.jl therefore, but with Juno. Please consider opening a new issue in Juno's GitHub page to get more help.