Ryan's Blog

Matplotlib: plot border, removing and setting width

Posted in Uncategorized by ryanlayer on December 17, 2013
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['bottom'].set_linewidth(0.5)
ax.spines['left'].set_linewidth(0.5)
Advertisements
Tagged with: ,

4 Responses

Subscribe to comments with RSS.

  1. datasciencelab said, on December 23, 2013 at 6:40 am

    I really like the level of customization that one can get with matplotlib… provided one knows where to look. Discovering this ‘spines’ object in the axes has proven very useful!

    • ryanlayer said, on December 31, 2013 at 8:26 am

      Agreed. I try to not think about the number of times I have rediscovered how to do something in matplotlib.

  2. perfidia said, on May 20, 2014 at 11:05 am

    This made me so happy. I can’t stand those ugly thick box borders!!

    • ryanlayer said, on May 20, 2014 at 11:11 am

      Agreed! I also have a post on changing the font to Arial. The combo of better borders and better fonts makes the plots nearly publication-quality.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: