Connect plot in Contourf when there are missing values(nan)

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

Connect plot in Contourf when there are missing values(nan)

apu
I am plotting x, y, z values using contourf plots. However I have some
missing z values (nan). All these regions are shown as blanks and the graph
looks diconnected.

Is there a way for the plot to have connected gaps? Plotly has an option to
connect gaps with smooth transitions?
https://plot.ly/python/contour-plots/#connect-the-gaps-between-none-values-in-the-z-matrix

Do we have an equivalent of this in matlotlib contourf plots?



--
Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Connect plot in Contourf when there are missing values(nan)

Eric Firing
I just found this unread in my email stack--did anyone reply to you
already?  If not, the answer to your question is no, matplotlib declines
to fill bad value gaps via interpolation.  We believe that as a plotting
library, we should generally plot the data as provided, leaving it to
the user to interpolate over gaps, if that is desired.

Eric

On 2020/02/19 9:42 PM, apu wrote:

> I am plotting x, y, z values using contourf plots. However I have some
> missing z values (nan). All these regions are shown as blanks and the graph
> looks diconnected.
>
> Is there a way for the plot to have connected gaps? Plotly has an option to
> connect gaps with smooth transitions?
> https://plot.ly/python/contour-plots/#connect-the-gaps-between-none-values-in-the-z-matrix
>
> Do we have an equivalent of this in matlotlib contourf plots?
>
>
>
> --
> Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
> _______________________________________________
> Matplotlib-users mailing list
> [hidden email]
> https://mail.python.org/mailman/listinfo/matplotlib-users
>

_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users