Skip to content
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

Improve error message for non-matching types with aspect set to equal #6103

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Feb 6, 2024

Fixes #6089

This can create the Matplotlib problem without rasterize. rasterize will have an Image aspect set to 'equal', whereas Quadmesh have an aspect set to square.

I have chosen to raise a TypeError instead of adding custom logic as it does not really make sense to take the equal of an axis with numbers and an axis with timedelta. An alternative could be to set the aspect to 1.

import holoviews as hv
import numpy as np
import pandas as pd

hv.extension("matplotlib")

X = pd.date_range(start="1/1/2018", end="1/08/2018", periods=100)
Y = np.linspace(1, 100, 100)
Z = np.random.randn(100, 100)

hv.QuadMesh((X, Y, Z)).opts(aspect='equal')

TODO

  • Improve plotly
  • Add tests

@hoxbro hoxbro added the type: bug Something isn't correct or isn't working label Feb 6, 2024
@hoxbro hoxbro changed the title Improve error message for non-matching types with aspect set to equal. Improve error message for non-matching types with aspect set to equal Feb 6, 2024
@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (f81533a) 88.66% compared to head (42a87f6) 88.66%.
Report is 1 commits behind head on main.

Files Patch % Lines
holoviews/plotting/mpl/element.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6103      +/-   ##
==========================================
- Coverage   88.66%   88.66%   -0.01%     
==========================================
  Files         314      314              
  Lines       65975    65985      +10     
==========================================
+ Hits        58497    58505       +8     
- Misses       7478     7480       +2     
Flag Coverage Δ
ui-tests 23.67% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro hoxbro marked this pull request as draft February 8, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't correct or isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rasterize with time series data fails for plotly and matplotlib
2 participants