Skip to content

[BUG] imshow (Heatmap) unexpectedly cuts parts of the data? #1522

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

Closed
amiragha opened this issue Jan 12, 2021 · 2 comments
Closed

[BUG] imshow (Heatmap) unexpectedly cuts parts of the data? #1522

amiragha opened this issue Jan 12, 2021 · 2 comments

Comments

@amiragha
Copy link

Environment information:

dash                               1.18.1
dash-core-components               1.3.1
dash-html-components               1.0.1
dash-renderer                      1.1.2
dash-table                         4.4.1

Here is the issue: the following basic example doesn't show all the 9 cells of the data:

import dash                                                                                                                                                   
import dash_core_components as dcc                                                                                                                            
import dash_html_components as html                                                                                                                           
import plotly.express as px                                                                                                                                   
import numpy  as np                                                                                                                                           
                                                                                                                                                              
fig = px.imshow(                                                                                                                                              
    np.random.random([3, 3]),                                                                                                                                 
    x=['1', '2', '3m'],                                                                                                                                       
    y=['1', '2', '3m'],                                                                                                                                       
)                                                                                                                                                             
                                                                                                                                                              
app = dash.Dash(__name__)                                                                                                                                     
                                                                                                                                                              
app.layout = html.Div([                                                                                                                                       
    html.P("Example"),                                                                                                                                        
    dcc.Graph(id="graph", figure=fig),                                                                                                                        
])                                                                                                                                                            
                                                                                                                                                              
app.run_server(debug=True) 

It only shows a single block/cell of color instead of 9 different random colors?! The issue is due to uncommon choice of labels x, y, if I remove the "m" or don't give x, y labels it works as expected.

@alexcjohnson
Copy link
Collaborator

Try upgrading plotly.py (pip install --upgrade plotly) - plotly/plotly.py#2951 (🙇 @nicolaskruchten) makes autotyping stricter so will give you category axes because the values you provided are strings. With plotly.py v4.13.0 I saw what you describe (though I confess I don't quite understand why it took one value on each axis and not two), but with v4.14.2 I see the desired output:
Screen Shot 2021-01-12 at 9 39 15 AM

@gvwilson
Copy link
Contributor

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants