> I have some code that produces a series of graphs of data over time. For the most part it works well, but for certain combinations of dates the two plots do not line up, due to the width of the bars in the first subplot. What is the best way for force my second subplot's x axis to be identical to that of the first subplot?
Thanks! Here is minimal code reproducing the problem: import matplotlib from datetime import * import time from pylab import * def toOrd(strDate): return datetime(*time.strptime(strDate,"%m/%d/%y")[0:5]).toordinal() def main(): startDate = toOrd("05/24/05") endDate = toOrd("11/21/06") dates = range(startDate,endDate,7) figure(1) axis = subplot(211,axisbelow=True) plot_date(dates,dates,visible = False) axis.bar(dates,dates, width=3.0) axis = subplot(212,axisbelow=True) plot_date(dates,dates) #,'-',color = priceColor) show() if __name__ == '__main__': main() ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users