Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to hide ticks marks in matplotlib

import matplotlib.pyplot as plt
import numpy as np

# Simple data to display in various forms
x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)

fig, axarr = plt.subplots(2, 2)
fig.suptitle("This Main Title is Nicely Formatted", fontsize=16)

axarr[0, 0].plot(x, y)
axarr[0, 0].set_title('Axis [0,0] Subtitle')
axarr[0, 1].scatter(x, y)
axarr[0, 1].set_title('Axis [0,1] Subtitle')
axarr[1, 0].plot(x, y ** 2)
axarr[1, 0].set_title('Axis [1,0] Subtitle')
axarr[1, 1].scatter(x, y ** 2)
axarr[1, 1].set_title('Axis [1,1] Subtitle')

# Fine-tune figure;
# hide x ticks for top plots and y ticks for right plots

plt.setp([a.get_xticklabels() for a in axarr[0, :]], visible=False)
plt.setp([a.get_yticklabels() for a in axarr[:, 1]], visible=False)


# Tight layout often produces nice results
# but requires the title to be spaced accordingly

fig.tight_layout()
fig.subplots_adjust(top=0.88)

plt.show()


Comment

PREVIOUS NEXT
Code Example
Python :: seaborn color palette python 
Python :: pandas lambda applu 
Python :: task timed out after 3.00 seconds aws lambda python 
Python :: open url from ipywidgets 
Python :: selenium python get element by type 
Python :: how to set numerecal index in pandas 
Python :: install fastapi 
Python :: Group based sort pandas 
Python :: selenium python switch tabs 
Python :: defaultdict initialize keys 
Python :: text cleaning python 
Python :: gensim show_topics get topic 
Python :: best python gui for desktop application 
Python :: check django version windows 
Python :: swap two columns python 
Python :: python get third friday of the month 
Python :: python sum of a subset 
Python :: Swap first and last list elements 
Python :: how to add createsuper user in django 
Python :: python includes string 
Python :: python map() 
Python :: how to get SITE_ID in django....shell 
Python :: python add commas to list 
Python :: python expand nested list 
Python :: how to append number in tuple 
Python :: pandas divide multiple columns by one column 
Python :: python plus 
Python :: df split into train, validation, test 
Python :: change base python 
Python :: python delete key dictionary 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =