-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deviation ellipses example #514
Conversation
example showing bivariate deviation ellipses of petal length and width of three iris species
This actually works fine for me without any print statement... I'm not certain what's going on there. The error is horribly uninformative, but we're working on that (see #480) The reason the example test is failing is because it uses scipy, which is not a build dependency for Altair. Scipy is heavy enough that we probably don't want to include that, so we'd have to add some mechanism to specify that this example should not be included in the test suite. |
Ok, no problem. |
Seeing this -- I wonder if Vega/Vega-Lite should have a native ellipse support. (Feel free to file a feature request in Vega if you agree.) |
Happy with the end result, but not comfortable merging so much complexity I don't understand yet #3715
* Create deviation_ellipses.py example showing bivariate deviation ellipses of petal length and width of three iris species * docs: Initial rewrite of (#514) Happy with the end result, but not comfortable merging so much complexity I don't understand yet #3715 * ci(typing): Adds `scipy-stubs` to `altair[doc]` `scipy` is only used for one example in the user guide, but this will be the second https://docs.scipy.org/doc/scipy/release/1.15.0-notes.html#other-changes * fix: Only install `scipy-stubs` on `>=3.10` * chore(typing): Ignore incorrect `pandas` stubs * ci(typing): ignore `scipy` on `3.9` https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker https://github.com/vega/altair/actions/runs/12612565960/job/35149436953?pr=3747 * docs: Add missing category * fix: Add missing support for `from __future__ import annotations` Fixes https://github.com/vega/altair/actions/runs/12612637008/job/35149593128?pr=3747#step:6:25 * test: skip example when `scipy` not installed Temporary fix for https://github.com/vega/altair/actions/runs/12612997919/job/35150338097?pr=3747 * docs: reduce segments `100` -> `50` Observed no visible reduction in quality. Slightly visible at `<=40` * docs: Clean up `numpy`, `scipy` docs/comments * refactor: Simplify `numpy` transforms * docs: add tooltip, increase size * fix: Remove incorrect range stop Previously returned `segments+1` rows, but this isn't specified in `ggplot2 https://github.com/tidyverse/ggplot2/blob/efc53cc000e7d86e3db22e1f43089d366fe24f2e/R/stat-ellipse.R#L122 * refactor: Remove special casing `__future__` import I forgot that the only requirement was that the import is the **first statement**. Partially reverts (7cd2a77) * docs: Remove unused `method` code Also resolves #3747 (comment) * docs: rename to 'Confidence Interval Ellipses' * docs: add references to description * docs: Adds methods syntax version Includes comment removal suggestion in (#3747 (comment)) * refactor: Rewrite `pd_ellipse` - Fixed a type ignore (causes by incomplete stubs) - Renamed variables - Make replace the implicit `"index"` column with naming it `"order"` #3747 (comment) * ci(uv): sync `scipy-stubs` dc7639d a296b82 * refactor(typing): Try removing `from __future__ import annotations` #3747 (comment), #3747 (comment) * refactor: rename `np_ellipse` -> `confidence_region_2d` #3747 (comment) * refactor: rename `pd_ellipse` -> `grouped_confidence_regions` #3747 (comment) * docs: change category to `"case studies"` #3747 (comment) * styling --------- Co-authored-by: Serge-Étienne Parent <essicolo@tuta.io> Co-authored-by: Mattijn van Hoek <mattijn@gmail.com>
This is an example showing bivariate deviation ellipses of petal length and width of three iris species. In Jupyter lab, it works only if chart_deviation is printed before printing chart_points + chart_deviation (error message below). A more complete example could include a pairs plot including petal and sepal dimensions, with ellipses. Is it feasible?