Black Lives Matter. Please consider donating to Black Girls Code today.

How can I hide the axes labels without taking up space?

Is there any way I can make it so that when a plot doesn’t have axes labels, the plot extends all the way edges?

I would expect that when I remove the axes labels, the plot would take up that extra space where the label used to be. Right now, the way I have it set up, it seems to leave an empty gap for the axes label, even if I don’t use an axes label.

In case anyone was wondering, the way I solved this was to make the margins smaller when labels weren’t used.