I dug this problem bit deeper, it seems that my unique is working but
GR.contour seems to be complaining even of close coordinates. I tried
converting everything to Float32 but that didn't help either:
julia> contour(cf[3,:],cf[2,:],cf[1,:])
*** IDENTICAL DATA POINTS.
NDP =12629 IP1 = 23 IP2 = 3286 XD=56192.9 YD=0.55634
ERROR DETECTED IN ROUTINE IDTANG.
julia> cf[:,[23,3286]]
3x2 Array{Float32,2}:
0.0 6.64646e-20
0.55634 0.555965
56192.9 56192.9
Strange...
On Wednesday, July 13, 2016 at 10:58:16 PM UTC+3, Kaj Wiik wrote:
>
> Thanks Josef.
>
> I tried GR contour but got identical datapoint errors. It seems that it's
> not trivial to use unique() other than vectors...could not get it working.
> In fact it seems that the reported datapoints are not in fact identical:
>
> julia> contour(c[1,:],c[2,:],c[3,:])
> *** IDENTICAL DATA POINTS.
> NDP =12629 IP1 = 1 IP2 = 346 XD=1.02114e-99 YD=0.478687
> ERROR DETECTED IN ROUTINE IDTANG.
>
> julia> c[:,1]
> 3-element Array{Float64,1}:
> 1.02114e-99
> 0.478687
> 56193.8
>
> julia> c[:,346]
> 3-element Array{Float64,1}:
> 1.38697e-84
> 0.477974
> 56196.2
>
>
> I tried also to call natgrid directly but it seems to be a can of worms.
>
> Kaj
>
>
> On Saturday, July 9, 2016 at 11:02:23 AM UTC+3, Josef Heinen wrote:
>>
>> You can use the GR framework, e.g.
>>
>> srand(0)
>> xd = -2 + 4 * rand(100)
>> yd = -2 + 4 * rand(100)
>> zd = [Float64(xd[i] * exp(-xd[i]^2 - yd[i]^2)) for i = 1:100]
>>
>> using GR
>> contour(xd, yd, zd, colormap=44)
>>
>>
>> <https://lh3.googleusercontent.com/-2Jv_GQhoJLE/V4CvWwlK5oI/AAAAAAAAADY/dS2YfieTyIEXfUjXoDCNZdnSg0dcevKDwCLcB/s1600/Screen%2BShot%2B2016-07-09%2Bat%2B10.00.51.png>
>>
>> If you only need the gridded data, use the GR gridit function, e.g. (to
>> obtain a 200 x 200 grid):
>>
>> x, y, z = GR.gridit(xd, yd, zd, 200, 200)
>>
>>
>> On Saturday, July 9, 2016 at 12:57:51 AM UTC+2, Kaj Wiik wrote:
>>>
>>> Is there a Julia version of irregularly spaced data gridding that does
>>> zi = griddata(x,y,z,xi,yi), i.e. all arguments are 1d vectors? It seems
>>> that Julia interp and contour packages require x, y, z[x,y].
>>>
>>>
>>> https://scipy.github.io/old-wiki/pages/Cookbook/Matplotlib/Gridding_irregularly_spaced_data.html
>>>
>>> Thanks,
>>> Kaj
>>>
>>>