Hide upper/right tick markers using rcparams/mplstyle
<p>I am currently using a variant of <a href="http://stackoverflow.com/a/11417222/2552873">this answer</a> to eliminate the top/right edges on my plots. However, I would like to be able to add this to my .mplstyle file instead of calling this function for every plot I create. Is there a way to achieve this functionality using the style parameters, or even by calling something once at the beginning of my code?</p>

<p>You can use:</p>

<pre><code>axes.spines.top : False
axes.spines.right : False
</code></pre>

<p>in a mpstyle file to turn off spines. Unfortunately, <a href="http://stackoverflow.com/a/38750147/812786">this recent answer</a> indicates that ticks cannot currently be controlled from an rc or style file like this, and I haven't yet found a way either. However, in matplotlib 2.0 you should be able to write:</p>

<pre><code>xtick.top : False
ytick.right : False
</code></pre>

<p>(In fact, this appears to be the default style for 2.0, according to <a href="https://github.com/matplotlib/matplotlib/blob/v2.x/matplotlibrc.template#L362" rel="nofollow">the template file</a>.)</p>

python matplotlib