Commit 46db9e2
committed
Simplify decade up- and down-rounding.
Instead of `decade_up` and `decade_down`, use more explicit
`_decade_less`, `_decade_less_equal`, etc. which moreover also handle
negative values (used by the symlog scale).
Previously, `semilogx([.1, .1], [1, 2])` would autoscale the x-axis from
a bit less than 0.1 to a bit more than 1, because 0.1 == 10**-1 so
decade_down(0.1) would use `floor(-1) == -1` and return 0.1, while
decade_up(0.1) would return 1.
With this PR, `semilogx([.1, .1], [1, 2])` instead autoscales the x-axis
from a bit less than 0.01 to a bit more than 1 (i.e. one decade on each
side), which seems more logical.1 parent 9221a55 commit 46db9e2
2 files changed
Lines changed: 69 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2061 | 2061 | | |
2062 | 2062 | | |
2063 | 2063 | | |
| 2064 | + | |
2064 | 2065 | | |
2065 | 2066 | | |
2066 | 2067 | | |
| |||
2069 | 2070 | | |
2070 | 2071 | | |
2071 | 2072 | | |
| 2073 | + | |
2072 | 2074 | | |
2073 | 2075 | | |
2074 | 2076 | | |
| |||
2094 | 2096 | | |
2095 | 2097 | | |
2096 | 2098 | | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
2097 | 2149 | | |
2098 | 2150 | | |
2099 | 2151 | | |
| |||
2271 | 2323 | | |
2272 | 2324 | | |
2273 | 2325 | | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
| 2326 | + | |
| 2327 | + | |
2278 | 2328 | | |
2279 | 2329 | | |
2280 | 2330 | | |
| |||
2296 | 2346 | | |
2297 | 2347 | | |
2298 | 2348 | | |
2299 | | - | |
2300 | | - | |
| 2349 | + | |
| 2350 | + | |
2301 | 2351 | | |
2302 | 2352 | | |
2303 | 2353 | | |
| |||
2451 | 2501 | | |
2452 | 2502 | | |
2453 | 2503 | | |
2454 | | - | |
2455 | | - | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
2459 | | - | |
2460 | | - | |
2461 | | - | |
2462 | | - | |
2463 | | - | |
2464 | | - | |
| 2504 | + | |
| 2505 | + | |
2465 | 2506 | | |
2466 | | - | |
2467 | | - | |
2468 | | - | |
2469 | | - | |
2470 | | - | |
2471 | | - | |
| 2507 | + | |
| 2508 | + | |
2472 | 2509 | | |
2473 | 2510 | | |
2474 | 2511 | | |
| |||
0 commit comments