>>>>> "Tim" == Tim Bond <[EMAIL PROTECTED]> writes:
Tim> Hullo, I wonder if someone could help me out?
I'll try. Sorry for the delayed response.
Tim> I'm having trouble figuring out how to set a custom scale on
Tim> a colormap in Mayavi2. I'm reading in an unstructured grid
Tim> and plotting a scalar cut plane with warping, viz:
Tim> http://amcg.ese.ic.ac.uk/~tmb1/scalarvertscutwarp.png
Tim> The warping works nicely to pick out the scalar field
Tim> details, but the colormap is scaling to the entire scalar
Tim> dataset (which lower in the mesh has much greater range than
Tim> at the top of the mesh) hence showing minimal detail at my
Tim> cut.
You could set the data range to something more relevant. The only
difficulty in that case is that anything outside the range you specify
will be rendered with the same colour.
Tim> What I'd like to do is to reset the colormap scale such that
Tim> it is somewhere near the minimum and maximum of my cut plane,
Tim> not the minimum and maximum of the whole field.
Yes, you can do that. Just go to the "Modules" node on the tree view
deselect the use default range and specify the range you need. This
should do the trick.
Tim> Having worked through the source it looks like I can do this
Tim> by changing vmin and vmax, but I can't figure out what they
Tim> are traits of and thus I'm stumped as to how I would do this
Tim> working from the python command line in Mayavi2.
On the command line lets say you have this:
s = ScalarCutPlane()
mayavi.add_module(s)
Now to change this do the following:
s.module_manager.scalar_lut_manager.use_default_range = False
s.module_manager.scalar_lut_manager.data_range = [smin, smax]
HTH.
cheers,
prabhu
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users