Search
 
SCRIPT & CODE EXAMPLE
 

C

plt hide axis ticks

 pythonCopyimport matplotlib.pyplot as plt

plt.plot([0, 10], [0, 10])
plt.xlabel("X Label")
plt.ylabel("Y Label")

ax = plt.gca()
ax.axes.xaxis.set_visible(False)
ax.axes.yaxis.set_visible(False)

plt.grid(True)
plt.show()
Comment

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
C :: get file extension from base64 string 
C :: buble sort c 
C :: pygame detect click 
C :: factorial c program using for loop 
C :: pygame draw transparent rectangle 
C :: haskell print 
C :: zizag c 
C :: react-textfit 
C :: c code to python code converter online 
C :: how to search in a file in c 
C :: %hd c 
C :: is it possible to access argv in function 
C :: postgres random select 
C :: armstrong number using function in c 
C :: how to ban websites on mac 
C :: c number to string 
C :: svg not loading in chrome 
C :: write a binary file c 
C :: turn a char into an int in c 
C :: c strcat 
C :: read a document in c getting name from console 
C :: C scanf() to read a string 
C :: c read file 
C :: identifier bool is undefined in c 
C :: how to use malloc in c 
C :: c exit 
C :: Installing Tailwind 
C :: fseek function in c 
C :: pointer arithmetic on Arrray in c 
C :: c add char to char array 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =