scatter on a Axes3D figure is not plotting from a for loop

35 Views Asked by At

This code is part of a larger one, in which the rest works superb. After several tries I wasn't able to find a solution to this. We begin with "masa, costo volumen" which are lists that append new sublist depending of the user's will. After it's done, im trying to scatter each of them like this:

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

masa = [[700, 1150, 2000, 4000, 3600, 6000, 8500, 7800], [1065, 867, 2365, -696000.0, 3317, 6365, -691500.0, 7517]]
volumen = [[0.4, 1.0, 2.0, 2.0, 2.0, 3.0, 5.0, 4.0], [0.25913, 0.815087, 1.85913, 1.3, 1.8150870000000001, 2.85913, 4.3, 3.815087]]
costo = [[33600000000, 31248000000, 139200000000, 136442100000, 198360000000, 424800000000, 405712320000, 594720000000], [41238120000, 35532000000, 155021820000, 161632080000, 207234000000, 456989220000, 456960900000, 612774000000]]

fig = plt.figure(2)
ax = fig.add_subplot(111, projection=Axes3D.name)
ax.set_ylabel('Masa Disponible para Payload (g)')
ax.set_zlabel('Volumen Disponible para Payload (U)')
ax.set_xlabel('Costo $USD')
ax.axes.set_ylim3d(bottom=0, top=12000)
ax.axes.set_xlim3d(left=0)
ax.axes.set_zlim3d(bottom=0, top=6)
ax.view_init(20, -120)

for count in range(len(masa)):
    ax.scatter(costo[count], masa[count], volumen[count])
plt.show()

Though only my result ends up blank. i want points in here

Any help of what am i missing or doing wrong? Thanks in advance.

Inidividual scatter works okay, I've been able to scatter with this configuration before but i want to scatter several sets of points.

0

There are 0 best solutions below