colored wireframe plot in matplotlib

前端 未结 3 1524
半阙折子戏
半阙折子戏 2021-01-04 03:05

I am trying to color a wireframe plot according to the z-value. I can\'t find any code examples on the internet.

Here is an example of a surface plot that has the co

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-04 03:39

    I had a similar problem with coloring and sizing circles according to a variable which did not work either. So my workaround was to bin the values of the variables and loop over the bins. I masked the data such that the array mask did only contain the data with values in that bin.

    ax.plot_wireframe(mask[i], ..., color="red")
    ax.plot_wireframe(mask[i], ..., color="blue") 
    etc.
    

    I know it's not very elegant but in my case it did the job ;)

提交回复
热议问题