0

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.

  • Change this to comment `#ax.axes.set_xlim3d(left=0)` or delete this line. In the picture you showed your `x` is from 0 to 1, but the minimum of your x is `31248000000`. – HMH1013 Feb 27 '23 at 16:04
  • You don't know how happy this comment made me, the graph popped like magic and my soul returned to my body. Thank you so so much! – Nico Sepulveda Feb 27 '23 at 16:24
  • Your comment makes me happy too, so we got a win-win. – HMH1013 Feb 27 '23 at 17:11

0 Answers0