python-matplotlibHow to change y axis labels (ticks)
import matplotlib.pyplot as plt
plt.plot([2,1,3])
plt.yticks([1,2,3], ['10a', '20b', '30c'])
plt.show()ctrl + c| import matplotlib.pyplot as pltloads Matplotlib module to use plotting capabilities | .plot(plot specified data | 
| yticks(set labels for y-axis values (ticks) | [2,1,3]list of ticks to set labels for (= list of y-axis values) | 
| ['10a', '20b', '30c']labels to use for ticks | .show()render chart in a separate window | 
Usage example
import matplotlib.pyplot as plt
plt.plot([2,1,3])
plt.yticks([1,2,3], ['10a', '20b', '30c'])
plt.show()Related
More of Python Matplotlib
- How to change histogram bins number
- How to plot specific country from world map
- How to plot specific continent from world map
- How to plot 3D heatmap
- How to plot data from JSON
- How to change boxplot colors
- How to plot world map
- How to fill countries with colors using world map
- How to change table column width
- How to log scale Y axis
See more codes...
