|
From: Tommy C. <tom...@gm...> - 2015-02-14 15:48:31
|
Thanks for you answer Eric. I had to get some sleep before trying out things. I currently have the code below, but it does not remove the zero value tick. It removes the tick at 5 and 10 however. import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator fig = plt.figure() ax1 = fig.add_subplot(111) ax1.xaxis.set_major_locator(MultipleLocator(5)) xticks = ax1.xaxis.get_major_ticks() #xticks[0].label1.set_visible(False) #xticks[-1].label1.set_visible(False) ax1.set_xticks(ax1.get_xticks()[1:-1]) ax1.plot(list(range(11))) plt.show() On Sat, Feb 14, 2015 at 2:01 AM, Eric Firing <ef...@ha...> wrote: > On 2015/02/13 3:29 PM, Tommy Carstensen wrote: >> Is it possible to combine MultipleLocator and MaxNLocator? One seems >> to erase the effect of the other. > > They are for different situations. MultipleLocator is for when you know > what you want your tick interval to be; MaxNLocator is for when you > don't know that, but you do know roughly how many ticks you want, and > what sort of numerical intervals are acceptable. > > Eric > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |