Comments (6)
What's mplcairo.__version__
? (That'll give me the commit the nightly is from.)
from mplcairo.
I see where the exception is coming from. Do you, by any chance, have the path.simplify_threshold set to a nonzero value? Does setting it to zero fix the issue?
If it does, what's happening is the following:
In order to improve the performance of drawing scatterplots with various sizes and colors, whenever it is asked to draw a PathCollection (the class behind scatterplots), mplcairo keeps a cache of the scatter elements drawn at various sizes (lazily populated on-demand), so that rasterization is performed only once and later uses can just "stamp" the image from the buffer.
Unfortunately, fill_between is also implemented using PathCollection, so mplcairo tries to do the same here... and ends up trying to draw the fill_between polygon at an enourmous magnification (at that point it doesn't realize yet that the thing will be cropped).
I plan to fix that by following the same strategy as for draw_markers, which is to fall back on "naive" drawing when the polygon is bigger than the canvas size (for example).
I cannot reproduce the backend changing issue (I get module://mplcairo.qt all the time). What's your version of ipython, do you have anything of interest in your ipython_config.py, do you use e.g. %matplotlib auto
, do you use MPLBACKEND, etc.?
from mplcairo.
FWIW (I still have to read #4).
The mplcairo version that I am using:
In [1]: mplcairo.__version__
Out[1]: '0.1a1.post15+g322e722'
Excerpt from my matplotlibrc file:
### SAVING FIGURES
#path.simplify : True # When True, simplify paths by removing "invisible"
# points to reduce file size and increase rendering
# speed
#path.simplify_threshold : 0.1 # The threshold of similarity below which
# vertices will be removed in the simplification
# process
#path.snap : True # When True, rectilinear axis-aligned paths will be snapped to
# the nearest pixel when certain criteria are met. When False,
# paths will never be snapped.
#path.sketch : None # May be none, or a 3-tuple of the form (scale, length,
# randomness).
# *scale* is the amplitude of the wiggle
# perpendicular to the line (in pixels). *length*
# is the length of the wiggle along the line (in
# pixels). *randomness* is the factor by which
# the length is randomly scaled.
Excerpt from my .bashrc file:
export MPLBACKEND="module://mplcairo.qt"
I am using IPython 6.2.1 (from conda). AFAICT, I am not using a peculiar ipython_config.py
file (there is no such file in $HOME/.ipython/
), but indeed it looks like an IPython issue:
python example_issue_mplcairo.py
#0 module://mplcairo.qt
#1 module://mplcairo.qt
#2 module://mplcairo.qt
#3 module://mplcairo.qt
from mplcairo.
OK, I can reproduce it now. What's your ~/.config/matplotlib/matplotlibrc?
from mplcairo.
As it is several hundreds of line long, see the gist here. (I cannot remember if I modified it a lot or not compared to the default version.)
from mplcairo.
FWIW, (at least on my side) it looks like #5 fixes the second half of the issue ;).
from mplcairo.
Related Issues (20)
- :question: No SVG output when using Cairo operator (SCREEN)? HOT 6
- y-axis title rotated HOT 5
- matplotlib inline support for JupyterLab HOT 2
- The sizes of saved vector outputs (PDF, EPS) are too large. HOT 3
- Using locl features available in a font HOT 11
- Pytest hooks not doing anything? HOT 6
- Python 3.10 wheels and compatibility HOT 6
- Printing of Tamil language characters HOT 4
- blitting support? HOT 1
- Jupyter inline plot only appears on second try HOT 2
- Unable to install from pip HOT 6
- Wheels for aarch64 HOT 2
- mplcairo-git on the AUR HOT 4
- ImportError: cannot import name '_mplcairo' from partially initialized module 'mplcairo' HOT 5
- Jupyter Assertion Error / AttributeError: can't set attribute 'renderer' HOT 3
- Python 3.11 wheels HOT 3
- Circular import error HOT 2
- Devanagari script rendering incorrectly HOT 1
- Poor on-screen font antialiasing/smoothing in mplcairo HOT 18
- Any plans for a new stable release? HOT 1
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 mplcairo.