0

Same Python Script if i use for my Matplotlib plot then i am getting the plot with Tripcolor but i want the plot with Tricontourf ,

Error which i am getting with Tricontourf is given below :- **/home/username/.local/lib/python3.5/site-packages/numpy/core/_methods.py:28: RuntimeWarning: invalid value encountered in reduce return umr_maximum(a, axis, None, out, keepdims, initial)

/home/username/.local/lib/python3.5/site-packages/numpy/core/_methods.py:32: RuntimeWarning: invalid value encountered in reduce return umr_minimum(a, axis, None, out, keepdims, initial)

/home/username/.local/lib/python3.5/site-packages/matplotlib/contour.py:1203: RuntimeWarning: invalid value encountered in less under = np.nonzero(lev < self.zmin)[0]

/home/username/.local/lib/python3.5/site-packages/matplotlib/contour.py:1205: RuntimeWarning: invalid value encountered in greater over = np.nonzero(lev > self.zmax)[0]**

Can anyone can please help me how i can get Tricontourf plot with my script , where i need to modify the code. Code i am using is given below :-

    tri_sub = tri_new.apply(lambda x: x - 1)
    triang = mtri.Triangulation(x1, y1, triangles=tri_sub)
    cmap = plt.cm.rainbow

    cmap.set_under('w', 0.1)
    pp = plt.tricontourf(triang, req_elevation, cmap=cmap, vmin=req_elevation.min(),   
    vmax=req_elevation.max())
    cmap.set_under('w', 0.1)
MSA msa
  • 83
  • 1
  • 10
  • 1
    Which version of matplotlib? Can you check the minimum value of tri_sub? It should not be negative. – Patol75 Dec 04 '19 at 07:24
  • matplotlib version 3.0.2, Trisub is contain nodes number of elements and minimum value is 0 , trisub not contain negative – MSA msa Dec 09 '19 at 09:43
  • Thanks. Well, if you are willing to upload your data, I am happy to have a look. As it stands now, I do not see where the problem is. – Patol75 Dec 09 '19 at 10:05
  • Hi , can u help me with this question related to plot only . https://stackoverflow.com/questions/59246874/showing-z-value-as-an-annotation-when-z-value-is-0-85-tripcolor-matplotlib – MSA msa Dec 09 '19 at 10:40

0 Answers0