# \[Makie\] "MetaData array needs to have same length as data" error with observables and contourf

**URL:** <https://discourse.julialang.org/t/makie-metadata-array-needs-to-have-same-length-as-data-error-with-observables-and-contourf/86789>\
**Category:** General Usage\
**Tags:** package, makie\
**Created:** [September 5, 2022, 8:58am UTC](https://discourse.julialang.org/t/makie-metadata-array-needs-to-have-same-length-as-data-error-with-observables-and-contourf/86789 "2022-09-05T08:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ManuelFossa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manuelfossa/32/36305_2.png) [@ManuelFossa](https://discourse.julialang.org/u/ManuelFossa)\
**Post date:** [September 5, 2022, 8:58am UTC](https://discourse.julialang.org/t/makie-metadata-array-needs-to-have-same-length-as-data-error-with-observables-and-contourf/86789/1 "2022-09-05T08:58:14Z")

</div>

I try to plot an animation of contours with GLMakie and GeoMakie, using observables.  
This used to work , but I updated my Julia from 1.7.2 to 1.8 then it broke, with the error in the title occurring. I reverted to 1.7.2, removed all packages, reinstalled them (standard procedure), but it still throws the same error. I updated the packages to the latest versions, but it still does the same. I guess this as something to do with the observable variable because a simple countourf plot of the `inputData` works

```julia
using GLMakie , GeoMakie , Makie , Makie.ColorSchemes , Observables , MakieTeX , LazyGrids ,FileIO
nLat = 181
nLon = 221
nt = 500
inputData = Array{Float64,3)(undef , nLat , nLon , nt)
field = permutedims(inputData , (2,1,3))
latLim = (30,75)
lonLim = (-30,25)
points = (longitudeOfaRefPoint, latitudeOfaRefPoint)
imgName = "animationContour.mkv" 
titleString = "animationStep: "
idx = Observable(1)

data = lift(idx) do i
  field[:, :, i] 
end

titlestr = lift(x -> titleString*" = "*string(x), idx)
  
fig = Figure(resolution = (2560 , 1440))
ga = GeoAxis(
fig[1, 1],
coastlines = true,
dest = "+proj=eqc",
lonlims = lonLim,
latlims = latLim,
title = titlestr)

sp = contourf!(ga, lons, lats, data ; shading=false, colormap=:inferno)
scatter!(ga , points , color="white" , markersize=20)
cb = Colorbar(fig[1, 2],sp)
tightlimits!(ga)

record(fig, imgName, 1:size(field, 3); framerate = 30) do i
  idx[] = i
end

```

GLMakie v0.6.13  
GeoMakie v0.4.2  
Makie v0.17.13  
Observables v0.5.1  
MakieTeX v0.2.3  
LazyGrids v0.4.0  
FileIO v1.15.0

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [September 5, 2022, 9:09am UTC](https://discourse.julialang.org/t/makie-metadata-array-needs-to-have-same-length-as-data-error-with-observables-and-contourf/86789/2 "2022-09-05T09:09:38Z")

</div>

This seems to be a regression stemming from changes to `poly` which underlies `contourf`. I think there’s already an issue for it on Github, so hopefully it will be fixed soon. You could revert to an earlier version of Makie, probably `v0.17.12` will work as the changes went into 13

---

<div class="post-metadata">

**Author:** ![ManuelFossa](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manuelfossa/32/36305_2.png) [@ManuelFossa](https://discourse.julialang.org/u/ManuelFossa)\
**Post date:** [September 5, 2022, 9:44am UTC](https://discourse.julialang.org/t/makie-metadata-array-needs-to-have-same-length-as-data-error-with-observables-and-contourf/86789/3 "2022-09-05T09:44:04Z")

</div>

Thank you Jules. Indeed there is a GitHub issue opened but so far, no answer.  
Reverting back to v0.17.12 worked.
