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
As of #9498, we have an _update_title_pos, but I guess it only checks for the xlabel, and not the tick labels. Should be relatively straightforward to fix I think...
importpandasaspdimportnumpyasnpimportstringimportmatplotlib.pyplotaspltn=10names= ['Long Name '+suffixforsuffixinstring.ascii_uppercase[:n]]
fig=plt.figure(constrained_layout=True)
ax=plt.gca()
ax.set_xticks(np.arange(n))
ax.set_xticklabels(names)
ax.set_yticks(np.arange(n))
ax.set_yticklabels(names)
# Set ticks on both sides of axes onax.tick_params(axis="x", bottom=True, top=True, labelbottom=True, labeltop=True)
# Rotate and align bottom ticklabelsplt.setp([tick.label1fortickinax.xaxis.get_major_ticks()], rotation=45,
ha="right", va="center", rotation_mode="anchor")
# Rotate and align top ticklabelsplt.setp([tick.label2fortickinax.xaxis.get_major_ticks()], rotation=45,
ha="left", va="center",rotation_mode="anchor")
ax.set_title("Name Co-Occurrences")
plt.show()
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Per https://stackoverflow.com/questions/55289921/matplotlib-matshow-xtick-labels-on-top-and-bottom @ImportanceOfBeingErnest
As of #9498, we have an _update_title_pos, but I guess it only checks for the xlabel, and not the tick labels. Should be relatively straightforward to fix I think...
The text was updated successfully, but these errors were encountered: