![]() ![]() In the code below I've used random values rather than plotting the same range over and over, making all the plots visible (i.e. Also, if you are using scatter plots, use scatterpoints=1 rather than numpoints=1 in the legend call to have only one point for each legend entry. Using the scatter method of the matplotlib.pyplot module should work (at least with matplotlib 1.2.1 with Python 2.7.5), as in the example code below. ![]() When I run this, the legend no longer exists, it is a small white box in the corner with nothing in it. Plt.legend((lo,ll,l,a, h, hh, ho),('Low Outlier', 'LoLo','Lo', 'Average', 'Hi', 'HiHi', 'High Outlier'),scatterpoints=1, loc='lower left', ncol=3, fontsize=8) Ho = plt.scatter(xHOutlier, yHOutlier, zHOutlier, marker='x', color=colors) Hh = plt.scatter(xHiHi, yHiHi, zHiHi, marker='o',color=colors) ![]() H = plt.scatter(xHi, yHi, zHi, marker='o',color=colors) L = plt.scatter(xLo, yLo, zLo, marker='o',color=colors)Ī = plt.scatter(xAverage, yAverage, zAverage, marker='o',color=colors) Ll = plt.scatter(xLoLo, yLoLo, zLoLo, marker='o', color=colors) lo = plt.scatter(xLOutlier, yLOutlier, zLOutlier, marker='x', color=colors) Each list contains either the x, y, or z variable. With scatter, I changed the range(10) to the lists containing the data points. Scatter returned an error and scatter changed the graph and returned an error. I tried changing Line2D to Scatter and scatter. Plt.legend((lo,ll,l,a, h, hh, ho),('Low Outlier', 'LoLo','Lo', 'Average', 'Hi', 'HiHi', 'High Outlier'),numpoints=1, loc='lower left', ncol=3, fontsize=8) When I create the legend, the legend shows the correct symbol and color but adds a line through it. I created a 4D scatter plot graph to represent different temperatures in a specific area. ![]()
0 Comments
Leave a Reply. |