Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to hide ticks in python

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 :: how to make a dice program in python 
Python :: python ide online 
Python :: distinct query in django queryset 
Python :: python countdown from 20 down to 0 
Python :: hugging face change directory model 
Python :: python scapy get mac of remote device 
Python :: Python How to get the keys in a dictionary? 
Python :: change data type python 
Python :: python command line start server 
Python :: add a new column to numpy array 
Python :: lemmatization 
Python :: pandas line plot dictionary 
Python :: python slice 
Python :: how to take a column from dataset in python 
Python :: K-Means Clustering in Python – 3 clusters 
Python :: def factorial python 
Python :: def python 
Python :: python extract email attachment 
Python :: count non nan values in column 
Python :: python dict copy() 
Python :: str to datetime time 
Python :: change month name in python 
Python :: python discord bot 
Python :: pthon return value with highest occurences 
Python :: os.startfile() python 
Python :: for loop example python 3 
Python :: bmi calculator in python 
Python :: dask read csv 
Python :: comment out multiple lines in python 
Python :: install ansible with pip 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =