Repository navigation
Commit 4153147
committed
FIX: Support single row/column grids for nearest shading
Explicitly providing a single row and/or single column grid
for pcolor(mesh) with nearest shading, silently produces no plot.
This happens because nearest shading interprets the X and Y coordinates as
cell centers and then calculates, from neighboring centers, new X and Y
coordinates for the cell corners. When a coordinate array contains only
one center, its corresponding cell size cannot be determined from neighboring centers.
This commit adds a fallback that determines the directional cell size for a
single center by taking half of its absolute value on either side. For a
zero-valued center -/+ 0.5 is used instead. This allows the cells to be
plotted. And a warning is emitted to notify the user.1 parent 2d0352a commit 4153147
2 files changed
Lines changed: 31 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6560 | 6560 | | |
6561 | 6561 | | |
6562 | 6562 | | |
6563 | | - | |
6564 | | - | |
6565 | | - | |
| 6563 | + | |
| 6564 | + | |
| 6565 | + | |
| 6566 | + | |
| 6567 | + | |
| 6568 | + | |
| 6569 | + | |
| 6570 | + | |
| 6571 | + | |
| 6572 | + | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
| 6578 | + | |
| 6579 | + | |
6566 | 6580 | | |
6567 | 6581 | | |
6568 | 6582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
1681 | 1695 | | |
1682 | 1696 | | |
1683 | 1697 | | |
| |||
0 commit comments