datetick 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datetick-0.9.0/LICENSE.txt +21 -0
- datetick-0.9.0/PKG-INFO +216 -0
- datetick-0.9.0/README.md +200 -0
- datetick-0.9.0/datetick/__init__.py +7 -0
- datetick-0.9.0/datetick/datetick.py +694 -0
- datetick-0.9.0/datetick.egg-info/PKG-INFO +216 -0
- datetick-0.9.0/datetick.egg-info/SOURCES.txt +12 -0
- datetick-0.9.0/datetick.egg-info/dependency_links.txt +1 -0
- datetick-0.9.0/datetick.egg-info/requires.txt +3 -0
- datetick-0.9.0/datetick.egg-info/top_level.txt +4 -0
- datetick-0.9.0/etc/release.py +93 -0
- datetick-0.9.0/pyproject.toml +23 -0
- datetick-0.9.0/setup.cfg +4 -0
- datetick-0.9.0/test/datetick_test.py +130 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026- Bob Weigel, Brendan Gallagher
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
datetick-0.9.0/PKG-INFO
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datetick
|
|
3
|
+
Version: 0.9.0
|
|
4
|
+
Summary: Sensible date tick locator for matplotlib
|
|
5
|
+
Author: Brendan Gallagher
|
|
6
|
+
Author-email: Bob Weigel <rweigel@gmu.edu>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Homepage, http://pypi.python.org/pypi/datetick/
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE.txt
|
|
12
|
+
Requires-Dist: matplotlib
|
|
13
|
+
Requires-Dist: numpy
|
|
14
|
+
Requires-Dist: python-dateutil
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# datetick
|
|
18
|
+
|
|
19
|
+
Sensible numeric time and date tick labels for Matplotlib
|
|
20
|
+
|
|
21
|
+
# Motivation
|
|
22
|
+
|
|
23
|
+
Matplotlib's default time tick labels are often poor, and adjusting them requires using [locators and formatters](https://matplotlib.org/stable/api/ticker_api.html) on an ad-hoc basis. In addition, the interfaces for locators and formatters complex and non-intuitive and require study and experimentation.
|
|
24
|
+
|
|
25
|
+
`datetick()` contains logic for locators and formatters that apply to plots with arbitrary time ranges. One only needs to add the command `datetick()` after the usual Matplotlib `plt.plot(...)` command to have sensible and useable time tick labels.
|
|
26
|
+
|
|
27
|
+
# Usage
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
import datetime as dt
|
|
31
|
+
import matplotlib.pyplot as plt
|
|
32
|
+
from datetick import datetick
|
|
33
|
+
|
|
34
|
+
dt1 = dt.datetime(2011, 1, 2)
|
|
35
|
+
dt2 = dt1 + dt.timedelta(days=1, hours=1, minutes=1)
|
|
36
|
+
|
|
37
|
+
plt.plot([dt1, dt2], [0.0,1.0])
|
|
38
|
+
datetick()
|
|
39
|
+
plt.show()
|
|
40
|
+
# or
|
|
41
|
+
# datetick('x') (use 'y' if y variable is a time)
|
|
42
|
+
# or
|
|
43
|
+
# datetick('x', axes=plt.gca())
|
|
44
|
+
# or
|
|
45
|
+
# fig, axes = plt.subplots(2)
|
|
46
|
+
# plt.plot([dt1, dt2], [0.0, 1.0])
|
|
47
|
+
# datetick('x', axes=axes[0])
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
# Comparison to default Matplotlib
|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+

|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+

|
|
111
|
+
|
|
112
|
+

|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+

|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+

|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+

|
|
139
|
+
|
|
140
|
+

|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+

|
|
145
|
+
|
|
146
|
+

|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
|
|
150
|
+

|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+

|
|
157
|
+
|
|
158
|
+

|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
162
|
+

|
|
163
|
+
|
|
164
|
+

|
|
165
|
+
|
|
166
|
+

|
|
167
|
+
|
|
168
|
+

|
|
169
|
+
|
|
170
|
+

|
|
171
|
+
|
|
172
|
+

|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+

|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+

|
|
181
|
+
|
|
182
|
+

|
|
183
|
+
|
|
184
|
+

|
|
185
|
+
|
|
186
|
+

|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+

|
|
191
|
+
|
|
192
|
+

|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+

|
|
197
|
+
|
|
198
|
+

|
|
199
|
+
|
|
200
|
+

|
|
201
|
+
|
|
202
|
+

