@@ -752,20 +752,19 @@ Base.length(iter::TimeChoiceIterator) = length(iter.ts)
752
752
idxs = vars
753
753
end
754
754
755
- syms = getsyms (integrator)
756
- int_vars = interpret_vars (idxs, integrator. sol, syms)
757
- strs = cleansyms (syms)
755
+ int_vars = interpret_vars (idxs, integrator. sol)
758
756
759
757
if denseplot
760
758
# Generate the points from the plot from dense function
761
- plott = collect (range (integrator. tprev; step = integrator. t, length = plotdensity))
762
- plot_timeseries = integrator (plott)
759
+ plott = collect (range (integrator. tprev, integrator. t; length = plotdensity))
763
760
if plot_analytic
764
761
plot_analytic_timeseries = [integrator. sol. prob. f. analytic (integrator. sol. prob. u0,
765
762
integrator. sol. prob. p,
766
763
t) for t in plott]
767
764
end
768
- end # if not denseplot, we'll just get the values right from the integrator.
765
+ else
766
+ plott = nothing
767
+ end
769
768
770
769
dims = length (int_vars[1 ])
771
770
for var in int_vars
@@ -779,11 +778,18 @@ Base.length(iter::TimeChoiceIterator) = length(iter.ts)
779
778
end
780
779
781
780
labels = String[]# Array{String, 2}(1, length(int_vars)*(1+plot_analytic))
781
+ strs = String[]
782
+ varsyms = variable_symbols (integrator)
783
+ @show plott
784
+
782
785
for x in int_vars
783
786
for j in 2 : dims
784
787
if denseplot
785
- push! (plot_vecs[j - 1 ],
786
- u_n (plot_timeseries, x[j], integrator. sol, plott, plot_timeseries))
788
+ if (x[j] isa Integer && x[j] == 0 ) || isequal (x[j],getindepsym_defaultt (integrator))
789
+ push! (plot_vecs[j - 1 ], plott)
790
+ else
791
+ push! (plot_vecs[j - 1 ], Vector (integrator (plott; idxs = x[j])))
792
+ end
787
793
else # just get values
788
794
if x[j] == 0
789
795
push! (plot_vecs[j - 1 ], integrator. t)
@@ -793,6 +799,14 @@ Base.length(iter::TimeChoiceIterator) = length(iter.ts)
793
799
push! (plot_vecs[j - 1 ], integrator. u[x[j]])
794
800
end
795
801
end
802
+
803
+ if ! isempty (varsyms) && x[j] isa Integer
804
+ push! (strs, String (getname (varsyms[x[j]])))
805
+ elseif hasname (x[j])
806
+ push! (strs, String (getname (x[j])))
807
+ else
808
+ push! (strs, " u[$(x[j]) ]" )
809
+ end
796
810
end
797
811
add_labels! (labels, x, dims, integrator. sol, strs)
798
812
end
0 commit comments