Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f5dcedd

Browse filesBrowse files
committed
Add whats new for new slider styles
1 parent a7c4df6 commit f5dcedd
Copy full SHA for f5dcedd

File tree

1 file changed

+42
-0
lines changed
Filter options

1 file changed

+42
-0
lines changed
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Updated the appearance of Slider widgets
2+
----------------------------------------
3+
4+
The appearance of `~.Slider` and `~.RangeSlider` widgets
5+
were updated and given new styling parameters for the
6+
added handles.
7+
8+
.. plot::
9+
10+
import matplotlib.pyplot as plt
11+
from matplotlib.widgets import Slider
12+
13+
plt.figure(figsize=(4, 2))
14+
ax_old = plt.axes([0.2, 0.65, 0.65, 0.1])
15+
ax_new = plt.axes([0.2, 0.25, 0.65, 0.1])
16+
Slider(ax_new, "New", 0, 1)
17+
18+
ax = ax_old
19+
valmin = 0
20+
valinit = 0.5
21+
ax.set_xlim([0, 1])
22+
ax_old.axvspan(valmin, valinit, 0, 1)
23+
ax.axvline(valinit, 0, 1, color="r", lw=1)
24+
ax.set_xticks([])
25+
ax.set_yticks([])
26+
ax.text(
27+
-0.02,
28+
0.5,
29+
"Old",
30+
transform=ax.transAxes,
31+
verticalalignment="center",
32+
horizontalalignment="right",
33+
)
34+
35+
ax.text(
36+
1.02,
37+
0.5,
38+
"0.5",
39+
transform=ax.transAxes,
40+
verticalalignment="center",
41+
horizontalalignment="left",
42+
)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.