I have a data file (x and y columns) with different data separated by two empty lines. Is there a way to plot n blocks separately in the same figure using Python?
1 1
2 2
3 3
4 5
5 6
6 7
This is the code I have tried:
import matplotlib.pyplot as plt from scipy
import * import numpy as np
data=np.loadtxt('data.dat')
i=0
for i in len(data):
plt.plot(data[i:i+3,0], data[i:i+3], 'ro')
i=i+4,
return
But I seem to be getting a wrong plot. What am I missing?