# ImplicitEquations Plot Return Empty Plot

**URL:** <https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [February 6, 2023, 4:27am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117 "2023-02-06T04:27:09Z")\
**Posts on this page:** 9\
**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:** [February 6, 2023, 4:27am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/1 "2023-02-06T04:27:09Z")

</div>

Hi all,

there is a problem with plotting using `ImplicitEquations`:

```julia
using Plots, ImplicitEquations, LaTeXStrings
gr()

f(x,y) = y^2 - 3y - 4 - x
g(x,y) = x+y

plot(f == 0,-5,5, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
	framestyle=:zerolines,
	label="", legend=:topright)
plot!(g == 0,-5,5, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
	framestyle=:zerolines,
	label="", legend=:topright)

```

it returns empty plot.

I want to plot x = y^2 - 3y - 4, x=-y

anyone can help me?

---

<div class="post-metadata">

**Author:** ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)\
**Post date:** [February 6, 2023, 7:26am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/2 "2023-02-06T07:26:20Z")

</div>

The problem is that ImplicitEquations wants you to use a _Unicode operator_ written using `\Equal<tab>` on REPL to get the desired effect.

This is the big fear with Unicode, having minutely perceptible source code differences matter. In any case, here is some code that works:

```julia
julia> plot(f ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
               framestyle=:zerolines,
               label="", legend=:topright)

julia> plot!(g ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
               framestyle=:zerolines,
               label="", legend=:topright)

```

Note that dropping the range `-5,5` is also necessary, since `plot` is specialized for this operator and seems to use the `xlims` and `ylims` to pick range.

Since I only looked at the README at the `ImplicitEquations.jl` repo, it’s possible a deeper look will show more useful functions to pre-prepare the series for plotting exactly as you wish.

---

<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:** [February 6, 2023, 7:40am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/3 "2023-02-06T07:40:19Z")

</div>

I see why it becomes empty plot back then. Thanks

---

<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:** [February 6, 2023, 11:54am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/4 "2023-02-06T11:54:30Z")

</div>

Why there is a weirdness when I want to fill the left side there is an invisible barrier at x=-5

```julia
using Plots, ImplicitEquations

f(x, y) = y^2 - 3y - 4 - x
g(x,y) = x+y

plot(f ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
               framestyle=:zerolines,
               label="", legend=:topright)
plot!(g ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
               framestyle=:zerolines,
               label="", legend=:topright)

plot!((f ≦ 0) & (g ≦ 0), fc=:blues, 
	label="", widen=true)

```

![Capture d’écran_2023-02-06_15-02-09](https://global.discourse-cdn.com/julialang/original/3X/a/4/a47685369903000839bf9f565a5664514cfc69fa.png)

---

<div class="post-metadata">

**Author:** ![j\_verzani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_verzani/32/8551_2.png) [@j\_verzani](https://discourse.julialang.org/u/j_verzani)\
**Post date:** [February 6, 2023, 1:37pm UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/5 "2023-02-06T13:37:22Z")

</div>

> [@Freya\_the\_Goddess](#):
>
> ```julia
> using Plots, ImplicitEquations
> 
> f(x, y) = y^2 - 3y - 4 - x
> g(x,y) = x+y
> 
> plot(f ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
> framestyle=:zerolines,
> label="", legend=:topright)
> plot!(g ⩵ 0, xtick=-7:1:5, xlims=(-7,5), ylims=(-5,5), 
> framestyle=:zerolines,
> label="", legend=:topright)
> 
> plot!((f ≦ 0) & (g ≦ 0), fc=:blues, 
> label="", widen=true)
> 
> ```

There must be a bug in the recipe, try manually adding the `xlims` argument:

```julia
plot!((f ≦ 0) & (g ≦ 0), xlims=(-7,5), fc=:blues, 
               label="", widen=true)

```

---

<div class="post-metadata">

**Author:** ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)\
**Post date:** [February 6, 2023, 4:08pm UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/6 "2023-02-06T16:08:39Z")

</div>

> [@j\_verzani](#):
>
> There must be a bug in the recipe

Yeah, it seems so. Specifically, because `g` function goes out of the viewport below -5, then it is no longer considered in the set `g <= 0` . One way would be to widen the `y-range` a bit… or to dig out this bug.

---

<div class="post-metadata">

**Author:** ![j\_verzani](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j_verzani/32/8551_2.png) [@j\_verzani](https://discourse.julialang.org/u/j_verzani)\
**Post date:** [February 6, 2023, 4:20pm UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/7 "2023-02-06T16:20:18Z")

</div>

There is an issue here: [xlims ylims · Issue #45 · jverzani/ImplicitEquations.jl · GitHub](https://github.com/jverzani/ImplicitEquations.jl/issues/45)

Basically, I need to learn how to get the `xlims` (and `ylims`) from the existing graphic in the recipe.

---

<div class="post-metadata">

**Author:** ![Dan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dan/32/42581_2.png) [@Dan](https://discourse.julialang.org/u/Dan)\
**Post date:** [February 6, 2023, 4:40pm UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/8 "2023-02-06T16:40:54Z")

</div>

One way to hack around this problem is:

```julia
julia> plot!((f ≦ 0) & (g ≦ 0), fc=:blues, 
               label="", ylims=(-10,10), xlims=(-10,10), widen=true)

julia> plot!(fc=:blues, 
               label="", ylims=(-5,5), xlims=(-7,5), widen=true)

```

which draw the right set in the first instance (because of wider `lims` and then zooms back to the narrower `lims`.

---

<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:** [February 7, 2023, 4:38am UTC](https://discourse.julialang.org/t/implicitequations-plot-return-empty-plot/94117/9 "2023-02-07T04:38:23Z")

</div>

This one suggestion works, thanks a lot!
