Skip to content

Instantly share code, notes, and snippets.

@turicas
Created January 24, 2012 01:52
Show Gist options
  • Select an option

  • Save turicas/1667300 to your computer and use it in GitHub Desktop.

Select an option

Save turicas/1667300 to your computer and use it in GitHub Desktop.
Bug on matplotlib bar plot when using 'log' in yscale
#!/usr/bin/env python
# coding: utf-8
from numpy import arange
from matplotlib.pyplot import figure
f = figure()
s = f.add_subplot(1, 1, 1)
x = arange(0, 20)
s.bar(x, x ** 2)
f.savefig('bar-linear-ok.png')
s.set_yscale('log')
f.savefig('bar-log-bug.png')
f2 = figure()
s2 = f2.add_subplot(1, 1, 1)
s2.set_yscale('log')
s2.bar(x, x ** 2)
f2.savefig('bar-log-ok.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment