# Is my plot $-x^{2}$ that has vertical asymptote is correct?

Dear all,

I just want to ask and satisfy my curiosity, I see this

I wonder whether my plotting is correct or not (how to show the - \frac{1}{x-5} graph only the one below x-axis?):


using Plots, LaTeXStrings, Plots.PlotMeasures
gr()

f(x) = -(x-1)^(2)
g(x) = -1/(x-5)

plot(f,-10,10, xticks=false, xlims=(-13,13), ylims=(-33,33),
bottom_margin = 10mm, label=L"f(x) = -(x-1)^{2} ", framestyle = :zerolines,
legend=:outerright)
plot!(g,-10,10, xticks=false, xlims=(-13,13), ylims=(-13,13),
bottom_margin = 10mm, label=L"f(x) = - \frac{1}{x-5} ", framestyle = :zerolines,
legend=:outerright)

scatter!([-1], [f(-1)], color = "red", label=L"(-1,f(-1))", markersize = 2)
scatter!([3], [f(3)], color = "green", label=L"(3,f(3))", markersize = 2)

annotate!([(0.5,0, (L"|", 11, :black))])
annotate!([(1.5,0, (L"|", 11, :black))])
annotate!([(0.5,-1.5, (L"a", 11, :black))])
annotate!([(1.5,-1.5, (L"b", 11, :black))])


I’m confused, what is the difference between what you see and what you expect?

Basically,

I want to create the plot like the one picture that I have attached, my code is close to but not similar to the picture.

Neither -(x-1)^2 nor -1/(x-5) looks like the plot in your graph, so it will be very difficult to make them.

Perhaps it would be easier to help you if you identified one element at a time that you want sorted, instead of trying to get an entire image to match.

1 Like