- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make longer subplot tick marks in Matplotlib?
To make longer subplot tick marks in matplotlib, we can use tick_params() method for minor and major ticks length and width.
Steps
Add a subplot to the current figure using subplot() method.
Plot a range(2) value
s for x and y data points.
Turn the minor ticks of the colorbar ON without extruding into the "extend regions".
Use tick_params for changing the appearance of ticks and tick labels.
To display the figure, use show() method.
Example
from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True ax1 = plt.subplot() ax1.plot(range(2), range(2), linewidth=2) ax1.minorticks_on() ax1.tick_params('both', length=20, width=2, which='major') ax1.tick_params('both', length=10, width=1, which='minor') plt.show()
Output
- Related Articles
- How to rotate tick labels in a subplot in Matplotlib?
- Centering x-tick labels between tick marks in Matplotlib
- How to turn off the upper/right axis tick marks in Matplotlib?
- How to make hollow square marks with Matplotlib in Python?
- Turn off the left/bottom axis tick marks in Matplotlib
- Matplotlib legends in subplot
- How to remove the tick marks in JavaFX XY charts?
- How to plot multiple Seaborn Jointplot in Subplot using Matplotlib?
- How to plot a pcolor colorbar in a different subplot in Matplotlib?
- How to set the Y-axis tick marks using ggplot2 in R?
- How to add a 3d subplot to a matplotlib figure?\n
- How can I programmatically select a specific subplot in Matplotlib?
- How to remove the axis tick marks on a Seaborn heatmap?
- Display tick marks in a JSlider with Java
- How to modify the length of the tick marks in JavaFX XY charts?

Advertisements