# Matplotlib & Julia : Pcolormesh and mask

**URL:** <https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792>\
**Category:** General Usage\
**Tags:** pyplot\
**Created:** [January 30, 2017, 10:08pm UTC](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792 "2017-01-30T22:08:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lcambier](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lcambier/32/4072_2.png) [@lcambier](https://discourse.julialang.org/u/lcambier)\
**Post date:** [January 30, 2017, 10:08pm UTC](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792/1 "2017-01-30T22:08:26Z")

</div>

Hi,

I have a 2d matrix with values that I currently plot doing something like  
`axis[:pcolormesh](A', vmin=minimum(A[:]), vmax=0, edgecolor="white")`  
But some values in A are non-relevant and I’d like to give them a white color (or transparent).  
I know that in python we would use a mask ; how can I achieve that in Julia ?  
I found this answer [python - How to get transparency into pcolormesh in JuliaLang? - Stack Overflow](https://stackoverflow.com/questions/35633806/how-to-get-transparency-into-pcolormesh-in-julialang) but I don’t know how to apply it to a case with multiple possible values.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 31, 2017, 12:25am UTC](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792/2 "2017-01-31T00:25:41Z")

</div>

See this issue on how to create a NumPy array with a “mask” from Julia: [https://github.com/JuliaPy/PyPlot.jl/issues/262](https://github.com/JuliaPy/PyPlot.jl/issues/262)

---

<div class="post-metadata">

**Author:** ![josimar](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@josimar](https://discourse.julialang.org/u/josimar)\
**Post date:** [May 11, 2023, 3:55pm UTC](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792/3 "2023-05-11T15:55:48Z")

</div>

Is there an updated solution for this? Should we still use NullableArray? Thanks!
