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

**URL:** <https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [October 15, 2022, 3:20pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781 "2022-10-15T15:20:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [October 15, 2022, 3:20pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781/1 "2022-10-15T15:20:28Z")

</div>

Dear all,

I just want to ask and satisfy my curiosity, I see this  
 ![Capture d’écran_2022-10-15_22-14-12](https://global.discourse-cdn.com/julialang/original/3X/4/4/44a1438196a6928d561a443d6135968f3d2e0c99.png)

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

```julia

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))])

```

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [October 15, 2022, 6:47pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781/2 "2022-10-15T18:47:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [October 15, 2022, 7:04pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781/3 "2022-10-15T19:04:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [October 15, 2022, 7:15pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781/4 "2022-10-15T19:15:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Freya\_the\_Goddess](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/freya_the_goddess/32/36835_2.png) [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Post date:** [October 22, 2022, 5:32pm UTC](https://discourse.julialang.org/t/is-my-plot-x-2-that-has-vertical-asymptote-is-correct/88781/5 "2022-10-22T17:32:17Z")

</div>

Yes, thanks for the advice
