如何让在matplotlib条3D效果? [英] how to make a 3d effect on bars in matplotlib?
问题描述
我有一个非常简单的基本栏的图形像这样的
I have a very simple basic bar's graphic like this one
但我想用一些3D效果显示的吧,这样的
but i want to display the bars with some 3d effect, like this
我只想酒吧有3D效果......我的code是:
I just want the bars to have that 3d effect...my code is:
fig = Figure(figsize=(4.6,4))
ax1 = fig.add_subplot(111,ylabel="Valeur",xlabel="Code",autoscale_on=True)
width = 0.35
ind = np.arange(len(values))
rects = ax1.bar(ind, values, width, color='#A1B214')
ax1.set_xticks(ind+width)
ax1.set_xticklabels( codes )
ax1.set_ybound(-1,values[0] * 1.1)
canvas = FigureCanvas(fig)
response = HttpResponse(content_type='image/png')
canvas.print_png(response)
我一直在寻找在matplotlib的画廊,尝试了一些事情,但我不是很幸运,任何想法? Thxs
i've been looking in the gallery of matplotlib,tried a few things but i wasn't lucky, Any ideas? Thxs
推荐答案
据我所知Matplotlib没有设计您刚才提到像3D效果的支持功能。我记得曾读到这一段时间回来。我的不知道它在此期间的改变。
As far as I know Matplotlib doesn't by design support features like the "3D" effect you just mentioned. I remember reading about this some time back. I don't know it has changed in the meantime.
有关详细请参见本话题详细信息。
See this discussion thread for more details.
更新
看看约翰·波特 mplot3d 模块。这不是标准matplotlib但自定义扩展的一部分。从未使用过它自己,所以不能说太多关于它的用处。
Take a look at John Porter's mplot3d module. This is not a part of standard matplotlib but a custom extension. Never used it myself so can't say much about its usefulness.
这篇关于如何让在matplotlib条3D效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!