Skip to content

bugged pads on savefig #18804

Closed
Closed
@IvanAvdeevGth

Description

@IvanAvdeevGth

Found that pads do not work correctly. Previously (in approximately 2016) the code below would save a black square, but nowadays it saves a square with tiny white strips (around the square). Not a big deal, but it seems that it is not supposed to work in that way.

#!/usr/bin/env python3
import matplotlib.pyplot as plt
fig = plt.figure(0, figsize=(4,4))
ax = fig.add_axes((0,0,1,1))
ax.set_xticklabels([])
ax.set_yticklabels([])
ax.set_xticks([])
ax.set_yticks([])
ax.set_facecolor((0,0,0))
fig.savefig('foo.pdf', bbox_inches='tight', pad_inches=0)

Python version 3.6.9
matplotlib version 3.3.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions