Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64baf87

Browse files
committed
fixed translation trans
svn path=/trunk/matplotlib/; revision=1916
1 parent 2acdd18 commit 64baf87

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

lib/matplotlib/artist.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def getp(o, *args):
397397
398398
o.get_somename()
399399
400-
get can be used to query all the gettable properties with get(o)
400+
getp can be used to query all the gettable properties with getp(o)
401401
Many properties have aliases for shorter typing, eg 'lw' is an
402402
alias for 'linewidth'. In the output, aliases and full property
403403
names will be listed as
@@ -426,27 +426,27 @@ def get(o, *args, **kwargs):
426426

427427
def setp(h, *args, **kwargs):
428428
"""
429-
matlab(TM) and pylab allow you to use set and get to set and get
430-
object properties, as well as to do introspection on the object
431-
For example, to set the linestyle of a line to be dashed, you can do
429+
matplotlib supports the use of setp ("set property") and getp to set and get object properties, as well as to do
430+
introspection on the object For example, to set the linestyle of a
431+
line to be dashed, you can do
432432
433433
>>> line, = plot([1,2,3])
434-
>>> set(line, linestyle='--')
434+
>>> setp(line, linestyle='--')
435435
436436
If you want to know the valid types of arguments, you can provide the
437437
name of the property you want to set without a value
438438
439-
>>> set(line, 'linestyle')
439+
>>> setp(line, 'linestyle')
440440
linestyle: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' ]
441441
442442
If you want to see all the properties that can be set, and their
443443
possible values, you can do
444444
445445
446-
>>> set(line)
446+
>>> setp(line)
447447
... long output listing omitted'
448448
449-
set operates on a single instance or a list of instances. If you are
449+
setp operates on a single instance or a list of instances. If you are
450450
in quey mode introspecting the possible values, only the first
451451
instance in the sequnce is used. When actually setting values, all
452452
the instances will be set. Eg, suppose you have a list of two lines,
@@ -456,13 +456,13 @@ def setp(h, *args, **kwargs):
456456
>>> y1 = sin(2*pi*x)
457457
>>> y2 = sin(4*pi*x)
458458
>>> lines = plot(x, y1, x, y2)
459-
>>> set(lines, linewidth=2, color='r')
459+
>>> setp(lines, linewidth=2, color='r')
460460
461-
Set works with the matlab(TM) style string/value pairs or with python
462-
kwargs. For example, the following are equivalent
461+
Set works with the matlab(TM) style string/value pairs or with
462+
python kwargs. For example, the following are equivalent
463463
464-
>>> set(lines, 'linewidth', 2, 'color', r') # matlab style
465-
>>> set(lines, linewidth=2, color='r') # python style
464+
>>> setp(lines, 'linewidth', 2, 'color', r') # matlab style
465+
>>> setp(lines, linewidth=2, color='r') # python style
466466
"""
467467

468468
insp = ArtistInspector(h)

lib/matplotlib/finance.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ def quotes_historical_yahoo(ticker, date1, date2, asobject=False, adjusted=True)
8585
if asobject is True, the return val is an object with attrs date,
8686
open, close, high, low, volume, which are equal length arrays
8787
88+
if adjust=True, use adjusted prices
8889
8990
Ex:
90-
sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True)
91+
sp = f.quotes_historical_yahoo('^GSPC', d1, d2, asobject=True, adjusted=True)
9192
returns = (sp.open[1:] - sp.open[:-1])/sp.open[1:]
9293
[n,bins,patches] = hist(returns, 100)
9394
mu = mean(returns)

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def translation_transform(tx, ty):
225225
return a pure tranlational transformation tx and ty are LazyValue
226226
instances (Values or binary opertations on values)
227227
"""
228-
return Affine(zero(), zero(), zero(), zero(), tx, ty)
228+
return Affine(one(), zero(), zero(), one(), tx, ty)
229229

230230
def scale_transform(sx, sy):
231231
"""

0 commit comments

Comments
 (0)