Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

plt.xticks

# Show x axes with intervals of X instead of default (this case default=5)
import numpy as np
import matplotlib.pyplot as plt

x = [0,5,9,10,15]
y = [0,1,2,3,4]
X = 1.0
plt.plot(x,y)
plt.xticks(np.arange(min(x), max(x)+1, X))
plt.show()
Comment

turn off xticks matplotlib

# for matplotlib.pyplot
# ---------------------
plt.xticks([], [])
# for axis object
# ---------------
# from Anakhand May 5 at 13:08
# for major ticks
ax.set_xticks([])
# for minor ticks
ax.set_xticks([], minor=True)
Comment

xticks label matplotlib

ax.set_xticks(np.arange(len(data)))
ax.set_xticklabels(labels)
Comment

xticks and yticks matplotlib

#x-ticks: 
plt.xticks(start, stop, step))
#y-ticks:
plt.yticks(np.arange(start,stop,step))
Comment

yticks matplotlib

locs, labels = yticks()  # Get the current locations and labels.
>>> yticks(np.arange(0, 1, step=0.2))  # Set label locations.
>>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue'])  # Set text labels.
>>> yticks([0, 1, 2], ['January', 'February', 'March'],
...        rotation=45)  # Set text labels and properties.
>>> yticks([])  # Disable yticks.
Comment

PREVIOUS NEXT
Code Example
Python :: python string indexing 
Python :: python how to get the last element in a list 
Python :: virtual env python 2 
Python :: convert rgb to a single value 
Python :: pandas dataframe sort by column name first 10 values 
Python :: Python t date from a timestamp 
Python :: pyplot new figure 
Python :: windows 10 reset django migrations 
Python :: python one line if statement no else 
Python :: How to wait a page is loaded in Python Selenium 
Python :: buscar valor aleatorio de una lista python 
Python :: finding factorial of a number in python 
Python :: how to have requirement file in python for libs 
Python :: how to create a python server 
Python :: python datetime object 
Python :: bitcoin wallet python 
Python :: run code in python atom 
Python :: dummy variables pandas 
Python :: how to put a image in flask 
Python :: make a gif with images python 
Python :: how to map longitude and latitude in python 
Python :: python youtube download mp3 
Python :: Return the number of times that the string "hi" appears anywhere in the given string. python 
Python :: create a dictionary from a list python 
Python :: build a pile of cubes python 
Python :: check regex in python 
Python :: how to run python file 
Python :: python pillow cut image in half 
Python :: python arguments 
Python :: display prime numbers between two intervals in python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =