1 | initial version |
There are several ways to modify the arrow axes and their tick labels in a Matplotlib plot:
# Set arrow style and color
ax.xaxis.set_ticks_position('none') # hide x-axis arrow
ax.yaxis.set_ticks_position('none') # hide y-axis arrow
ax.spines['bottom'].set_color('gray') # change x-axis color
ax.spines['left'].set_color('gray') # change y-axis color
# Set tick positions and labels
ax.set_xticks([0, 2, 4, 6, 8, 10])
ax.set_xticklabels(['0', '2', '4', '6', '8', '10'])
ax.set_yticks([0, 20, 40, 60, 80, 100])
ax.set_yticklabels(['0', '20', '40', '60', '80', '100'])
# Rotate tick labels
plt.xticks(rotation=45)
plt.yticks(rotation=45)
# Add axis labels
ax.set_xlabel('xlabel', fontsize=12)
ax.set_ylabel('ylabel', fontsize=12)
# Set font size
plt.rcParams.update({'font.size': 10})