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) 
ax.plot(somedata) 
ax.set_xticks([]) 
ax.set_yticks([]) 
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.

Comments

  1. Hey, appreciated the post. Google showed it then I had to follow the link.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. What to Know Before Playing at a Casino
    A 토토일정 casino does not 토토 그래프 사이트 넷마블 actually have to pay for 사설토토 취업 샤오미 your 사설토토 나무 샤오미 money. You can place a bet by getting your winnings from the casino's 유출 픽 games. You must

    ReplyDelete

Post a Comment

Popular Posts