Quantcast

Problem with finance_demo.py

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with finance_demo.py

Vinj Vinj
The following code (is a simple modification of
finance_demo.py) produces a stock chart. SOme of the
lines are thicker than the others. All the lines
should have the same width.

VJ



import datetime
from pylab import *
from matplotlib.finance import
quotes_historical_yahoo, plot_day_summary2

import time


axesBG = '#f6f6f6'
figBG = 'w'
date1 = datetime.date( 2002, 2, 1)
date2 = datetime.date( 2004, 12, 12 )

quotes = quotes_historical_yahoo(
    'INTC', date1, date2)

quotetime, open, close, high, low, volume =
zip(*quotes)
numPriceBars = 261


ax = subplot(111)
plot_day_summary2(ax,
open[0:260],close[0:260],high[0:260],low[0:260])
set(ax.get_xticklabels(), 'rotation', 45,
'horizontalalignment', 'right', fontsize=7)

show()


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with finance_demo.py

John Hunter-8
>>>>> "Vinj" == Vinj Vinj <[hidden email]> writes:

    Vinj> The following code (is a simple modification of
    Vinj> finance_demo.py) produces a stock chart. SOme of the lines
    Vinj> are thicker than the others. All the lines should have the
    Vinj> same width.

This is a little bug that crops up frequently because of how agg
handles subpixel rendering.  I added a little hack to the line
collection code to "snap to pixel center" for len(2) lines.  Should
fix your problem.

Use CVS revision

Checking in src/_backend_agg.cpp;
/cvsroot/matplotlib/matplotlib/src/_backend_agg.cpp,v  <--  _backend_agg.cpp
new revision: 1.89; previous revision: 1.88

or later.

JDH


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Loading...