AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Xy scatter plot line not straight11/22/2023 ![]() ![]() ![]() Is there a way I can get y=x to show up even if I don't have a list of all the points that I plotted? I would think that something in matplotlib can give me a list of all the points after the fact, but I haven't been able to figure out how to get that list. 12:38 PM Excel XY Scatter plot - secondary vertical axis Is there a way to add a secondary vertical axis to an XY (Scatter) graph This would be extremely useful for plotting 2 sets of y-values (with different ranges of values) for the same set of x-values on the same graph. np.cos(2np.pit) line, ax.plot(t, s, lw3) ax.annotate( straight, xy(0, 1). In order to achieve this I've had to keep track of all the x and y values that went into the scatter plot so that I know where identity_line should start and end. Adjust Axis Scale: If your data points are clustered towards one side of the graph, you can reduce the white space by adjusting the axis scale. You must specify an annotation point xy(x, y) to annotate this point. Plt.plot(identity_line, identity_line, color="black", linestyle="dashed", linewidth=3.0) Identity_line = np.linspace(max(min(all_x), min(all_y)), # Could I somehow do the next part (add identity_line) if I haven't been keeping track of all the x and y values I've seen? ![]() Here's some code that does scatter plot of a number of different series using matplotlib and then adds the line y=x: import numpy as np, matplotlib.pyplot as plt, matplotlib.cm as cm, pylabĬolors = cm.rainbow(np.linspace(0, 1, nseries)) ![]()
0 Comments
Read More
Leave a Reply. |