[yt-users] Set colors of bad values for a colormap?

Yi-Hao Chen yihaochentw at gmail.com
Thu Jul 7 19:30:08 PDT 2016


Hi Nathan,

I did not know that set_cmap can also take a colormap object from
matplotlib. This is very helpful.

Thanks!
Yi-Hao

On Thu, Jul 7, 2016 at 2:27 PM, Nathan Goldbaum <nathan12343 at gmail.com>
wrote:

> Hi Yi-Hao,
>
> The simplest way to do this right now is to create a custom colormap and
> supply it to the set_cmap function. Here's an exmaple:
>
> https://gist.github.com/anonymous/98bd8fcca8da5331f056e0a8ee53fb97
>
> Hope that helps,
>
> Nathan
>
>
>
> On Thu, Jul 7, 2016 at 1:39 PM, Yi-Hao Chen <yihaochentw at gmail.com> wrote:
>
>> Hi all,
>>
>> I have some projection plots that are displayed in log scale. However,
>> some of the pixels have "0" values. The log10 of zero is -inf and yt
>> displays them in white. I am looking for a way to set the color of those
>> pixels. Does anyone know how to do it? Something similar to set_bad()
>> <http://matplotlib.org/api/colors_api.html#matplotlib.colors.Colormap.set_bad>
>> in matplotlib would be really helpful.
>>
>> Cheers,
>> Yi-Hao Chen
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160707/25a0f4ca/attachment.html>


More information about the yt-users mailing list