Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

change tick labelsize matplotlib

import matplotlib.pyplot as plt
# We prepare the plot  
fig, ax = plt.subplots()

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', labelsize=10)
ax.tick_params(axis='both', which='minor', labelsize=8)
Comment

Matplotlib vertical tick labels

import matplotlib.pyplot as plt

x = range(6)
y = [-3, -2, -1, 1, 2, 3]
xlabels = [f'label {i}' for i in x]

fig, ax = plt.subplots()
ax.bar(x, y)

# ha='***' is not enough to visually align labels with ticks 
# use both ha='***' and rotation_mode='anchor'
ax.set_xticks(x, xlabels, rotation=45, ha='right', rotation_mode='anchor')

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python get the app path 
Python :: Fast api importing optional 
Python :: django form list option 
Python :: get query params flask 
Python :: python keyboard key codes 
Python :: ord python 
Python :: python formdata requests 
Python :: pandas reset index 
Python :: pd df rename 
Python :: django apiview pagination 
Python :: pandas xa0 
Python :: print A to z vy using loop in python 
Python :: get last n in array python 
Python :: xml to json in python 
Python :: get_absolute_url django 
Python :: python alphabetical order 
Python :: google-api-python-client python 3 
Python :: model evaluate function 
Python :: reading binary file 
Python :: subset a list python 
Python :: python array 
Python :: planets list 
Python :: django url patterns static 
Python :: python remove many items via index at oncefrom a list? 
Python :: import all csv python 
Python :: legend text color matplotlib 
Python :: read multiple images cv2 
Python :: turtle keep window open 
Python :: title tikinter 
Python :: add two column values of a datframe into one 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =