Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

adjust tick label size matplotlib

plt.xticks(fontsize=)
Comment

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

own labels for ticks matplotlib

ax.set_xticklabels(labels)
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 :: scikit learn linear regression 
Python :: export a dataframe from rstudio as csv 
Python :: arctan in python 
Python :: python pdf merger 
Python :: kaaba python tutorial 
Python :: how to filter out all NaN values in pandas df 
Python :: python difference between unique and nunique 
Python :: find common words in two lists python 
Python :: add padding to 2d matrix p 
Python :: django user group check 
Python :: python list to string with spaces 
Python :: drop rows in list pandas 
Python :: create folder python 
Python :: dict godot 
Python :: vs code run python in terminal invalid syntax 
Python :: dataclass post init 
Python :: python insert image 
Python :: exclude columns in df 
Python :: opencv histogram equalization 
Python :: how to stop running code in python 
Python :: filter for a set of values pandas dataframe 
Python :: static dir in django python 
Python :: django.db.utils.OperationalError: no such table: 
Python :: save pandas into csv 
Python :: how to add a list to dataframe in python 
Python :: how to do channel first in pytorch 
Python :: from time import sleep, time 
Python :: spacy matcher syntax 
Python :: pyqt tex 
Python :: how to know if the numbers is par in python 
ADD CONTENT
Topic
Content
Source link
Name
8+2 =