The following python3 code does not work due to double linebreak on line 9:
# -*- coding: utf-8 -*- from matplotlib import pyplot as plt import numpy as np plt.xkcd() fig = plt.figure() ax = fig.add_subplot(1, 1, 1) ax.spines['right'].set_color('none') ax.spines['top'].set_color('none') plt.text(4, 400, '-> 1 Pig ~ 150 kg\n\n-> Butching => 80 to 100 kg meat') plt.axis([0, 7, 0, 2000]) plt.plot([0,1,2,3,4,5], [0,400,800,1200,1600, 2000]) ax.set_ylim([0, 2000]) ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') plt.show()
But if I delete the line plt.xkcd() , then everything will work well even with double-line decoupling. Anyone now why? Is this a bug or is there a workaround?
My setup: Windows 7 amd64, python 3.3, numpy 1.8, matplotlib 1.3.1
source share