I want to plot a graph of 3D spheres that vary in size according to one data set of the format
(name, x-coord, y-coord, sphere_volume)
These need to be plotted on the graph based against values of x and y, but a fixed z-value is acceptable; it could be a 2D set of axes, just with 3D spheres varying in size instead of the usual circles you can get with a scatter graph. I also want each of these labelled; either with a name, or with a number than then corresponds to a name in a key.
Which matplotlib module should I use for this? I specifically only want to use matplotlib to output the graphics; though other modules can be used to manipulate the data. I was thinking of adapting the output from this:
import numpy as np
import matplotlib.pyplot as plt
N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
area = np.pi * (15 * np.random.rand(N))**2 # 0 to 15 point radii
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()
so that the circles were instead spheres, but I'm not sure how to go about this; any tips? A nice bonus would be to be able to define the colour of the sphere, but this is less important.