Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6acc43a

Browse files
committed
Cleanup and move vertical_ticklabels demo
1 parent 529d9f7 commit 6acc43a

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

examples/pylab_examples/vertical_ticklabels.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

examples/tests/backend_driver.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
'unicode_demo.py',
8080
]
8181

82+
files['ticks_and_spines'] = [
83+
'ticklabels_demo_rotation.py',
84+
]
85+
8286
files['subplots_axes_and_figures'] = [
8387
'subplot_demo.py',
8488
]
@@ -237,7 +241,6 @@
237241
'text_rotation_relative_to_line.py',
238242
'text_themes.py',
239243
'transoffset.py',
240-
'vertical_ticklabels.py',
241244
'vline_demo.py',
242245
'xcorr_demo.py',
243246
'zorder_demo.py',
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
Demo of custom tick-labels with user-defined rotation.
3+
"""
4+
import matplotlib.pyplot as plt
5+
6+
7+
x = [1, 2, 3, 4]
8+
y = [1, 4, 9, 6]
9+
labels = ['Frogs', 'Hogs', 'Bogs', 'Slogs']
10+
11+
plt.plot(x, y, 'ro')
12+
# You can specify a rotation for the tick labels in degrees or with keywords.
13+
plt.xticks(x, labels, rotation='vertical')
14+
# Pad margins so that markers don't get clipped by the axes
15+
plt.margins(0.2)
16+
plt.show()

0 commit comments

Comments
 (0)