2

I want to hide the meridian and parallel lines from my plot and add the tick marks. I could remove the lines by setting linewidth=0, but how to add the tick marks with each Lat-Lon label.

meridians = np.arange(70.,90.,0.5)
m.drawmeridians(meridians,labels=[0,0,0,1],fontsize=9, linewidth=0)
  • Have you used set_yticks() and set_xticks()? matplotlib.org/1.5.1/faq/… – recurvata Mar 11 '16 at 20:32
  • No, I haven't used this as I am working with spatial plots. After your reply I included it as ax.set_xticks((70.,90.,0.5)) but it's not working. – Mario Mar 11 '16 at 21:01
1

ax.set_xticks([0,1,2]) worked in my case.

You might also want to try suppress_ticks = False, see https://stackoverflow.com/questions/18363987/basemap-how-to-remove-actual-lat-lon-lines-while-keeping-the-ticks-on-the-axis

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.