Removing axis ticks in Python Matplotlib plots while keeping the axes labels

You can remove the axes in a Matplotlib plot with the command axis('off') but if you want to keep the axes labels, that doesn't work. So, here is a way around it:

ax = subplot(1,1,1) 
xlabel('some label for x') 
ylabel('some label for y')

You can customize your axis ticks and tick labels using set_xticks(), set_yticks(), set_xticklabels() and set_yticklabels(). Check the Maplotlib documentation for more details.


Post a Comment

Popular Posts