# How to plot a function with complex values?

**URL:** <https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026>\
**Category:** General Usage\
**Tags:** question, plot, complex-numbers\
**Created:** [November 10, 2022, 5:32am UTC](https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026 "2022-11-10T05:32:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)\
**Post date:** [November 10, 2022, 5:32am UTC](https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026/1 "2022-11-10T05:32:43Z")

</div>

I’d like to plot a function on the complex plane, but I’m not very familiar with complex numbers in Julia anymore.

How to plot h\_z(x)= e^{i \langle z,x \rangle}- 1 when z is fixed? For example, z=(1,1). How to visualize this function?

A more specific question would be, how to visualize the image of a region R = [0,1]\times [0,1], for example.

What are the best packages to implement and visualize this?

---

<div class="post-metadata">

**Author:** ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)\
**Post date:** [November 10, 2022, 7:07am UTC](https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026/2 "2022-11-10T07:07:44Z")

</div>

I don’t know what \langle z,x\rangle means here, but I can make a circle.

```julia
using Plots
plot(exp.(im*(0:0.001π:2π)))

```

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [November 10, 2022, 8:04am UTC](https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026/4 "2022-11-10T08:04:52Z")

</div>

I think this problem is covered in these two posts: [here](https://discourse.julialang.org/t/how-to-set-ticklabels-for-an-image-within-the-range-of-x-and-y/63637) and [here](https://discourse.julialang.org/t/complex-colormap-in-julia-plots/84212/3).

---

<div class="post-metadata">

**Author:** ![maoc](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@maoc](https://discourse.julialang.org/u/maoc)\
**Post date:** [November 10, 2022, 12:46pm UTC](https://discourse.julialang.org/t/how-to-plot-a-function-with-complex-values/90026/5 "2022-11-10T12:46:42Z")

</div>

\langle z,x \rangle means inner product. In other way: z’x where x is a two-dimensional vector and ’ is the transpose operator. Remember that z is also a two-dimensional vector.
