Julia Surface or Non-Square Heatmap Plots with Spesific Function

Could you maybe extend the example to code that we can easily run?
See Please read: make it easier to help you.

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

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

and have computed

z = f.(x,y)

then

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

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

you get

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 :slight_smile:

1 Like