[Matplotlib-devel] Need some help in 3D surface plotting...

Benjamin Root ben.v.root at gmail.com
Tue Mar 13 09:29:07 EDT 2018


The error message means you have an old version of matplotlib. Inferno was
added in version 1.5. We are currently at verson 2.2.1 (supposedly will be
released today?). I would also wonder if your install of numpy is old as
well. Chances are, you are hitting on some old forgotten bug. Could you try
updating your packages?

On Tue, Mar 13, 2018 at 6:49 AM, phanids <phanikumar.ds at gmail.com> wrote:

> Hi Adrien,
>
> Thanks a lot. I tried your suggestion and initial got
>
> root at phani:/home/pi/SampleExample# python Trial1.py
> Traceback (most recent call last):
>   File "Trial1.py", line 46, in <module>
>     surf = ax.plot_surface(xx, yy, zz, cmap="inferno")
>   File "/usr/lib/python2.7/dist-packages/mpl_toolkits/mplot3d/axes3d.py",
> line 1637, in plot_surface
>     polyc = art3d.Poly3DCollection(polys, *args, **kwargs)
>   File "/usr/lib/python2.7/dist-packages/mpl_toolkits/mplot3d/art3d.py",
> line 476, in __init__
>     PolyCollection.__init__(self, verts, *args, **kwargs)
>   File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line
> 799, in __init__
>     Collection.__init__(self, **kwargs)
>   File "/usr/lib/python2.7/dist-packages/matplotlib/collections.py", line
> 107, in __init__
>     cm.ScalarMappable.__init__(self, norm, cmap)
>   File "/usr/lib/python2.7/dist-packages/matplotlib/cm.py", line 197, in
> __init__
>     self.cmap = get_cmap(cmap)
>   File "/usr/lib/python2.7/dist-packages/matplotlib/cm.py", line 163, in
> get_cmap
>     % (name, ', '.join(cmap_d.keys())))
> ValueError: Colormap inferno is not recognized. Possible values are:
> Spectral, summer, coolwarm, Wistia_r, pink_r, Set1, Set2, Set3, brg_r,
> Dark2, prism, PuOr_r, afmhot_r, terrain_r, PuBuGn_r, RdPu, gist_ncar_r,
> gist_yarg_r, Dark2_r, YlGnBu, RdYlBu, hot_r, gist_rainbow_r, gist_stern,
> PuBu_r, cool_r, cool, gray, copper_r, Greens_r, GnBu, gist_ncar, spring_r,
> gist_rainbow, gist_heat_r, Wistia, OrRd_r, CMRmap, bone, gist_stern_r,
> RdYlGn, Pastel2_r, spring, terrain, YlOrRd_r, Set2_r, winter_r, PuBu,
> RdGy_r, spectral, rainbow, flag_r, jet_r, RdPu_r, gist_yarg, BuGn,
> Paired_r,
> hsv_r, bwr, cubehelix, Greens, PRGn, gist_heat, spectral_r, Paired, hsv,
> Oranges_r, prism_r, Pastel2, Pastel1_r, Pastel1, gray_r, jet, Spectral_r,
> gnuplot2_r, gist_earth, YlGnBu_r, copper, gist_earth_r, Set3_r, OrRd,
> gnuplot_r, ocean_r, brg, gnuplot2, PuRd_r, bone_r, BuPu, Oranges, RdYlGn_r,
> PiYG, CMRmap_r, YlGn, binary_r, gist_gray_r, Accent, BuPu_r, gist_gray,
> flag, bwr_r, RdBu_r, BrBG, Reds, Set1_r, summer_r, GnBu_r, BrBG_r, Reds_r,
> RdGy, PuRd, Accent_r, Blues, autumn_r, autumn, cubehelix_r,
> nipy_spectral_r,
> ocean, PRGn_r, Greys_r, pink, binary, winter, gnuplot, RdYlBu_r, hot,
> YlOrBr, coolwarm_r, rainbow_r, Purples_r, PiYG_r, YlGn_r, Blues_r,
> YlOrBr_r,
> seismic, Purples, seismic_r, RdBu, Greys, BuGn_r, YlOrRd, PuOr, PuBuGn,
> nipy_spectral, afmhot
> root at bitscope:/home/pi/SampleExample#
>
> So I thought the color scheme "inferno" is not supported (or may be not
> installed in my pi). So I changed it to "coolwarm" and I see the image as
> below.
>
> <http://matplotlib.1069221.n5.nabble.com/file/t5142/plasma.png>
>
> Though this is way better than my initial version, still I see only 2 color
> combination... may be I need to check with color schemes provided in the
> error message.
>
> Thanks a lot any way. Also let me know if you think any suitable color
> scheme for this kind of gradient.
>
> Will check with you on other technical questions after I finish this.
>
> Thanks again,
>
> With best regards,
> Phani.
>
>
>
> --
> Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-devel-
> f28077.html
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20180313/2e090603/attachment-0001.html>


More information about the Matplotlib-devel mailing list