|
|
203
|
+
|
|
204
|
+

|
|
205
|
+
|
|
206
|
+

|
|
207
|
+
|
|
208
|
+

|
|
209
|
+
|
|
210
|
+

|
|
211
|
+
|
|
212
|
+

|
|
213
|
+
|
|
214
|
+

|
|
215
|
+
|
|
216
|
+

|
datetick-0.9.0/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# datetick
|
|
2
|
+
|
|
3
|
+
Sensible numeric time and date tick labels for Matplotlib
|
|
4
|
+
|
|
5
|
+
# Motivation
|
|
6
|
+
|
|
7
|
+
Matplotlib's default time tick labels are often poor, and adjusting them requires using [locators and formatters](https://matplotlib.org/stable/api/ticker_api.html) on an ad-hoc basis. In addition, the interfaces for locators and formatters complex and non-intuitive and require study and experimentation.
|
|
8
|
+
|
|
9
|
+
`datetick()` contains logic for locators and formatters that apply to plots with arbitrary time ranges. One only needs to add the command `datetick()` after the usual Matplotlib `plt.plot(...)` command to have sensible and useable time tick labels.
|
|
10
|
+
|
|
11
|
+
# Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
import datetime as dt
|
|
15
|
+
import matplotlib.pyplot as plt
|
|
16
|
+
from datetick import datetick
|
|
17
|
+
|
|
18
|
+
dt1 = dt.datetime(2011, 1, 2)
|
|
19
|
+
dt2 = dt1 + dt.timedelta(days=1, hours=1, minutes=1)
|
|
20
|
+
|
|
21
|
+
plt.plot([dt1, dt2], [0.0,1.0])
|
|
22
|
+
datetick()
|
|
23
|
+
plt.show()
|
|
24
|
+
# or
|
|
25
|
+
# datetick('x') (use 'y' if y variable is a time)
|
|
26
|
+
# or
|
|
27
|
+
# datetick('x', axes=plt.gca())
|
|
28
|
+
# or
|
|
29
|
+
# fig, axes = plt.subplots(2)
|
|
30
|
+
# plt.plot([dt1, dt2], [0.0, 1.0])
|
|
31
|
+
# datetick('x', axes=axes[0])
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
# Comparison to default Matplotlib
|
|
35
|
+
|
|
36
|
+

|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+

|
|
41
|
+
|
|
42
|
+

|
|
43
|
+
|
|
44
|
+

|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+

|
|
49
|
+
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+

|
|
53
|
+
|
|
54
|
+

|
|
55
|
+
|
|
56
|
+

|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+

|
|
61
|
+
|
|
62
|
+

|
|
63
|
+
|
|
64
|
+

|
|
65
|
+
|
|
66
|
+

|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+

|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+

|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+

|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+

|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+

|
|
109
|
+
|
|
110
|
+

|
|
111
|
+
|
|
112
|
+

|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+

|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+

|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+

|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+

|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+

|
|
137
|
+
|
|
138
|
+

|
|
139
|
+
|
|
140
|
+

|
|
141
|
+
|
|
142
|
+

|
|
143
|
+
|
|
144
|
+

|
|
145
|
+
|
|
146
|
+

|
|
147
|
+
|
|
148
|
+

|
|
149
|
+
|
|
150
|
+

|
|
151
|
+
|
|
152
|
+

|
|
153
|
+
|
|
154
|
+

|
|
155
|
+
|
|
156
|
+

|
|
157
|
+
|
|
158
|
+

|
|
159
|
+
|
|
160
|
+

|
|
161
|
+
|
|
162
|
+

|
|
163
|
+
|
|
164
|
+

|
|
165
|
+
|
|
166
|
+

|
|
167
|
+
|
|
168
|
+

|
|
169
|
+
|
|
170
|
+

|
|
171
|
+
|
|
172
|
+

|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+

|
|
177
|
+
|
|
178
|
+

|
|
179
|
+
|
|
180
|
+

|
|
181
|
+
|
|
182
|
+

|
|
183
|
+
|
|
184
|
+

|
|
185
|
+
|
|
186
|
+

|
|
187
|
+
|
|
188
|
+

|
|
189
|
+
|
|
190
|
+

|
|
191
|
+
|
|
192
|
+

|
|
193
|
+
|
|
194
|
+

|
|
195
|
+
|
|
196
|
+

|
|
197
|
+
|
|
198
|
+

|
|
199
|
+
|
|
200
|
+

|