Julia:循环中的 ImplictPlots:设置颜色
Julia: ImplictPlots in a loop: setting colors
如何使用 implicit_plot
分配颜色?
using ImplicitPlots, Plots
v = [(x,y) -> (x+3)*(y^3-7)+18, (x,y) -> sin(y*exp(x)-1)]
p = plot()
for f in v
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), framestyle = :origin, lc = [:red, :blue])
end
p
我期待的是:
lc = [:red, :blue]
for (i, f) in enumerate (v)
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), lc = lc[i])
end
如何为第二个函数传递蓝色渐变? (我可以传递 lc = :blues
但这也会使第一行变成蓝色。)
额外问题:我可以将向量或元组传递给 implicit_plot
吗?估计是不支持。
你确定它不起作用吗?我试过了
lc = [:red, :blue]
for (i, f) in enumerate(v)
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), lc = lc[i])
end
我得到了
(您在 enumerate
中有一个额外的 space,这可能让您失望了?)
不确定函数元组。
如何使用 implicit_plot
分配颜色?
using ImplicitPlots, Plots
v = [(x,y) -> (x+3)*(y^3-7)+18, (x,y) -> sin(y*exp(x)-1)]
p = plot()
for f in v
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), framestyle = :origin, lc = [:red, :blue])
end
p
我期待的是:
lc = [:red, :blue]
for (i, f) in enumerate (v)
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), lc = lc[i])
end
如何为第二个函数传递蓝色渐变? (我可以传递 lc = :blues
但这也会使第一行变成蓝色。)
额外问题:我可以将向量或元组传递给 implicit_plot
吗?估计是不支持。
你确定它不起作用吗?我试过了
lc = [:red, :blue]
for (i, f) in enumerate(v)
implicit_plot!(f; xlims = (-1, 3), ylims = (-1, 2), lc = lc[i])
end
我得到了
(您在 enumerate
中有一个额外的 space,这可能让您失望了?)
不确定函数元组。