From: Oscar B. <osc...@gm...> - 2016-01-29 16:50:10
|
On 28 January 2016 at 19:49, Julian Irwin <jul...@gm...> wrote: > > > I am looking for a way to hide tick marks (not the labels!) that coincide with axis lines. I think this is a problem for me because of the relative line thicknesses of my axis lines and tick marks, but I want to leave those thicknesses unchanged (I like the look of the thickness settings I am using now). Try this: from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.plot([0, 1], [0, 1]) print(ax.get_xticks()) ax.set_xticks(ax.get_xticks()[1:-1]) # Remove first and last ticks print(ax.get_xticks()) -- Oscar |