SourceForge logo
SourceForge logo
Menu

matplotlib-checkins — Commit notification. DO NOT POST to this list, just subscribe to it.

You can subscribe to this list here.

2007 Jan
Feb
Mar
Apr
May
Jun
Jul
(115)
Aug
(120)
Sep
(137)
Oct
(170)
Nov
(461)
Dec
(263)
2008 Jan
(120)
Feb
(74)
Mar
(35)
Apr
(74)
May
(245)
Jun
(356)
Jul
(240)
Aug
(115)
Sep
(78)
Oct
(225)
Nov
(98)
Dec
(271)
2009 Jan
(132)
Feb
(84)
Mar
(74)
Apr
(56)
May
(90)
Jun
(79)
Jul
(83)
Aug
(296)
Sep
(214)
Oct
(76)
Nov
(82)
Dec
(66)
2010 Jan
(46)
Feb
(58)
Mar
(51)
Apr
(77)
May
(58)
Jun
(126)
Jul
(128)
Aug
(64)
Sep
(50)
Oct
(44)
Nov
(48)
Dec
(54)
2011 Jan
(68)
Feb
(52)
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
(1)
2018 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S


1
(10)
2
(6)
3
4
(10)
5
(5)
6
(5)
7
(6)
8
(2)
9
(5)
10
(7)
11
(5)
12
(8)
13
(5)
14
(7)
15
(3)
16
(1)
17
(1)
18
19
(1)
20
(6)
21
(6)
22
(3)
23
(3)
24
(7)
25
26
(5)
27
(1)
28
(3)
29
(2)
30
(3)



Showing 6 results of 6

From: <lee...@us...> - 2010年06月20日 23:31:55
Revision: 8447
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8447&view=rev
Author: leejjoon
Date: 2010年06月20日 23:31:49 +0000 (2010年6月20日)
Log Message:
-----------
revert r8445,8446 and fix plot_directive.py to support sphinx 1.0
Modified Paths:
--------------
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 20:55:42 UTC (rev 8446)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 23:31:49 UTC (rev 8447)
@@ -178,6 +178,9 @@
 of each of the labels and uses it to move the left of the subplots
 over so that the tick labels fit in the figure
 
+.. plot:: pyplots/auto_subplots_adjust.py
+ :include-source:
+
 .. _howto-ticks:
 
 Configure the tick linewidths
@@ -218,6 +221,9 @@
 below shows the default behavior in the left subplots, and the manual
 setting in the right subplots.
 
+.. plot:: pyplots/align_ylabels.py
+ :include-source:
+
 .. _date-index-plots:
 
 Skip dates where there is no data
Modified: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py	2010年06月20日 20:55:42 UTC (rev 8446)
+++ trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py	2010年06月20日 23:31:49 UTC (rev 8447)
@@ -366,8 +366,13 @@
 
 if options.has_key('include-source'):
 if plot_code is None:
+ if sphinx_version > (1,):
+ include_prefix = '/'
+ else:
+ include_prefix = setup.app.builder.srcdir
+
 lines.extend(
- ['.. include:: %s' % os.path.join(setup.app.builder.srcdir, plot_path),
+ ['.. include:: %s' % os.path.join(include_prefix, plot_path),
 ' :literal:'])
 if options.has_key('encoding'):
 lines.append(' :encoding: %s' % options['encoding'])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <lee...@us...> - 2010年06月20日 20:55:49
Revision: 8446
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8446&view=rev
Author: leejjoon
Date: 2010年06月20日 20:55:42 +0000 (2010年6月20日)
Log Message:
-----------
remove align_ylabels.py entry from howto_faq.rst to test doc-build
Modified Paths:
--------------
 trunk/matplotlib/doc/faq/howto_faq.rst
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 20:05:57 UTC (rev 8445)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 20:55:42 UTC (rev 8446)
@@ -218,9 +218,6 @@
 below shows the default behavior in the left subplots, and the manual
 setting in the right subplots.
 
-.. plot:: pyplots/align_ylabels.py
- :include-source:
-
 .. _date-index-plots:
 
 Skip dates where there is no data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <lee...@us...> - 2010年06月20日 20:06:03
Revision: 8445
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8445&view=rev
Author: leejjoon
Date: 2010年06月20日 20:05:57 +0000 (2010年6月20日)
Log Message:
-----------
remove auto_subplots_adjust.py entry from howto_faq.rst to test doc-build
Modified Paths:
--------------
 trunk/matplotlib/doc/faq/howto_faq.rst
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 20:05:49 UTC (rev 8444)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2010年06月20日 20:05:57 UTC (rev 8445)
@@ -178,9 +178,6 @@
 of each of the labels and uses it to move the left of the subplots
 over so that the tick labels fit in the figure
 
-.. plot:: pyplots/auto_subplots_adjust.py
- :include-source:
-
 .. _howto-ticks:
 
 Configure the tick linewidths
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8444
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8444&view=rev
Author: leejjoon
Date: 2010年06月20日 20:05:49 +0000 (2010年6月20日)
Log Message:
-----------
mpl_toolkits.axisartist.grid_finder.MaxNLocator supports factor
Modified Paths:
--------------
 trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py
Modified: trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py	2010年06月20日 16:46:34 UTC (rev 8443)
+++ trunk/matplotlib/lib/mpl_toolkits/axisartist/grid_finder.py	2010年06月20日 20:05:49 UTC (rev 8444)
@@ -260,14 +260,22 @@
 trim=trim, integer=integer,
 symmetric=symmetric, prune=prune)
 self.create_dummy_axis()
+ self._factor = None
 
-
 def __call__(self, v1, v2):
- self.set_bounds(v1, v2)
- locs = mticker.MaxNLocator.__call__(self)
- return np.array(locs), len(locs), None
+ if self._factor is not None:
+ self.set_bounds(v1*self._factor, v2*self._factor)
+ locs = mticker.MaxNLocator.__call__(self)
+ return np.array(locs), len(locs), self._factor
+ else:
+ self.set_bounds(v1, v2)
+ locs = mticker.MaxNLocator.__call__(self)
+ return np.array(locs), len(locs), None
 
+ def set_factor(self, f):
+ self._factor = f
 
+
 class FixedLocator(object):
 def __init__(self, locs):
 self._locs = locs
@@ -287,11 +295,14 @@
 def __init__(self):
 self._fmt = mticker.ScalarFormatter()
 self._fmt.create_dummy_axis()
+ self._ignore_factor = True
 
 def __call__(self, direction, factor, values):
- if factor is None:
- factor = 1.
- values = [v/factor for v in values]
+ if not self._ignore_factor:
+ if factor is None:
+ factor = 1.
+ values = [v/factor for v in values]
+ #values = [v for v in values]
 self._fmt.set_locs(values)
 return [self._fmt(v) for v in values]
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ef...@us...> - 2010年06月20日 16:46:40
Revision: 8443
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8443&view=rev
Author: efiring
Date: 2010年06月20日 16:46:34 +0000 (2010年6月20日)
Log Message:
-----------
finance: restore original adjustment algorithm, but use ndarray.
A numpy recarray replaces the Bunch when asobject is True.
Additional fields are provided.
Modified Paths:
--------------
 trunk/matplotlib/examples/pylab_examples/date_demo1.py
 trunk/matplotlib/examples/pylab_examples/date_demo2.py
 trunk/matplotlib/examples/pylab_examples/finance_demo.py
 trunk/matplotlib/lib/matplotlib/finance.py
Modified: trunk/matplotlib/examples/pylab_examples/date_demo1.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/date_demo1.py	2010年06月20日 01:34:30 UTC (rev 8442)
+++ trunk/matplotlib/examples/pylab_examples/date_demo1.py	2010年06月20日 16:46:34 UTC (rev 8443)
@@ -27,7 +27,7 @@
 
 quotes = quotes_historical_yahoo(
 'INTC', date1, date2)
-if not quotes:
+if len(quotes) == 0:
 raise SystemExit
 
 dates = [q[0] for q in quotes]
