You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plot displays a 4×4 confusion matrix heatmap for a sentiment analysis classifier with four classes: Negative, Neutral, Positive, and Very Positive. The matrix uses a sequential Blues colormap ranging from light (low values ~1-15) to dark blue (high values ~70-85). The y-axis shows "True Label" and x-axis shows "Predicted Label". Each cell contains white or black numeric annotations showing the count values (white text on dark backgrounds, black text on light backgrounds). The title "confusion-matrix · plotly · pyplots.ai" is centered at the top. A colorbar on the right shows the "Count" scale from approximately 1-85. The diagonal cells (correct predictions) are darker blue, clearly showing the model performs well with most predictions on the diagonal. The matrix is square with equal cell dimensions, and all text is clearly legible.
Quality Score: 93/100
Criteria Checklist
Visual Quality (38/40 pts)
VQ-01: Text Legibility (10/10) - Title at 28pt, axis labels at 22pt, tick labels at 18pt, cell annotations at 24pt - all perfectly readable
VQ-02: No Overlap (8/8) - No overlapping text, all labels clearly separated
VQ-03: Element Visibility (8/8) - Cells are well-sized, colormap distinguishes values effectively
VQ-04: Color Accessibility (5/5) - Blues colormap is colorblind-safe sequential palette
VQ-05: Layout Balance (5/5) - Square layout with good margins, plot fills canvas well
VQ-06: Axis Labels (1/2) - Descriptive labels ("True Label", "Predicted Label") but no units needed for categorical data
VQ-07: Grid & Legend (1/2) - Colorbar well placed with appropriate sizing, no grid needed for heatmap
Spec Compliance (25/25 pts)
SC-01: Plot Type (8/8) - Correct confusion matrix heatmap visualization
SC-02: Data Mapping (5/5) - True labels on Y-axis, Predicted labels on X-axis as specified
SC-03: Required Features (5/5) - Annotated cells with counts, colorbar, sequential colormap, clear axis labeling
SC-04: Data Range (3/3) - All data visible, appropriate scale
CQ-03: Clean Imports (2/2) - Only numpy and plotly.graph_objects imported, both used
CQ-04: No Deprecated API (1/1) - Uses current Plotly API
CQ-05: Output Correct (1/1) - Saves as plot.png and plot.html
Library Features (5/5 pts)
LF-01: Uses distinctive library features (5/5) - Custom hovertemplate for interactivity, graph_objects for fine control, plotly_white template, scale anchoring for square cells
Strengths
Excellent use of Plotly's hovertemplate for interactive tooltips showing "True: {y}, Predicted: {x}, Count: {z}"
Smart text color contrast logic - white text on dark cells, black text on light cells
Square cells using scaleanchor ensures proper matrix visualization
Clean, professional appearance with plotly_white template
Realistic sentiment analysis data with believable misclassification patterns (adjacent classes confused more often)
Weaknesses
Image dimensions (1200×1200 with scale=3 = 3600×3600) differ slightly from the standard 4800×2700 landscape format, though square format is appropriate for confusion matrices
VQ-06: Axis labels could be slightly more descriptive (e.g., "True Sentiment Class" vs "True Label")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation:
confusion-matrix- plotlyImplements the plotly version of
confusion-matrix.File:
plots/confusion-matrix/implementations/plotly.py🤖 impl-generate workflow