# ComplexRegions.jl Package to plot complex plot z = a +ib

**URL:** <https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [September 9, 2022, 11:26am UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982 "2022-09-09T11:26:31Z")\
**Posts on this page:** 10\
**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:** [September 9, 2022, 11:26am UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/1 "2022-09-09T11:26:31Z")

</div>

Hi all,

I am trying to add this package: ComplexRegions.jl

then it comes:

 ![Capture d’écran_2022-09-09_17-57-00](https://global.discourse-cdn.com/julialang/original/3X/6/d/6d538fec2f9608f6caaf7be8eae3f1dbc2a00a76.png)

I want to plot a simple complex equation like:

```julia
z = 3 -i

```

But I can’t even add the package, due to some restriction / problem with Colors package, I still don’t get what to do when @nilshg share the solution on this type of problem.

---

<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:** [September 9, 2022, 11:45am UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/2 "2022-09-09T11:45:10Z")

</div>

I don’t know the package or why it has those compat limitations. But if you just want to plot a single complex number you don’t need it: `plot([z]; st=:scatter)`

---

<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:** [September 9, 2022, 11:47am UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/3 "2022-09-09T11:47:08Z")

</div>

> [@gustaphe](#):
>
> `plot([z]; st=:scatter)`

Thanks @gustaphe …

How about create an imaginary circle ? circle with imaginary y-axis?

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [September 9, 2022, 11:59am UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/4 "2022-09-09T11:59:44Z")

</div>

The package is quite old, and requires older versions of some packages than you currently have installed.

You can just create a new empty project, and install this package with its older dependencies.

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [September 9, 2022, 12:13pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/5 "2022-09-09T12:13:30Z")

</div>

(When I worked in a restaurant, we had different chopping boards and knife sets for different dishes. So if, for example, we were preparing Oranges in Cointreau, we set up a new workspace so that it didn’t smell of chopped garlic or parsley. Similarly, you don’t always want traces of one Julia project spilling over into another. )

---

<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:** [September 9, 2022, 12:15pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/6 "2022-09-09T12:15:41Z")

</div>

I didn’t know you were working in a restaurant, or just creating an illustration.

I try to create an environment for `Real Analysis` that currently needs ComplexRegions.jl. But, turns out, the package is too old and can’t be made to work with other installed package.

---

<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:** [September 9, 2022, 12:20pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/7 "2022-09-09T12:20:54Z")

</div>

Hey, this problem of mine can be used to improve Julia…

instead of trying to downgrade package, how to tinker Julia source code so I still can use ComplexRegions.jl without creating new environment?

Is there any book to `unfold Julia`, or `learn to improve Julia Source Code` ?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [September 9, 2022, 1:03pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/8 "2022-09-09T13:03:55Z")

</div>

The issue here is not about “Julia Source Code”, simply about packages having incompatible version specifications in their respective `Project.toml` files. So you don’t need to tinker with Julia source code, but simply with the code for the package which set the boundaries in its `Project.toml`.

In this case it appears that both `ComplexRegions` and `Implicit3DPlotting` haven’t been updated in a while and restrict you to quite old versions of dependencies (with `ComplexRegions` restricting `Colors` to 0.9, and `Implicit3DPlotting` restricting `*Makie` to 0.3).

If you absolutely want to use these packages together you will therefore need to edit the `Project.toml` of either of them, or maybe even both (I haven’t tried to work out what the easiest way is, but it seems trying to bump the `Color` compat entry in `ComplexRegions` would be one possible solution).

To do that you need to `dev` the package, then change the compat bounds in `Project.toml` locally, see whether the package still works with the new version of its `Colors` dependency, and then fix any errors you might run into (which is expected, as `Colors` 0.11 is two breaking releases on from 0.9). If you’ve managed to make it all work you could then even open a PR on the `ComplexRegions` repo with your local changes to make them available to others.

---

<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:** [September 9, 2022, 1:11pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/9 "2022-09-09T13:11:47Z")

</div>

Thanks for the advice to edit `Project.toml`, I will try it.

---

<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:** [September 9, 2022, 1:36pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982/10 "2022-09-09T13:36:43Z")

</div>

```julia
plot(exp.(im*range(0, 2π; length=100)))

```