Modified: trunk/matplotlib/examples/pylab_examples/date_demo2.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/date_demo2.py	2010年06月20日 01:34:30 UTC (rev 8442)
+++ trunk/matplotlib/examples/pylab_examples/date_demo2.py	2010年06月20日 16:46:34 UTC (rev 8443)
@@ -23,7 +23,7 @@
 
 
 quotes = quotes_historical_yahoo('INTC', date1, date2)
-if not quotes:
+if len(quotes) == 0:
 print 'Found no quotes'
 raise SystemExit
 
Modified: trunk/matplotlib/examples/pylab_examples/finance_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/finance_demo.py	2010年06月20日 01:34:30 UTC (rev 8442)
+++ trunk/matplotlib/examples/pylab_examples/finance_demo.py	2010年06月20日 16:46:34 UTC (rev 8443)
@@ -5,20 +5,18 @@
 from matplotlib.finance import quotes_historical_yahoo, candlestick,\
 plot_day_summary, candlestick2
 
-import datetime
+# (Year, month, day) tuples suffice as args for quotes_historical_yahoo
+date1 = ( 2004, 2, 1)
+date2 = ( 2004, 4, 12 )
 
-date1 = datetime.date( 2004, 2, 1)
-date2 = datetime.date( 2004, 4, 12 )
 
-
 mondays = WeekdayLocator(MONDAY) # major ticks on the mondays
 alldays = DayLocator() # minor ticks on the days
 weekFormatter = DateFormatter('%b %d') # Eg, Jan 12
 dayFormatter = DateFormatter('%d') # Eg, 12
 
-quotes = quotes_historical_yahoo(
- 'INTC', date1, date2)
-if not quotes:
+quotes = quotes_historical_yahoo('INTC', date1, date2)
+if len(quotes) == 0:
 raise SystemExit
 
 fig = figure()
Modified: trunk/matplotlib/lib/matplotlib/finance.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/finance.py	2010年06月20日 01:34:30 UTC (rev 8442)
+++ trunk/matplotlib/lib/matplotlib/finance.py	2010年06月20日 16:46:34 UTC (rev 8443)
@@ -11,90 +11,130 @@
 from hashlib import md5
 except ImportError:
 from md5 import md5 #Deprecated in 2.5
+import datetime
 
-try: import datetime
-except ImportError:
- raise ImportError('The finance module requires datetime support (python2.3)')
-
 import numpy as np
 
 from matplotlib import verbose, get_configdir
-from dates import date2num
-from matplotlib.cbook import Bunch
+from matplotlib.dates import date2num
+from matplotlib.cbook import iterable, is_string_like
 from matplotlib.collections import LineCollection, PolyCollection
 from matplotlib.colors import colorConverter
-from lines import Line2D, TICKLEFT, TICKRIGHT
-from patches import Rectangle
+from matplotlib.lines import Line2D, TICKLEFT, TICKRIGHT
+from matplotlib.patches import Rectangle
 from matplotlib.transforms import Affine2D
 
 
-
 configdir = get_configdir()
 cachedir = os.path.join(configdir, 'finance.cache')
 
 
-def parse_yahoo_historical(fh, asobject=False, adjusted=True):
+stock_dt = np.dtype([('date', object),
+ ('year', np.int16),
+ ('month', np.int8),
+ ('day', np.int8),
+ ('d', np.float), # mpl datenum
+ ('open', np.float),
+ ('close', np.float),
+ ('high', np.float),
+ ('low', np.float),
+ ('volume', np.int),
+ ('aclose', np.float)])
+
+
+def parse_yahoo_historical(fh, adjusted=True, asobject=False):
 """
- Parse the historical data in file handle fh from yahoo finance and return
- results as a list of
+ Parse the historical data in file handle fh from yahoo finance.
 
- d, open, close, high, low, volume
+ *adjusted*
+ If True (default) replace open, close, high, low, and volume with
+ their adjusted values.
+ The adjustment is by a scale factor, S = adjusted_close/close.
+ Adjusted volume is actual volume divided by S;
+ Adjusted prices are actual prices multiplied by S. Hence,
+ the product of price and volume is unchanged by the adjustment.
 
- where d is a floating poing representation of date, as returned by date2num
+ *asobject*
+ If False (default for compatibility with earlier versions)
+ return a list of tuples containing
 
- if adjusted=True, use adjusted prices. Note that volume is not
- adjusted and we are not able to handle volume adjustments properly
- because the Yahoo CSV does not distinguish between split and
- dividend adjustments.
+ d, open, close, high, low, volume
+
+ If None (preferred alternative to False), return
+ a 2-D ndarray corresponding to the list of tuples.
+
+ Otherwise return a numpy recarray with
+
+ date, year, month, day, d, open, close, high, low,
+ volume, adjusted_close
+
+ where d is a floating poing representation of date,
+ as returned by date2num, and date is a python standard
+ library datetime.date instance.
+
+ The name of this kwarg is a historical artifact. Formerly,
+ True returned a cbook Bunch
+ holding 1-D ndarrays. The behavior of a numpy recarray is
+ very similar to the Bunch.
+
 """
- results = []
 
 lines = fh.readlines()
 
- datefmt = None
+ results = []
 
+ datefmt = '%Y-%m-%d'
+
 for line in lines[1:]:
 
 vals = line.split(',')
-
- if len(vals)!=7: continue
+ if len(vals)!=7:
+ continue # add warning?
 datestr = vals[0]
- if datefmt is None:
- try:
- datefmt = '%Y-%m-%d'
- dt = datetime.date(*time.strptime(datestr, datefmt)[:3])
- except ValueError:
- datefmt = '%d-%b-%y' # Old Yahoo--cached file?
- dt = datetime.date(*time.strptime(datestr, datefmt)[:3])
- d = date2num(dt)
+ #dt = datetime.date(*time.strptime(datestr, datefmt)[:3])
+ # Using strptime doubles the runtime. With the present
+ # format, we don't need it.
+ dt = datetime.date(*[int(val) for val in datestr.split('-')])
+ dnum = date2num(dt)
 open, high, low, close = [float(val) for val in vals[1:5]]
 volume = int(vals[5])
- if adjusted:
- aclose = float(vals[6])
- delta = aclose-close
- open += delta
- high += delta
- low += delta
- close = aclose
+ aclose = float(vals[6])
 
- results.append((d, open, close, high, low, volume))
+ results.append((dt, dt.year, dt.month, dt.day,
+ dnum, open, close, high, low, volume, aclose))
 results.reverse()
- if asobject:
- if len(results)==0: return None
- else:
- date, open, close, high, low, volume = map(np.asarray, zip(*results))
- return Bunch(date=date, open=open, close=close, high=high, low=low, volume=volume)
- else:
+ d = np.array(results, dtype=stock_dt)
+ if adjusted:
+ scale = d['aclose'] / d['close']
+ scale[np.isinf(scale)] = np.nan
+ d['open'] *= scale
+ d['close'] *= scale
+ d['high'] *= scale
+ d['low'] *= scale
 
- return results
+ if not asobject:
+ # 2-D sequence; formerly list of tuples, now ndarray
+ ret = np.zeros((len(d), 6), dtype=np.float)
+ ret[:,0] = d['d']
+ ret[:,1] = d['open']
+ ret[:,2] = d['close']
+ ret[:,3] = d['high']
+ ret[:,4] = d['low']
+ ret[:,5] = d['volume']
+ if asobject is None:
+ return ret
+ return [tuple(row) for row in ret]
 
