Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib remove ticks and lines

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1],[1])
ax.tick_params(axis=u'both', which=u'both',length=0)
plt.show()
Comment

matplotlib turn off ticks

from matplotlib import pyplot as plt
plt.plot(range(10))
plt.tick_params(
    axis='x',          # changes apply to the x-axis
    which='both',      # both major and minor ticks are affected
    bottom=False,      # ticks along the bottom edge are off
    top=False,         # ticks along the top edge are off
    labelbottom=False) # labels along the bottom edge are off
plt.show()
plt.savefig('plot')
plt.clf()
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
Python :: convert list of strings to ints python 
Python :: unix to date python 
Python :: python create directory 
Python :: pandas replace column name spaces with underscore 
Python :: how to loop through dates in python 
Python :: yyyy-mm-dd hh:mm:ss.0 python 
Python :: python iterate list reverse 
Python :: tensorflow check gpu 
Python :: add seconds to datetime python 
Python :: track phone number location using python 
Python :: convert date time to date pandas 
Python :: how to right click in pyautogui 
Python :: export data csv python 
Python :: get list of unique values in pandas column 
Python :: open link from python 
Python :: Installing python cryptography 
Python :: python convert nan to empty string 
Python :: how to select all but last columns in python 
Python :: Tk.destroy arguments 
Python :: full form of ram 
Python :: os.system return value 
Python :: python selenium hover over element 
Python :: keras model load 
Python :: pandas percent change 
Python :: how to open any application using python 
Python :: python get how many days in current month 
Python :: remove first row of dataframe 
Python :: time decorator python 
Python :: python half of string 
Python :: flask boiler plate 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =