Commit 87c742b
committed
Fix axes aspect for non-linear, non-log, possibly mixed-scale axes.
The main change is to make Axes.get_data_ratio take axes scales into
account. This is a breaking change in get_data_ratio, but also the most
reasonable way I could think of to implement the feature while also
supporting third-party Axes subclasses that override this method (given
that it is explicitly documented as being overridable for this purpose).
(Compare, for example, with a patch that also deprecates get_data_ratio
and moves the whole computation to apply_aspect; now what do we do with
third-party overrides?)
Also move the adjustable="datalim"-part of the implementation of
apply_aspect down one indentation block for symmetry with
adjustable="box".
The change in test_log_scale_image is because we can't rely on aspect=1
not being implemented for semilog plots anymore...1 parent 9f1c730 commit 87c742b
4 files changed
Lines changed: 73 additions & 74 deletions
File tree
- doc/api/next_api_changes
- lib/matplotlib
- axes
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1396 | 1396 | | |
1397 | 1397 | | |
1398 | 1398 | | |
1399 | | - | |
| 1399 | + | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | 1402 | | |
1403 | 1403 | | |
1404 | 1404 | | |
1405 | | - | |
1406 | | - | |
1407 | | - | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
1411 | 1411 | | |
1412 | 1412 | | |
| 1413 | + | |
1413 | 1414 | | |
1414 | 1415 | | |
1415 | 1416 | | |
| |||
1455 | 1456 | | |
1456 | 1457 | | |
1457 | 1458 | | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | | - | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | 1459 | | |
1477 | 1460 | | |
1478 | 1461 | | |
1479 | 1462 | | |
1480 | 1463 | | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1484 | 1468 | | |
1485 | | - | |
1486 | | - | |
1487 | 1469 | | |
1488 | 1470 | | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
1495 | 1474 | | |
1496 | 1475 | | |
1497 | 1476 | | |
1498 | 1477 | | |
1499 | 1478 | | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
| 1479 | + | |
1506 | 1480 | | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1510 | 1484 | | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
1511 | 1489 | | |
1512 | 1490 | | |
1513 | 1491 | | |
1514 | 1492 | | |
1515 | 1493 | | |
1516 | | - | |
| 1494 | + | |
1517 | 1495 | | |
1518 | | - | |
| 1496 | + | |
1519 | 1497 | | |
1520 | 1498 | | |
1521 | 1499 | | |
1522 | 1500 | | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
1533 | 1506 | | |
1534 | 1507 | | |
1535 | 1508 | | |
1536 | 1509 | | |
1537 | 1510 | | |
1538 | 1511 | | |
1539 | 1512 | | |
1540 | | - | |
1541 | | - | |
| 1513 | + | |
1542 | 1514 | | |
1543 | 1515 | | |
1544 | 1516 | | |
1545 | 1517 | | |
1546 | 1518 | | |
1547 | 1519 | | |
1548 | 1520 | | |
1549 | | - | |
1550 | | - | |
| 1521 | + | |
| 1522 | + | |
1551 | 1523 | | |
1552 | 1524 | | |
1553 | 1525 | | |
| |||
1564 | 1536 | | |
1565 | 1537 | | |
1566 | 1538 | | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
| 1539 | + | |
1571 | 1540 | | |
1572 | 1541 | | |
1573 | 1542 | | |
1574 | 1543 | | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
| 1544 | + | |
1579 | 1545 | | |
1580 | 1546 | | |
1581 | 1547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6495 | 6495 | | |
6496 | 6496 | | |
6497 | 6497 | | |
| 6498 | + | |
| 6499 | + | |
| 6500 | + | |
| 6501 | + | |
| 6502 | + | |
| 6503 | + | |
| 6504 | + | |
| 6505 | + | |
| 6506 | + | |
| 6507 | + | |
| 6508 | + | |
| 6509 | + | |
| 6510 | + | |
| 6511 | + | |
| 6512 | + | |
| 6513 | + | |
| 6514 | + | |
| 6515 | + | |
| 6516 | + | |
| 6517 | + | |
| 6518 | + | |
| 6519 | + | |
| 6520 | + | |
| 6521 | + | |
| 6522 | + | |
| 6523 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
686 | 686 | | |
687 | 687 | | |
688 | 688 | | |
689 | | - | |
690 | | - | |
| 689 | + | |
691 | 690 | | |
692 | 691 | | |
693 | 692 | | |
694 | 693 | | |
695 | | - | |
696 | | - | |
697 | | - | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
698 | 697 | | |
699 | 698 | | |
700 | 699 | | |
| |||
0 commit comments