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
This code works great but the y-tick marks and annotations are misaligned rather than centered. I have changed my version of matplotlib as it seemed to be a known version issue and even used the "plt.yticks([0.5,1.5]" trick but still the labels are not centered.
Snippet of Code:
# MAKE THE HEATMAP VISUALIZATION
plt.figure(figsize=figsize)
sns.heatmap(cf,annot=box_labels,fmt="",cmap=cmap,cbar=cbar,xticklabels=categories,yticklabels=categories)
if xyplotlabels:
plt.ylabel('True', fontsize=16)
plt.xlabel('Predicted' + stats_text, fontsize=16)
plt.xticks([0.5,1.5], fontsize=16)
plt.yticks([0.5,1.5], fontsize=16, ha="center", va="bottom")
else:
plt.xlabel(stats_text)
if title:
plt.title(title)
make_confusion_matrix(cm_rf)
The text was updated successfully, but these errors were encountered:
This code works great but the y-tick marks and annotations are misaligned rather than centered. I have changed my version of matplotlib as it seemed to be a known version issue and even used the "plt.yticks([0.5,1.5]" trick but still the labels are not centered.
Snippet of Code:
# MAKE THE HEATMAP VISUALIZATION
plt.figure(figsize=figsize)
sns.heatmap(cf,annot=box_labels,fmt="",cmap=cmap,cbar=cbar,xticklabels=categories,yticklabels=categories)
if xyplotlabels:
plt.ylabel('True', fontsize=16)
plt.xlabel('Predicted' + stats_text, fontsize=16)
plt.xticks([0.5,1.5], fontsize=16)
plt.yticks([0.5,1.5], fontsize=16, ha="center", va="bottom")
else:
plt.xlabel(stats_text)
make_confusion_matrix(cm_rf)
The text was updated successfully, but these errors were encountered: