![]() 3D plotting lets us see the relationship between three variables in a three-dimensional space. The solution (see here also) is to use cmap in ax.scatter: from matplotlib import pyplot as plt Plotting a horizontal line on a scatter graph in MATLAB. ![]() Mar-29-2019, 12:13 PM (This post was last modified: Mar-29-2019, 12:13 PM by barry76.). The most basic three-dimensional plot is a line or collection of scatter plot created from sets of (x, y, z) triples. P = ax.scatter(x, y, z, c=plt.cm.magma(0.5*c))Īx.set_box_aspect() # equal aspect ratio Create Animated Scatter plot in 3d using matplotlib in python. ![]() What's the correct way to add a colorbar to the figure, since adding in plt.colorbar() or ax.colorbar() doesn't seem to work. ![]() The colorbar colormap was not linked to the axes (note also the incorrect colorbar limits): from matplotlib import pyplot as pltĪx = fig.add_subplot(111, projection='3d')Ĭ = np.arange(len(x)) / len(x) # create some colours Will give a 3D scatter plot with different colors for each point (random colors in this example). Using the above answer did not solve my problem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |