@@ -83,7 +83,7 @@ DEFAULT_PLOT_FUNC(x,y,z) = (x,y,z) # For v0.5.2 bug
83
83
seriestype --> :path
84
84
85
85
# Special case labels when vars = (:x,:y,:z) or (:x) or [:x,:y] ...
86
- if typeof (vars) <: Tuple && (typeof (vars[1 ]) == Symbol && typeof (vars[2 ]) == Symbol)
86
+ if typeof (vars) <: Tuple && (issymbollike (vars[1 ]) && issymbollike (vars[2 ]))
87
87
xguide --> strs[int_vars[1 ][2 ]]
88
88
yguide --> strs[int_vars[1 ][3 ]]
89
89
if length (vars) > 2
@@ -165,6 +165,7 @@ function cleansym(sym::Symbol)
165
165
str = String (sym)
166
166
replace (str," ₊" => " ." ) # Fix MTK component syntax
167
167
end
168
+ issymbollike (x) = typeof (x) <: Symbol || Symbol (typeof (x)) == :Operation || Symbol (typeof (x)) == :Variable
168
169
169
170
function diffeq_to_arrays (sol,plot_analytic,denseplot,plotdensity,tspan,axis_safety,vars,int_vars,tscale,strs)
170
171
if tspan === nothing
@@ -248,7 +249,7 @@ function interpret_vars(vars,sol,syms)
248
249
if typeof (var) <: Union{Tuple,AbstractArray} # eltype(var) <: Symbol # Some kind of iterable
249
250
tmp = []
250
251
for x in var
251
- if typeof (x) <: Symbol || Symbol ( typeof (x)) == :Operation || Symbol ( typeof (x)) == :Variable
252
+ if issymbollike (x)
252
253
push! (tmp,something (findfirst (isequal (Symbol (x)), syms), 0 ))
253
254
else
254
255
push! (tmp,x)
@@ -259,7 +260,7 @@ function interpret_vars(vars,sol,syms)
259
260
else
260
261
var_int = tmp
261
262
end
262
- elseif typeof (var) <: Symbol || Symbol ( typeof (var)) == :Operation || Symbol ( typeof (var)) == :Variable
263
+ elseif issymbollike (var)
263
264
var_int = something (findfirst (isequal (Symbol (var)), syms), 0 )
264
265
else
265
266
var_int = var
0 commit comments