Commit 4939e6f
committed
Autodetect whether pgf can use \includegraphics[interpolate].
This is done by reusing the same LatexManager instance as the one used
for measuring text extents.
As an aside, this exposes an awkwardness in the implementation of
LatexManager -- after an error occurs, the instance needs to be
discarded (ideally, the instance would auto-create a new subprocess).
This is why _get_image_inclusion_command manually discards the cached
instance in such a case.
For recent setups where \includegraphics[interpolate=true] is available,
the cost of this PR is essentially just an additional
\usepackage{graphicx} executed once; for older setups, an additional
instantiation of a latex subprocess (only once).
This can't be tested on CI because Travis' version of latex is too old,
but can be manually tested by inspecting a resulting pgf output, and
possibly changing `interpolate=true` by a nonexistent option (e.g.
`foobar` and checking that there's fallback to \pgfimage in that case.1 parent 18a30ce commit 4939e6f
File tree
2 files changed
+36
-5
lines changed- doc/api/next_api_changes
- lib/matplotlib/backends
2 files changed
+36
-5
lines changed| 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 | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| 223 | + | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
| |||
376 | 378 | | |
377 | 379 | | |
378 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
379 | 397 | | |
380 | 398 | | |
381 | 399 | | |
| |||
397 | 415 | | |
398 | 416 | | |
399 | 417 | | |
400 | | - | |
401 | | - | |
| 418 | + | |
402 | 419 | | |
403 | 420 | | |
404 | 421 | | |
| |||
413 | 430 | | |
414 | 431 | | |
415 | 432 | | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
416 | 437 | | |
417 | 438 | | |
418 | 439 | | |
| |||
660 | 681 | | |
661 | 682 | | |
662 | 683 | | |
663 | | - | |
664 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
665 | 687 | | |
666 | 688 | | |
667 | 689 | | |
| |||
724 | 746 | | |
725 | 747 | | |
726 | 748 | | |
727 | | - | |
| 749 | + | |
| 750 | + | |
728 | 751 | | |
729 | 752 | | |
730 | 753 | | |
| |||
0 commit comments