Comments (9)
Confirmed on master (after v1.1.1rc2 has been released).
@mdboom: Do we have a ps backend maintainer?
from matplotlib.
Confirmed on current master (currently at 42878d2) post 1.2 feature-freeze, too.
I've had a quick look at this. The PS backend does all the figure rendering first, and then processes the TeX. It's weird, since the tick label that's technically meant to be 'under' the legend box is classed returns True
for get_visible()
. This is also the case in the PDF backend, but I guess the PDF does the stacking in the backend properly, I don't know.
In any case, shouldn't get_visible()
return False
for the Text
artist underneath the legend box?
from matplotlib.
On Wed, Aug 22, 2012 at 12:57 PM, Damon McDougall
[email protected]:
Confirmed on current master (currently at 42878d242878d2)
post 1.2 feature-freeze, too.I've had a quick look at this. The PS backend does all the figure
rendering first, and then processes the TeX. It's weird, since the tick
label that's technically meant to be 'under' the legend box is classed
returns True for get_visible(). This is also the case in the PDF backend,
but I guess the PDF does the stacking in the backend properly, I don't know.In any case, shouldn't get_visible() return False for the Text artist
underneath the legend box?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/131#issuecomment-7941132.
get_visible() has nothing to do with whether it is visible through all
layers, but rather whether it is ever drawn or not. It is impossible to
know if any other artist is being drawn on top of it or not (and what if
that object is partly transparent?)
So, it seems that the PS backend violates the zorder settings by deferring
the TeX elements to later. That would be the main bug that would have to
be addressed.
Ben Root
from matplotlib.
Thanks for the clarification.
If that's the case, then this will be very invasive to fix. I'm a little confused as to why the latex wasn't just embedded on the fly. Perhaps this is a limitation of PostScript.
from matplotlib.
Checked with master prior to 1.3 release: the bug has not magically disappeared.
from matplotlib.
@efiring I think to fix this would require some pretty major thinking and open heart surgery on the PS backend, unless someone can see an easier way. Once upon a time I did a quick comparison with the PDF backend to try and see if we could steal some of the latex zorder functionality and port it to the PS backend but I got lost pretty quickly.
from matplotlib.
@jkseppan, I suspect this bug is very hard to fix, and is not going to get fixed, in which case it would be nice to close it with a "won't fix". I presume a reasonable workaround is to use the pdf backend instead and then use convert or gs to generate the ps or eps file. Maybe a note to that effect could go in the docs.
from matplotlib.
Perhaps I can give some background on why the backend works this way. When you create EPS files in something like Matlab, you cannot usually typeset math inside the files. If you include a Matlab EPS file in your TeX document, the text and equations in it are going to look different from the rest of the document. That's why psfrag was created: you'd enter just some placeholder text in Matlab, and use the psfrag macros to generate some magic PostScript code to change the placeholders to equations rendered by TeX, and when this code is included in the output of dvips it would modify the included EPS file accordingly. Now the matplotlib PostScript backend adds one more layer by creating a LaTeX file that uses psfrag to modify the intermediate matplotlib output to render equations in TeX, and calling latex and dvips on it. I don't think there is any deep technical reason that z-order could not be made to work, but even figuring out which part of the Python/TeX/dvips/PostScript polyglot stack is doing it wrong is going to be a challenge. Certainly in the original use case of psfrag you'd want the equations to be typeset on top of any Matlab plots.
When I implemented usetex for the pdf backend, I couldn't do the same, since psfrag is implemented with PostScript tricks and depends on dvips. Thus we have dviread, which takes a different approach and has different bugs, so going via the pdf backend and using some pdf→ps converter can give different results.
from matplotlib.
Just tried the code above and it seems fine to me now - I guess it was fixed at some point between 2016 and now, so going to close!
from matplotlib.
Related Issues (20)
- [MNT]: Misleading function name `Poly3DCollection.get_vector()` HOT 1
- [Bug]: Interactive Mode Image Visualization HOT 1
- [Bug]: Qt test_ipython fails on older ipython HOT 2
- [TST] Upcoming dependency test failures HOT 1
- [Doc]: quiver ‘scale_units’ description is not very not clear HOT 1
- [Bug]: typehint missing for matplotlib Axes HOT 1
- [ENH]: Faking a text's metrics to fix its alignment HOT 1
- [Bug]: Matplotlib not work with MiKTeX. HOT 6
- [Bug]: LaTeX option clash error when pgf.preamble uses certain packages
- [MNT]: scale of the quiver does not print the actually value till after the figure pop up. HOT 1
- [Bug]: "fill_between" not showing on some PDF readers when using "alpha" HOT 1
- [Bug]: 'TimedAnimation' object has no attribute '_framedata' HOT 1
- [ENH]: matplotlib.widgets.PolygonSelector widget initial cursor position at data rather than (0,0) HOT 1
- [Doc]: drawedges attribute described twice in matplotlib.colorbar documentation HOT 5
- [ENH]: Add TypedDict (like) type hints to rcParams HOT 3
- [Bug]: Inconsistent Visualization of Intervals in ax.barh for Different Duration Widths HOT 2
- [Bug]: `set_text` does not work when accessed from `axis.get_xticklabels` HOT 2
- [ENH]: More accurate type stub for `plt.subplots` like VSCode did before. HOT 1
- [ENH]: Band and Sankey Diagramm HOT 2
- [Bug]: constant valued line plot has strange/unexpected y-axis HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matplotlib.