Eric,
Thanks a lot for the pointers. Sorry for the double posting.
I tried fill_between, which works better than bar graph.
But I need to change the data set to be able to get the filling
into a nicely-formed rectangle, and the performance is still not very good.As the below example shows:
import matplotlib.mlab as mlab
from matplotlib.pyplot import figure, show
import numpy as npx1 = np.arange(0.0, 10000.0, 0.1)
y1 = np.sin(2*np.pi*x1)fig = figure()
ax1 = fig.add_subplot(111)x =
for i in x1:
x += [i-0.05, i-0.05, i, i+0.05, i+0.05]y =
for i in y1:
y += [0, i, i, i, 0]ax1.fill_between(x, 0, y)
I have also tried step, but it doesn't seem to be able
to fill the rectangular area. Am I missing something?
Given that you want filled regions, step won't help. It might make sense to make the step logic available to fill_between, but this has not been done yet.
I don't understand what you really want, though; your code above is trying to plot 100,000 bars. Your screen probably has fewer than 2000 pixels width. You can print with higher resolution than that, but if you are making plots for printing, usually the performance is not such an issue--and even then, I don't think that packing 100,000 bars onto a sheet of paper is going to be very useful.
Eric
ยทยทยท
On 05/03/2010 11:45 PM, Kun Hong wrote:
Kun