+ return d.view(np.recarray) # Close enough to former Bunch return
+
+
 def fetch_historical_yahoo(ticker, date1, date2, cachename=None):
 """
 Fetch historical data for ticker between date1 and date2. date1 and
- date2 are datetime instances
+ date2 are date or datetime instances, or (year, month, day) sequences.
 
 Ex:
- fh = fetch_historical_yahoo('^GSPC', d1, d2)
+ fh = fetch_historical_yahoo('^GSPC', (2000, 1, 1), (2001, 12, 31))
 
 cachename is the name of the local file cache. If None, will
 default to the md5 hash or the url (which incorporates the ticker
@@ -106,8 +146,14 @@
 ticker = ticker.upper()
 
 
- d1 = (date1.month-1, date1.day, date1.year)
- d2 = (date2.month-1, date2.day, date2.year)
+ if iterable(date1):
+ d1 = (date1[1]-1, date1[2], date1[0])
+ else:
+ d1 = (date1.month-1, date1.day, date1.year)
+ if iterable(date2):
+ d2 = (date2[1]-1, date2[2], date2[0])
+ else:
+ d2 = (date2.month-1, date2.day, date2.year)
 
 
 urlFmt = 'http://table.finance.yahoo.com/table.csv?a=%d&b=%d&c=%d&d=%d&e=%d&f=%d&s=%s&y=0&g=d&ignore=.csv'
@@ -123,7 +169,8 @@
 fh = file(cachename)
 verbose.report('Using cachefile %s for %s'%(cachename, ticker))
 else:
- if not os.path.isdir(cachedir): os.mkdir(cachedir)
+ if not os.path.isdir(cachedir):
+ os.mkdir(cachedir)
 urlfh = urlopen(url)
 
 fh = file(cachename, 'w')
@@ -135,27 +182,18 @@
 return fh
 
 
-def quotes_historical_yahoo(ticker, date1, date2, asobject=False, adjusted=True, cachename=None):
+def quotes_historical_yahoo(ticker, date1, date2, asobject=False,
+ adjusted=True, cachename=None):
 """
 Get historical data for ticker between date1 and date2. date1 and
- date2 are datetime instances
+ date2 are datetime instances or (year, month, day) sequences.
 
- results are a list of tuples
+ See :func:`parse_yahoo_historical` for explanation of output formats
+ and the *asobject* and *adjusted* kwargs.
 
- (d, open, close, high, low, volume)
-
- where d is a floating poing representation of date, as returned by date2num
-
- if asobject is True, the return val is an object with attrs date,
- open, close, high, low, volume, which are equal length arrays
-
- if adjusted=True, use adjusted prices. Note that volume is not
- adjusted and we are not able to handle volume adjustments properly
- because the Yahoo CSV does not distinguish between split and
- dividend adjustments.
-
 Ex:
- sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True, adjusted=True)
+ sp = f.quotes_historical_yahoo('^GSPC', d1, d2,
+ asobject=True, adjusted=True)
 returns = (sp.open[1:] - sp.open[:-1])/sp.open[1:]
 [n,bins,patches] = hist(returns, 100)
 mu = mean(returns)
@@ -167,10 +205,18 @@
 default to the md5 hash or the url (which incorporates the ticker
 and date range)
 """
+ # Maybe enable a warning later as part of a slow transition
+ # to using None instead of False.
+ #if asobject is False:
+ # warnings.warn("Recommend changing to asobject=None")
 
 fh = fetch_historical_yahoo(ticker, date1, date2, cachename)
 
- try: ret = parse_yahoo_historical(fh, asobject, adjusted)
+ try:
+ ret = parse_yahoo_historical(fh, asobject=asobject,
+ adjusted=adjusted)
+ if len(ret) == 0:
+ return None
 except IOError, exc:
 warnings.warn('urlopen() failure\n' + url + '\n' + exc.strerror[1])
 return None
@@ -181,7 +227,7 @@
 colorup='k', colordown='r',
 ):
 """
- quotes is a list of (time, open, close, high, low, ...) tuples
+ quotes is a sequence of (time, open, close, high, low, ...) sequences
 
 Represent the time, open, close, high, low as a vertical line
 ranging from low to high. The left tick is the open and the right
@@ -196,9 +242,6 @@
 return value is a list of lines added
 """
 
-
-
-
 lines = []
 for q in quotes:
 
@@ -244,9 +287,9 @@
 
 """
 
- quotes is a list of (time, open, close, high, low, ...) tuples.
- As long as the first 5 elements of the tuples are these values,
- the tuple can be as long as you want (eg it may store volume).
+ quotes is a sequence of (time, open, close, high, low, ...) sequences.
+ As long as the first 5 elements are these values,
+ the record can be as long as you want (eg it may store volume).
 
 time must be in float days format - see date2num
 
@@ -263,12 +306,11 @@
 
 return value is lines, patches where lines is a list of lines
 added and patches is a list of the rectangle patches added
