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

own labels for ticks matplotlib

ax.set_xticklabels(labels)
Comment

matplotlib axis with tick lables but without tick symbole

import numpy as np
import matplotlib.pyplot as plt

fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(11, 3))

data = np.random.random((4, 4))

ax1.imshow(data)
ax1.set(title='Bad', ylabel='$A_y$')
# plt.setp(ax1.get_xticklabels(), visible=False)
# plt.setp(ax1.get_yticklabels(), visible=False)
ax1.tick_params(axis='both', which='both', length=0)

ax2.imshow(data)
ax2.set(title='Somewhat OK', ylabel='$B_y$')
plt.setp(ax2.get_xticklabels(), visible=False)
plt.setp(ax2.get_yticklabels(), visible=False)
# ax2.tick_params(axis='both', which='both', length=0)

ax3.imshow(data)
ax3.set(title='Nice', ylabel='$C_y$')
plt.setp(ax3.get_xticklabels(), visible=False)
plt.setp(ax3.get_yticklabels(), visible=False)
ax3.tick_params(axis='both', which='both', length=0)

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: multiple arguments in python 
Python :: move one column value down by one column in pandas 
Python :: python get pid of process 
Python :: join pandas dataframe by column 
Python :: pyspark join 
Python :: enumerate vs zip python same time 
Python :: print only numbers from string python 
Python :: find an element in pandas 
Python :: increase colorbar ticksize 
Python :: how to find total no of nan values in pandas 
Python :: how to select python 3 interpreter in linux 
Python :: int to list python 
Python :: python random hash 
Python :: make linked list in python 
Python :: python ordered dictionary 
Python :: scanner class in python 
Python :: flask return error response 
Python :: python debugger 
Python :: true positive true negative manually 
Python :: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091) 
Python :: how to get current date and time in python 
Python :: python reverse words in string 
Python :: where are python libraries installed in windows 
Python :: open and read a file in python 
Python :: python resize image in tkinter 
Python :: how to add mouse button in pygame 
Python :: __call__ python 
Python :: python get file path from in os.walk 
Python :: find where df series is null and print 
Python :: python mahalanobis distance 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =