()
| 3382 | |
| 3383 | |
| 3384 | def test_log_scales(): |
| 3385 | fig, ax = plt.subplots() |
| 3386 | ax.plot(np.log(np.linspace(0.1, 100))) |
| 3387 | ax.set_yscale('log', base=5.5) |
| 3388 | ax.invert_yaxis() |
| 3389 | ax.set_xscale('log', base=9.0) |
| 3390 | xticks, yticks = ( |
| 3391 | [(t.get_loc(), t.label1.get_text()) for t in axis._update_ticks()] |
| 3392 | for axis in [ax.xaxis, ax.yaxis] |
| 3393 | ) |
| 3394 | assert xticks == [ |
| 3395 | (1.0, '$\\mathdefault{9^{0}}$'), |
| 3396 | (9.0, '$\\mathdefault{9^{1}}$'), |
| 3397 | (81.0, '$\\mathdefault{9^{2}}$'), |
| 3398 | (2.0, ''), |
| 3399 | (3.0, ''), |
| 3400 | (4.0, ''), |
| 3401 | (5.0, ''), |
| 3402 | (6.0, ''), |
| 3403 | (7.0, ''), |
| 3404 | (8.0, ''), |
| 3405 | (18.0, ''), |
| 3406 | (27.0, ''), |
| 3407 | (36.0, ''), |
| 3408 | (45.0, ''), |
| 3409 | (54.0, ''), |
| 3410 | (63.0, ''), |
| 3411 | (72.0, ''), |
| 3412 | ] |
| 3413 | assert yticks == [ |
| 3414 | (0.18181818181818182, '$\\mathdefault{5.5^{-1}}$'), |
| 3415 | (1.0, '$\\mathdefault{5.5^{0}}$'), |
| 3416 | (5.5, '$\\mathdefault{5.5^{1}}$'), |
| 3417 | (0.36363636363636365, ''), |
| 3418 | (0.5454545454545454, ''), |
| 3419 | (0.7272727272727273, ''), |
| 3420 | (0.9090909090909092, ''), |
| 3421 | (2.0, ''), |
| 3422 | (3.0, ''), |
| 3423 | (4.0, ''), |
| 3424 | (5.0, ''), |
| 3425 | ] |
| 3426 | |
| 3427 | |
| 3428 | def test_log_scales_no_data(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…