Obtain the number of lines of data in the csv file that measured the data of the motion sensor as shown in the table below, and use that value to
Domain of x (0<= x<= 64), range of y (0<= Yn<= n 1)
Yn = Kn
I want to draw a straight line parallel to the xaxis of.
Here, n represents the serial number ({n  n = 0,1,2, ...., n1) of the number of rows of the acquired data, and Kn is the serial number of the row number. The value is {Kn  0<= Kn<= n1}.
What we want to achieve this time is, assuming that this straight line represents a 64bit floating point number, x is a domain, (0 to 1) is the sign part, and (1 to 11) is the exponent part. Finally, I want to change the color of the straight line with (11 to 63) as the mantissa.
I tried to plot a graph that was parallel to the xaxis and divided into three colors for each y value (number of rows) ... but it didn't work.
Error message
x and y must have same first dimension, but have shapes (2,) and (1,)
root_path = "# path to the folder containing the desired files"
file_path = pathlib.Path (root_path)
csv_file_path = list (file_path.glob ("* .csv"))
df_list = []
index_list = []
for d in csv_file_path:
df = pd.read_csv (d, dtype = str, header = None)
df_list.append (df)
#Get the number of matrices
index = len (df)
index_list.append (index)
fig = plt.figure ()
# 0th value of list number
#y axis
y = np.arange (0, index_list [0], 1)
ax = fig.add_subplot (1,1,1, title = "64bit_graph", ylim = (index_list [0], 0), xlim = (0,64))
for s in y:
plt.axhline (y = int (y [s]), xmin = 0.0, xmax = 0.016, color = "y")
plt.axhline (y = int (y [s]), xmin = 0.016, xmax = 0.17, color = "g")
plt.axhline (y = int (y [s]), xmin = 0.17, xmax = 1.0, color = "b")
plt.show ()
Example of read csv file
x  y  z 

0.0021822779404043102  0.011354400497599271  0.021566487675835376 
0.001787169969495153  0.0033697903852851594  0.015884067258401774 
0.006165254335445933  0.005569805768012884  0.006603589812139398 
0.008625260373964556  0.002838294734545343  0.02680668760096887 
0.005034634878809447  0.006784316103084711  0.0372773035594495 
An example of a straight line that is parallel to the xaxis and whose color changes for each domain when the number of acquired lines is n = 3.
I also tried plt.axhline for horizontal graph display, but it didn't work.
Sorry for the unclean handwritten graphs, and also the math ...
I'm still a beginner and there are many things I don't understand, but thank you.
macbook air 2013
python 3.8.0
matplotlib 3.3.2
numpy 1.19.4
pandas 1.1.4

Answer # 1
Related articles
 parallel processing using python multiprocessingpool and multiprocessingqueue does not work well
 [python] i want to repeat the operation of assigning numbers to similar variables
 python  whether numbers and symbols can be used in model field names
 python: a sequence that adds the last numbers, a fibonacci sequence
 python amicable numbers
 python  i don't know how to process blocking processes in parallel
 [python] i want to draw the error between two graphs and cos (x)
 python  sum of numbers by inputting a character string
 python  i want to convert the characters obtained from the txt file to numbers
 python 3x  how to extract row and column numbers with specific values in a dataframe table
 python  i want to exclude numbers from csv created with pandas
 python api i don't know how to process the returned numbers
 python  view temperature and humidity graphs from a web browser on your pc or smartphone
 python  tkinter parallel processing
 python  enter numbers in the mesh diagram
 python  distinguishing between perfect and near perfect numbers with pyhon
 python  add lists in parallel
 about errors when drawing graphs in python
 i want to know what kind of operation matplotlib used for drawing python graphs is doing inside
 python : A certain number of columns from the CSV file for schedule
 python : Saving changes to the CSV file
 python : CSV is incorrectly read
 python : Pandas: Merge Several DataFrame using several (2) common columns
 python : Grouping dates with reference to the beginning of the period
 How to find a coincidence from Excel between 2 columns in Python
 python : How to combine 4 DataFrame in one?
 python : Search the amount in a sliding window from a local maximum in another column to the end of the window
 python : How to create a second one on a column that will reflect the content of the first?
 python : How to identify the frequency of words in the filtered DataFrame and perform their sorting in frequency?
SummaryA straight line parallel to the xaxis
I was able to draw parallel straight lines using matplotlib.pyplot.axhline.
The corresponding source code has also been modified.