python - Borderless matplotlib plots -
is there way save matplotlib graphs without border around frame while keeping background not transparent?
setting frame 'off' show in code below not work removes background making transparent whereas want retain white background, without borders.
a = fig.gca() a.set_frame_on(false)
here screenshot of i'm trying do. if border can removed can draw x-axis line separately.
all suggestions appreciated.
a similar question asked here: how can remove top , right axis in matplotlib?. google search "hide axes matplotlib" gives 5th link.
remove spines:
x = linspace(0, 2 * pi, 1000) y = sin(x) fig, ax = subplots() ax.plot(x, y) ax.spines['top'].set_visible(false) ax.spines['right'].set_visible(false) ax.spines['left'].set_visible(false) ax.grid(axis='y')
Comments
Post a Comment