NaN Color?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

NaN Color?

Dimagiba, Lorenzo
So I'm making a surface using the mlab.mesh function, and to color it I have my own set of scalars. In my set of scalars there sometimes appears NaN values, which get shown on the surface as a dark red/maroon color. I was wondering if it might be possible to change this color?

Thanks

This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient.
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited.
If you have received this e-mail in error, please contact the sender and delete all copies.
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: NaN Color?

Marcel Hubble
Hi, I would suggest to replace the NaN in your data by a value you like(that gives you the right color)

numpy has 2 functions to do this:

data(np.isnan(data))=42 #Or any value you like

or

np.nan_to_num(data)
which returns your array where NaN have been replaced by 0

Hope this helps

On Thu, Dec 20, 2012 at 10:09 PM, Dimagiba, Lorenzo <[hidden email]> wrote:
So I'm making a surface using the mlab.mesh function, and to color it I have my own set of scalars. In my set of scalars there sometimes appears NaN values, which get shown on the surface as a dark red/maroon color. I was wondering if it might be possible to change this color?

Thanks

This e-mail may contain confidential and/or privileged information for the sole use of the intended recipient.
Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited.
If you have received this e-mail in error, please contact the sender and delete all copies.
Opinions, conclusions or other information contained in this e-mail may not be that of the organization.

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev