Electron microscopy
 
PythonML
Plot with Letters/Words as x-/y-Axis
- Python Automation and Machine Learning for ICs -
- An Online Book -
Python Automation and Machine Learning for ICs                                                           http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

=================================================================================

The length of the x-axis can be defined by removing some strings at the end of the list which is used for x-axis.  code:       

# Filter the DataFrame to include only rows where the 'Class' column matches 'AY' 

df_filtered = df[df.index.isin(['AY', 'A', 'B'])] 

# Set font to serif 

rcParams['font.family'] = 'serif' 

# Plotting 

plt.figure(figsize=(10, 6)) 

for col in df_filtered.columns: 

plt.plot(df_filtered.index, df_filtered[col], marker='o', label=col) 

============================================

Plot with letters as x-axis . Code:
         
          
       Output:    
                    

============================================

Set the limit of x-axis Code:
         
          
       Output:    
                    

============================================

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 



















































 

 

 

 

 

=================================================================================