Commit 3795272
Fix automatic xlims in line plots (#16600)
* BUG: set correct xlims for lines (#11471, #11310)
* Do not assume that xdata is sorted.
* Use numpy.nanmin() and numpy.nanmax() instead.
* BUG: Let new MPL automatically determine xlims (#15495)
* Avoid setting xlims since recent matplotlib already does it correctly
* and we should let it apply its default styles where possible
* TST: plotting: update expected results for matplotlib 2
Matplotlib 2.0 uses new defaults that cause some of our tests to fail.
This adds appropriate new sets of expected results to the following
tests in tests/plotting/test_datetimelike.py:
test_finder_daily
test_finder_quarterly
test_finder_annual
test_finder_hourly
test_finder_minutely
test_finder_monthly
test_format_timedelta_ticks_narrow
test_format_timedelta_ticks_wide
* TST: plotting: Relax some tests to work with matplotlib 2.0
Matplotlib 2.0 by default now adds some padding between the boundaries
of the data and the boundaries of the plot. This causes some of our
tests to fail if we don't relax them slightly.
modified: pandas/tests/plotting/test_datetimelike.py
test_irregular_ts_shared_ax_xlim
test_mixed_freq_regular_first
test_mixed_freq_regular_first_df
test_secondary_y_irregular_ts_xlim
test_secondary_y_non_ts_xlim
test_secondary_y_regular_ts_xlim
modified: pandas/tests/plotting/test_frame.py
test_area_lim
test_line_lim
modified: pandas/tests/plotting/test_series.py
test_ts_area_lim
test_ts_line_lim
* TST: Add lineplot tests with unsorted x data
Two new tests check interaction of non-monotonic x data and xlims:
test_frame / test_unsorted_index_lims
test_series / test_unsorted_index_xlim
* DOC: lineplot/xlims whatsnew entry for v0.21.01 parent 6630c4e commit 3795272
File tree
6 files changed
+150
-59
lines changed- doc/source/whatsnew
- pandas
- plotting
- tests/plotting
6 files changed
+150
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
969 | 970 | | |
970 | 971 | | |
971 | 972 | | |
972 | | - | |
973 | | - | |
974 | | - | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
975 | 977 | | |
976 | 978 | | |
977 | 979 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
365 | | - | |
| 364 | + | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | 389 | | |
391 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
392 | 399 | | |
393 | 400 | | |
394 | 401 | | |
395 | 402 | | |
396 | 403 | | |
397 | 404 | | |
398 | 405 | | |
| 406 | + | |
399 | 407 | | |
400 | 408 | | |
401 | 409 | | |
| |||
404 | 412 | | |
405 | 413 | | |
406 | 414 | | |
407 | | - | |
408 | 415 | | |
409 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
410 | 425 | | |
411 | 426 | | |
412 | 427 | | |
413 | 428 | | |
414 | 429 | | |
415 | 430 | | |
416 | 431 | | |
| 432 | + | |
417 | 433 | | |
418 | 434 | | |
419 | 435 | | |
| |||
422 | 438 | | |
423 | 439 | | |
424 | 440 | | |
425 | | - | |
426 | 441 | | |
427 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
428 | 451 | | |
429 | 452 | | |
430 | 453 | | |
431 | 454 | | |
432 | 455 | | |
433 | 456 | | |
434 | 457 | | |
| 458 | + | |
435 | 459 | | |
436 | 460 | | |
437 | 461 | | |
| |||
450 | 474 | | |
451 | 475 | | |
452 | 476 | | |
453 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
454 | 482 | | |
455 | 483 | | |
456 | 484 | | |
| |||
470 | 498 | | |
471 | 499 | | |
472 | 500 | | |
473 | | - | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
474 | 505 | | |
475 | 506 | | |
476 | 507 | | |
| |||
481 | 512 | | |
482 | 513 | | |
483 | 514 | | |
484 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
485 | 519 | | |
486 | 520 | | |
487 | 521 | | |
| |||
665 | 699 | | |
666 | 700 | | |
667 | 701 | | |
668 | | - | |
669 | | - | |
| 702 | + | |
| 703 | + | |
670 | 704 | | |
671 | 705 | | |
672 | 706 | | |
| |||
696 | 730 | | |
697 | 731 | | |
698 | 732 | | |
699 | | - | |
700 | | - | |
| 733 | + | |
| 734 | + | |
701 | 735 | | |
702 | 736 | | |
703 | 737 | | |
| |||
1211 | 1245 | | |
1212 | 1246 | | |
1213 | 1247 | | |
1214 | | - | |
1215 | | - | |
| 1248 | + | |
| 1249 | + | |
1216 | 1250 | | |
1217 | 1251 | | |
1218 | 1252 | | |
| |||
1228 | 1262 | | |
1229 | 1263 | | |
1230 | 1264 | | |
1231 | | - | |
| 1265 | + | |
1232 | 1266 | | |
1233 | 1267 | | |
1234 | 1268 | | |
| |||
1245 | 1279 | | |
1246 | 1280 | | |
1247 | 1281 | | |
1248 | | - | |
| 1282 | + | |
1249 | 1283 | | |
1250 | 1284 | | |
1251 | 1285 | | |
| |||
1278 | 1312 | | |
1279 | 1313 | | |
1280 | 1314 | | |
1281 | | - | |
1282 | | - | |
| 1315 | + | |
| 1316 | + | |
1283 | 1317 | | |
1284 | 1318 | | |
1285 | 1319 | | |
| |||
1294 | 1328 | | |
1295 | 1329 | | |
1296 | 1330 | | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
1300 | 1339 | | |
1301 | 1340 | | |
1302 | 1341 | | |
| |||
1312 | 1351 | | |
1313 | 1352 | | |
1314 | 1353 | | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
1321 | | - | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
1326 | 1380 | | |
1327 | 1381 | | |
1328 | 1382 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
307 | 330 | | |
308 | 331 | | |
309 | 332 | | |
| |||
735 | 758 | | |
736 | 759 | | |
737 | 760 | | |
738 | | - | |
739 | | - | |
| 761 | + | |
| 762 | + | |
740 | 763 | | |
741 | 764 | | |
742 | 765 | | |
743 | 766 | | |
744 | | - | |
745 | | - | |
| 767 | + | |
| 768 | + | |
746 | 769 | | |
747 | 770 | | |
748 | 771 | | |
| |||
751 | 774 | | |
752 | 775 | | |
753 | 776 | | |
754 | | - | |
755 | | - | |
| 777 | + | |
| 778 | + | |
756 | 779 | | |
757 | 780 | | |
758 | 781 | | |
| |||
763 | 786 | | |
764 | 787 | | |
765 | 788 | | |
766 | | - | |
767 | | - | |
| 789 | + | |
| 790 | + | |
768 | 791 | | |
769 | 792 | | |
770 | 793 | | |
| |||
0 commit comments