MATPLOTLIB 3D surface plot with 3 lists of different sizes each

Viewed 43

Hey there I have a question about Matplotlib. I have 3 different sizes for each dimension and can't seem to plot it. I can't really make sense of some of the other solutions.

X = [0,1,2,3,4,5,6,7],
Y =[[10.48, 7.65, 4.25, 10.76, 6.51, 5.38, 6.75, 9.07], [0.0, 18.98, 3.01, 5.0, -3.01, -3.61, -4.07, 1.2], [0.0, 0.0, 0.97, 0.19, -1.94, -0.58, -1.29, -1.48], [3.12, -0.04, 4.25, 5.74, 3.18, 3.43, 4.07, 3.25], [4.36, 1.0, 2.74, 5.91, 6.23, 6.54, 11.21, 8.72], [-0.25, -0.12, -0.32, -0.19, 0.37, 0.25, 0.25, 0.37], [0.0, 12.09, -12.79, -15.12, -16.56, -16.56, -16.56, 0.0], [0.0, 0.0, 0.0, -1.09, -2.7, -2.15, -2.02, 0.6], [1.53, 13.52, 23.72, 17.6, 17.6, 17.6, 17.6, -5.36], [0.0, -0.31, -8.64, -6.0, -6.54, -6.5, -6.54, -10.44], [-0.35, 39.08, 40.85, 40.18, 44.37, 39.26, 39.08, 40.14], [-0.73, 9.53, 17.65, 8.05, 2.54, -1.7, 2.49, -4.3], [-0.65, -0.65, -5.8, -6.19, 1.2, -0.42, -4.21, -2.28], [0.0, 0.27, 0.08, 0.06, 0.41, 0.33, 0.6, 0.05], [-0.56, 23.94, 23.69, 23.89, 24.64, 24.72, 24.75, 24.5], [0.0, 20.69, 17.24, 18.1, 50.0, 49.18, 31.47, 43.1], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [-1.62, -8.09, -11.97, -10.03, -21.2, -24.22, -26.05, -19.09], [0.0, 0.0, 0.35, 0.26, -0.59, -0.53, -0.17, -0.44], [0.0, -0.03, -0.05, -0.07, -0.1, -0.1, -0.1, -0.26], [1.63, -1.13, -3.51, -1.26, -2.29, -3.51, -3.68, -4.64], [1.45, 0.14, -0.29, -1.45, 1.3, 1.3, 1.3, -1.01], [0.0, 0.0, 0.0, 0.0, -7.1, -7.1, -7.1, -8.83], [0.0, 0.0, 0.0, 0.45, 0.9, 0.85, 0.85, 0.51], [-0.28, -0.28, 0.96, 1.86, 1.09, 0.73, 0.31, 0.51], [0.0, -5.79, -7.54, -8.25, -8.56, -7.03, -7.03, -7.03], [0.0, 3.94, 3.94, 3.94, 3.94, 3.94, 3.94, 3.28], [12.29, 2.75, 2.75, 2.75, 2.75, 2.75, 2.75, 23.31]]

Z = ZVal = [336552000, 134720000, 649239000, 2249700000, 53622000, 21736100000, 224608000, 2326950000, 366342000, 519270000, 171217000, 97250200, 212223000, 205003000000, 382323000, 54883400, 687761000, 67616000, 14524800000, 184760000000, 681248000, 168930000, 1628840000, 10767900000, 17033400000, 1508170000, 11047900000, 69891700]

The issue here is that X represents hours, while Y is performance of certain companies over those hours. Z is the market cap of said companies. Each market cap has performance over the 8 time intervals in the Y list, so 1 list for each cap in Z, mapped over the time in X. I think a way to explain it is that there are 28 planes, in that there must be 28 Z coordinates, and each has the X and Y in it. However, I really don't get how to code this in python as I always get errors relating to the lists not being equal in size and whatnot, so I'd appreciate some advice.

0 Answers
Related