Hi all,
I have this code to plot interval notation:
using Plots, LaTeXStrings, Plots.PlotMeasures
f(x) = 0.1
plot([0.3,0.9],[0,0],arrow=true,color=:black,linewidth=2, xticks=false, yticks=false,
ylims=(0,1), showaxis=false, label="", bottom_margin = 10mm)
#plot!(f,0.55,0.7, fill=(0, 0.2, :green), label="")
annotate!([(0.4,0, (L"|", 17, :black))])
annotate!([(0.4,-0.1, (L"-1", 10, :black))])
annotate!([(0.6,0, (L"|", 17, :black))])
annotate!([(0.6,-0.1, (L"3", 10, :black))])
annotate!([(0.4,0.1, (L"0", 10, :black))])
annotate!([(0.6,0.1, (L"0", 10, :black))])
annotate!([(0.35,0.1, (L"+", 10, :red))])
annotate!([(0.5,0.1, (L"-", 10, :black))])
annotate!([(0.65,0.1, (L"+", 10, :red))])
annotate!([(0.35,0.2, (L"f'(x)", 12, :black))])
Now, I want to plot multiple interval notations (not just 1 interval notation) with plots layout, but I don’t know how…
I want to be like this:
I was thinking of using:
plot(p1, p2, layout = (2, 1), legend=:outerright,
xaxis = "x", yaxis = "y(x)", label=[s1 s2])
But, since I am using annotate
it can’t be done easily…
Anyone can help me? Thanks.