On 23/07/12 17:21, Ryan wrote:

> vfig.Add('contour',name='gbContour',autoadd=False)
> vfig.To('gbContour')
> vfig.SetData2D('grid', dats, xrange=(-5,5), yrange=(-5,5))
> vfig.Set('numLevels', 31)

I don't think you're associating the contour widget with the new
dataset, so you need something like

vfig.Set('data', 'grid')

at the end. The SetData2D just creates a new 2D dataset. If you put a
vfig.Save('out.vsz') at the end you'll be able to load it into veusz to
see what went wrong.

You might want to use the new object API - see
http://barmag.net/veusz-wiki/EmbeddingPython - which makes things a lot
cleaner than the syntax used in saved files.

e.g.

graph = vfig.Root.Add('page').Add('graph')
contour = graph.Add('contour')
contour.numLevels.val = 31
contour.data.val = 'grid'

Jeremy

_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à