Hello all.

I'm attempting to use bar3d to plot a packing solution but from some
viewpoints the perspective is wrong (boxes seem overlapped), and with a
large number of boxes the plot is always incoherent.

(I'm using matplotlib 1.0.0 on fedora 14)

Does anyone know how to fix this?

Cheers,
Miguel

Example code:
-----------------------------------------------------------------------

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

# setup figure
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlim3d(0, 10)
ax.set_ylim3d(0, 10)
ax.set_zlim3d(0, 10)

# boxes       
x = [0,2,0,2,0]
y = [0,0,2,2,0]
z = [0,0,0,0,2]
dx = [2,2,2,2,3]
dy = [2,2,2,2,3]
dz = [2,2,2,2,3]
colors = ['b','b','b','b','g']

# draw
ax.bar3d(x, y, z, dx, dy, dz, color=colors, alpha=1.0)

# perspective
ax.view_init(azim=48.0, elev=20.0) # problem
#ax.view_init(azim=48.0, elev=45.0) # no problem

# show
plt.show()

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to