To hide the right and top spikes of the subtitle, you need to set the color of the corresponding spikes to 'none' , and also set the tick position to 'left' for xtick and 'bottom' for ytick (to hide the checkmarks, as well as the spikes).
Unfortunately, none of them are currently available through matplotlibrc . The parameters specified in matplotlibrc are checked and then stored in a dict called rcParams . Then the individual modules check the key in this dict, the value of which will act by default. If they do not check it for one of their options, this option cannot be changed using the rc file.
Due to the nature of the rc system and the way spikes are written, changing the code for this would not be easy:
Spikes currently get their color through the same rc parameter, which is used to determine the colors of the axes; you cannot set it to 'none' without hiding the entire axis pattern. They are also agnostic about whether they are top , right , left or bottom β in fact, these are just four separate spikes stored in a dict. Individual spinal objects do not know which side of the plot they are composed on, so you cannot just add new rc parameters and assign the correct ones during the initialization of the spine.
self.set_edgecolor( rcParams['axes.edgecolor'] )
(./matplotlib/lib/matplotlib/spines.py, __init __ (), line 54)
If you have a large amount of existing code, so adding the axis parameters manually to each of them will be too burdensome, you can use the helper function one by one to iterate over all Axis objects and set values ββfor you.
Here is an example:
import matplotlib import matplotlib.pyplot as plt import numpy as np from matplotlib.pyplot import show
Just call hide_spines() before show() and it will hide them in all digits displayed by show() . I can not think of an easier way to change a large number of digits without wasting time fixing matplotlib and add rc support for the necessary parameters.
Andrew Aug 18 2018-10-18T00: 00Z
source share