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

y-tick mark in the wrong location #2

Open
bryantje opened this issue Aug 10, 2020 · 0 comments
Open

y-tick mark in the wrong location #2

bryantje opened this issue Aug 10, 2020 · 0 comments

Comments

@bryantje
Copy link

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.
image
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)

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

1 participant