0
我有一个对数轮廓图,我需要显示次要刻度。所以我用删除对数图中的特定x轴刻度标签,matplotlib
ax.xaxis.set_minor_formatter(fmt("%.1f"))
ax.yaxis.set_minor_formatter(fmt("%.1f"))
其中fmt
是from matplotlib.ticker import FormatStrFormatter as fmt
这工作得很好,给我所有的次要刻度线。但是,正如您从附加图片中可以看到的那样,x轴的刻度尤其是7.0,8.0 and 9.0
是与重叠的刻度,并且我想明确地只删除它们,但具有其他小刻度。
这可能吗?我无法找到删除特定小勾号的代码。
@:检查这个答案http://stackoverflow.com/questions/13576805/matplotlib-hiding-specific-ticks-on-x-axis – George 2015-03-31 13:24:49
@George我实际上找到了一个更简单的解决方案[这里](HTTP:///stackoverflow.com/questions/6567724/matplotlib-so-log-axis-only-has-minor-tick-mark-labels-at-specified-points-also)后,我发布了问题。 – ThePredator 2015-03-31 13:27:01