+
 """
 
-
 OFFSET = width/2.0
 
-
 lines = []
 patches = []
 for q in quotes:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8442
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8442&view=rev
Author: efiring
Date: 2010年06月20日 01:34:30 +0000 (2010年6月20日)
Log Message:
-----------
[2564093] backend_wx: don't initialize printer by default; deprecate Printer*
Modified Paths:
--------------
 trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py	2010年06月19日 23:46:47 UTC (rev 8441)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py	2010年06月20日 01:34:30 UTC (rev 8442)
@@ -754,7 +754,11 @@
 
 self.macros = {} # dict from wx id to seq of macros
 
- self.Printer_Init()
+ # printer attributes and methods deprecated, 2010年06月19日
+ self._printerData = None
+ self._printerPageData = None
+ self.printer_width = 5.5
+ self.printer_margin = 0.5
 
 def Destroy(self, *args, **kwargs):
 wx.Panel.Destroy(self, *args, **kwargs)
@@ -769,7 +773,12 @@
 wx.TheClipboard.Close()
 
 def Printer_Init(self):
- """initialize printer settings using wx methods"""
+ """
+ initialize printer settings using wx methods
+
+ Deprecated.
+ """
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
 self.printerData = wx.PrintData()
 self.printerData.SetPaperId(wx.PAPER_LETTER)
 self.printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
@@ -781,14 +790,37 @@
 self.printer_width = 5.5
 self.printer_margin= 0.5
 
+ def _get_printerData(self):
+ if self._printerData is None:
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
+ self._printerData = wx.PrintData()
+ self._printerData.SetPaperId(wx.PAPER_LETTER)
+ self._printerData.SetPrintMode(wx.PRINT_MODE_PRINTER)
+ return self._printerData
+ printerData = property(_get_printerData)
+
+ def _get_printerPageData(self):
+ if self._printerPageData is None:
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
+ self._printerPageData= wx.PageSetupDialogData()
+ self._printerPageData.SetMarginBottomRight((25,25))
+ self._printerPageData.SetMarginTopLeft((25,25))
+ self._printerPageData.SetPrintData(self.printerData)
+ return self._printerPageData
+ printerPageData = property(_get_printerPageData)
+
 def Printer_Setup(self, event=None):
- """set up figure for printing. The standard wx Printer
+ """
+ set up figure for printing. The standard wx Printer
 Setup Dialog seems to die easily. Therefore, this setup
- simply asks for image width and margin for printing. """
+ simply asks for image width and margin for printing.
+ Deprecated.
+ """
 
 dmsg = """Width of output figure in inches.
 The current aspect ratio will be kept."""
 
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
 dlg = wx.Dialog(self, -1, 'Page Setup for Printing' , (-1,-1))
 df = dlg.GetFont()
 df.SetWeight(wx.NORMAL)
@@ -844,9 +876,14 @@
 return
 
 def Printer_Setup2(self, event=None):
- """set up figure for printing. Using the standard wx Printer
- Setup Dialog. """
+ """
+ set up figure for printing. Using the standard wx Printer
+ Setup Dialog.
 
+ Deprecated.
+ """
+
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
 if hasattr(self, 'printerData'):
 data = wx.PageSetupDialogData()
 data.SetPrintData(self.printerData)
@@ -865,7 +902,12 @@
 dlg.Destroy()
 
 def Printer_Preview(self, event=None):
- """ generate Print Preview with wx Print mechanism"""
+ """
+ generate Print Preview with wx Print mechanism
+
+ Deprecated.
+ """
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
 po1 = PrintoutWx(self, width=self.printer_width,
 margin=self.printer_margin)
 po2 = PrintoutWx(self, width=self.printer_width,
@@ -886,7 +928,12 @@
 self.gui_repaint()
 
 def Printer_Print(self, event=None):
- """ Print figure using wx Print mechanism"""
+ """
+ Print figure using wx Print mechanism
+
+ Deprecated.
+ """
+ warnings.warn("Printer* methods will be removed", DeprecationWarning)
 pdd = wx.PrintDialogData()
 # SetPrintData for 2.4 combatibility
 pdd.SetPrintData(self.printerData)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

Showing 6 results of 6

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /