Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

xaxis matplotlib

import matplotlib.pyplot as plt
x = [0.00001,0.001,0.01,0.1,0.5,1,5]
# create an index for each tick position
xi = list(range(len(x)))
y = [0.945,0.885,0.893,0.9,0.996,1.25,1.19]
plt.ylim(0.8,1.4)
# plot the index for the x-values
plt.plot(xi, y, marker='o', linestyle='--', color='r', label='Square') 
plt.xlabel('x')
plt.ylabel('y') 
plt.xticks(xi, x)
plt.title('compare')
plt.legend() 
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: reload is not defined python 3 
Python :: python reduce function to sum array 
Python :: python wsgi server 
Python :: python pandas cumulative return 
Python :: get all combinations from two lists python 
Python :: cosine similarity python numpy 
Python :: python matplotlib hist set axis range 
Python :: convert series to datetime 
Python :: how to run single loop iterations on same time in python 
Python :: python if else variable assignment 
Python :: flask make static directory 
Python :: read text from a pdffile python 
Python :: remove whitespace in keys from dictionary 
Python :: dataframe to dictionary without index 
Python :: how to reapete the code in python 
Python :: open text file in python 
Python :: pandas change frequency of datetimeindex 
Python :: convert from epoch to utc python 
Python :: plotly reverse y axis 
Python :: how to get rid of all null values in array python 
Python :: python read mp3 livestream 
Python :: pythion code for finding all string lengths in a code 
Python :: forbidden (csrf cookie not set.) django rest framework 
Python :: sort column with numeric and text data 
Python :: pygame mouse pos 
Python :: find nan value in dataframe python 
Python :: shift coordinate in python 
Python :: delete a row in pandas dataframe 
Python :: stringbuilder python 
Python :: 13 digit timestamp python 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =