Skip to main content
cleaned up the grammar, language
Source Link
Paul H
  • 68.7k
  • 23
  • 165
  • 139

Matplot lib - Plotting a lined graphline graphs in matplotlib

I'm trying to plot a connected graph (like a connected line graph), if. If I do anychanges on mymake changes to the code below, I'm unable to see the graphplot fails to display.

My plot, as of now, is filled with DOT's !unconnected dots.

Any idea, how can IHow to do generate a line-graph/plot. Help! Thanks in advance. graph of connected points?

x = np.zeros(sheet_1.max_row)
y = np.zeros(sheet_1.max_row)

print (sheet_1.max_row)
print (sheet_1.max_column)

f = open("Bad_Data_Points_CD25.txt", "w")

for i in range(0, 10): #change to 1000
    for j in range(0, 289): # change to 289

        x[i] = sheet_1.cell(row=i + 1, column=j + 1).value #J + 1 changed to J
        print x[i]
        plt.plot(i, x[i],'go-', label='Values')



plt.grid(True)

plt.title("ABCD")
plt.ylabel("ABCD")
plt.ylim(0,0.15)
plt.xlabel("ABCD")
plt.xlim(0, 10)

plt.show()

Matplot lib - Plotting a lined graph

I'm trying to plot a connected graph (like a connected line graph), if I do anychanges on my code, I'm unable to see the graph.

My plot as of now, is filled with DOT's !

Any idea, how can I generate a line-graph/plot. Help! Thanks in advance.

x = np.zeros(sheet_1.max_row)
y = np.zeros(sheet_1.max_row)

print (sheet_1.max_row)
print (sheet_1.max_column)

f = open("Bad_Data_Points_CD25.txt", "w")

for i in range(0, 10): #change to 1000
    for j in range(0, 289): # change to 289

        x[i] = sheet_1.cell(row=i + 1, column=j + 1).value #J + 1 changed to J
        print x[i]
        plt.plot(i, x[i],'go-', label='Values')



plt.grid(True)

plt.title("ABCD")
plt.ylabel("ABCD")
plt.ylim(0,0.15)
plt.xlabel("ABCD")
plt.xlim(0, 10)

plt.show()

Plotting line graphs in matplotlib

I'm trying to plot a connected line graph. If I make changes to the code below, the plot fails to display.

My plot, as of now, is filled with unconnected dots.

How to do generate a line graph of connected points?

x = np.zeros(sheet_1.max_row)
y = np.zeros(sheet_1.max_row)

print (sheet_1.max_row)
print (sheet_1.max_column)

f = open("Bad_Data_Points_CD25.txt", "w")

for i in range(0, 10): #change to 1000
    for j in range(0, 289): # change to 289

        x[i] = sheet_1.cell(row=i + 1, column=j + 1).value #J + 1 changed to J
        print x[i]
        plt.plot(i, x[i],'go-', label='Values')



plt.grid(True)

plt.title("ABCD")
plt.ylabel("ABCD")
plt.ylim(0,0.15)
plt.xlabel("ABCD")
plt.xlim(0, 10)

plt.show()
Source Link
Aditya
  • 29
  • 1
  • 7

Matplot lib - Plotting a lined graph

I'm trying to plot a connected graph (like a connected line graph), if I do anychanges on my code, I'm unable to see the graph.

My plot as of now, is filled with DOT's !

Any idea, how can I generate a line-graph/plot. Help! Thanks in advance.

x = np.zeros(sheet_1.max_row)
y = np.zeros(sheet_1.max_row)

print (sheet_1.max_row)
print (sheet_1.max_column)

f = open("Bad_Data_Points_CD25.txt", "w")

for i in range(0, 10): #change to 1000
    for j in range(0, 289): # change to 289

        x[i] = sheet_1.cell(row=i + 1, column=j + 1).value #J + 1 changed to J
        print x[i]
        plt.plot(i, x[i],'go-', label='Values')



plt.grid(True)

plt.title("ABCD")
plt.ylabel("ABCD")
plt.ylim(0,0.15)
plt.xlabel("ABCD")
plt.xlim(0, 10)

plt.show()