# Julia Surface or Non-Square Heatmap Plots with Spesific Function

**URL:** <https://discourse.julialang.org/t/julia-surface-or-non-square-heatmap-plots-with-spesific-function/97826>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [April 23, 2023, 6:32pm UTC](https://discourse.julialang.org/t/julia-surface-or-non-square-heatmap-plots-with-spesific-function/97826 "2023-04-23T18:32:11Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [April 24, 2023, 6:21pm UTC](https://discourse.julialang.org/t/julia-surface-or-non-square-heatmap-plots-with-spesific-function/97826/4 "2023-04-24T18:21:41Z")

</div>

Could you maybe extend the example to code that we can easily run?  
See [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757).

In your smaller example here

1. Which package are you using? `Plots.jl`?
2. `surface(x,y,Myfun())` does not work, since `MyFun` does not work for zero parameters as it is called here

But if you have a list of points, say

```julia
using Plots
x = [1,1,2,2,3,3]
y = [1,2,2,3,3,4]

```

and have computed

```julia
z = f.(x,y)

```

then

```julia
surface(x,y,z)

```

(from Plots.jl) works just as intended

But note that if you have a point twice, like in the following where I repeated the first

```julia
x = [1,1,1,2,2,3,3]
y = [1,1,2,2,3,3,4]
z = f.(x,y)

```

you get

```julia
julia> surface(x,y,z)
 *** IDENTICAL DATA POINTS.
   NDP = 7 IP1 = 1 IP2 = 2 XD=1 YD=1
 ERROR DETECTED IN ROUTINE IDTANG.

```

Since if a point appears double (in my example the first and the second are both `[1,1]`) the plot does not know what to do (here even\_though\_ the `z` value is the same.

As far as I see the result, `IP1, IP2` tell you the inices (for me nodes 1 and 2, for you 28 and 44) and the `x` and `y` value that is repeated (for me again both are 1 for you the point `(21,6.9282)`.  
In scatter, I think, it will just plot the blue dot twice, but for the surface, you have to avoid duplicates.

I hope I guessed your code correct – and welcome to the Julia forum 🙂

---

_[View the full topic](https://discourse.julialang.org/t/julia-surface-or-non-square-heatmap-plots-with-spesific-function/97826)._
