Xy scatter plot line not straight10/23/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. ![]() ![]() 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. Plt.plot(identity_line, identity_line, color="black", linestyle="dashed", linewidth=3.0) 1 I have this code to plot some data in python using matplotlib: import matplotlib.pyplot as plt x 1,2,5 y 2,4,1 plt.plot (x,y) plt. Sub ScatterChartsetPoint () Dim Ws As Worksheet Dim DB As Range, m圜ell As Range Dim Ch As Chart Dim i As Integer, n As Long, r As Integer, g As Integer, b As Integer Dim vX (), vY (), vLable (), vMarker Dim pnt As Point Dim Shp As Shape Dim h As Single, w As Single, l As. Identity_line = np.linspace(max(min(all_x), min(all_y)), The image above demonstrates a custom chart line that fits the first and last column only. # 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? Create a straight line through the first and last chart column. Actually, there is no way that can display text labels in the X-axis of scatter chart in Excel, but we can create a line chart and make it look like a scatter. 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
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |