|
222 | 222 |
|
223 | 223 | import sys, warnings
|
224 | 224 |
|
225 |
| -from matplotlib.cbook import flatten, is_string_like, exception_to_str, \ |
226 |
| - silent_list, iterable, dedent |
| 225 | +from matplotlib.cbook import ( |
| 226 | + flatten, is_string_like, exception_to_str, silent_list, iterable, dedent) |
227 | 227 |
|
228 | 228 | import matplotlib as mpl
|
229 | 229 | # make mpl.finance module available for backwards compatability, in case folks
|
230 | 230 | # using pylab interface depended on not having to import it
|
231 | 231 | import matplotlib.finance
|
232 | 232 |
|
233 |
| -from matplotlib.dates import date2num, num2date,\ |
234 |
| - datestr2num, strpdate2num, drange,\ |
235 |
| - epoch2num, num2epoch, mx2num,\ |
236 |
| - DateFormatter, IndexDateFormatter, DateLocator,\ |
237 |
| - RRuleLocator, YearLocator, MonthLocator, WeekdayLocator,\ |
238 |
| - DayLocator, HourLocator, MinuteLocator, SecondLocator,\ |
239 |
| - rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, MONTHLY,\ |
240 |
| - WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY, relativedelta |
| 233 | +from matplotlib.dates import ( |
| 234 | + date2num, num2date, datestr2num, strpdate2num, drange, epoch2num, |
| 235 | + num2epoch, mx2num, DateFormatter, IndexDateFormatter, DateLocator, |
| 236 | + RRuleLocator, YearLocator, MonthLocator, WeekdayLocator, DayLocator, |
| 237 | + HourLocator, MinuteLocator, SecondLocator, rrule, MO, TU, WE, TH, FR, |
| 238 | + SA, SU, YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY, SECONDLY, |
| 239 | + relativedelta) |
241 | 240 |
|
242 |
| -import matplotlib.dates # Do we need this at all? |
243 |
| - |
244 |
| -# bring all the symbols in so folks can import them from |
| 241 | +# bring all the symbols in so folks can import them from |
245 | 242 | # pylab in one fell swoop
|
246 | 243 |
|
247 |
| - |
248 | 244 | ## We are still importing too many things from mlab; more cleanup is needed.
|
249 | 245 |
|
250 |
| -from matplotlib.mlab import griddata, stineman_interp, slopes, \ |
251 |
| - inside_poly, poly_below, poly_between, \ |
252 |
| - is_closed_polygon, path_length, distances_along_curve, vector_lengths |
253 |
| - |
254 |
| -from matplotlib.mlab import window_hanning, window_none, detrend, demean, \ |
255 |
| - detrend_mean, detrend_none, detrend_linear, entropy, normpdf, \ |
256 |
| - find, longest_contiguous_ones, longest_ones, \ |
257 |
| - prctile, prctile_rank, \ |
258 |
| - center_matrix, rk4, bivariate_normal, get_xyz_where, \ |
259 |
| - get_sparse_matrix, dist, \ |
260 |
| - dist_point_to_segment, segments_intersect, fftsurr, movavg, \ |
261 |
| - exp_safe, \ |
262 |
| - amap, rms_flat, l1norm, l2norm, norm_flat, frange, identity, \ |
263 |
| - base_repr, binary_repr, log2, ispower2, \ |
264 |
| - rec_append_fields, rec_drop_fields, rec_join, csv2rec, rec2csv, isvector |
265 |
| - |
266 |
| -import matplotlib.mlab as mlab |
267 |
| -import matplotlib.cbook as cbook |
| 246 | +from matplotlib.mlab import ( |
| 247 | + amap, base_repr, binary_repr, bivariate_normal, center_matrix, csv2rec, |
| 248 | + demean, detrend, detrend_linear, detrend_mean, detrend_none, dist, |
| 249 | + dist_point_to_segment, distances_along_curve, entropy, exp_safe, |
| 250 | + fftsurr, find, frange, get_sparse_matrix, get_xyz_where, griddata, |
| 251 | + identity, inside_poly, is_closed_polygon, ispower2, isvector, l1norm, |
| 252 | + l2norm, log2, longest_contiguous_ones, longest_ones, movavg, norm_flat, |
| 253 | + normpdf, path_length, poly_below, poly_between, prctile, prctile_rank, |
| 254 | + rec2csv, rec_append_fields, rec_drop_fields, rec_join, rk4, rms_flat, |
| 255 | + segments_intersect, slopes, stineman_interp, vector_lengths, |
| 256 | + window_hanning, window_none) |
| 257 | + |
| 258 | +from matplotlib import cbook, mlab, pyplot as plt |
| 259 | +from matplotlib.pyplot import * |
268 | 260 |
|
269 | 261 | from numpy import *
|
270 | 262 | from numpy.fft import *
|
271 | 263 | from numpy.random import *
|
272 | 264 | from numpy.linalg import *
|
273 | 265 |
|
274 |
| -from matplotlib.pyplot import * |
275 |
| - |
276 |
| -# provide the recommended module abbrevs in the pylab namespace |
277 |
| -import matplotlib.pyplot as plt |
278 | 266 | import numpy as np
|
279 | 267 | import numpy.ma as ma
|
280 | 268 |
|
|
283 | 271 |
|
284 | 272 | # This is needed, or bytes will be numpy.random.bytes from
|
285 | 273 | # "from numpy.random import *" above
|
286 |
| -bytes = __builtins__['bytes'] |
| 274 | +bytes = six.moves.builtins.bytes |
0 commit comments