Skip to content

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

Closed
@amiragha

Description

@amiragha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions