a = zeros(n,n,n)
scene = volume(a)
vol_plot = scene[end] # end --> last plot
record("file.mp4",1:100) do i
func!(a)
vol_plot[1] = a # update values passed by first argument
end
It means last plot in the scene, first positional argument of that plot. As positional arguments are always internally converted to observables this lets you change the observable as if you had created it yourself and passed it in
Thanks. The Node documentation is clear now. I didn’t understand that the empty index a[] was triggering the update. Is there a more explicit way to do that?
The only place on the animation page I see the [end]-style used is in this example.
Sorry to resurrect this, but I’ve got another n00b issue. It seems like all the volume plot methods are set up for sequential data (colorrange=(0,1) where 0 is background and 1 is what we want to visualize) but what about divergent data? Is there something for colorrange=(-1,1) where 0 is background and +1 is one extreme and -1 is the other?
Alternatively, is there some way to achieve isovalue=(-1,1)? Doing two plots with isovalue=-1 and isovalue=1 doesn’t work since the second one just overlays the first and so they don’t line up three-dimensionally as they should.
contour (I guess I was more tired than I thought last night.)
I’m not sure what you mean … You can use whatever colormap you want colormap=any_array_of_colors
For the volume rendering, I’m not looking for a color map, but an alpha or absorption map. So, maybe like absorption=[-1,1] so that regions that are both below -1 and above 1 show up in the volume plot (as different colors), but not regions with values around 0.
For example, I coded this up long ago (in Fortran, because I’m a masochist)