8000 rgbface · matplotlib/matplotlib@ade0b60 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit ade0b60

Browse files
committed
rgbface
svn path=/trunk/matplotlib/; revision=146
1 parent 3b42448 commit ade0b60

File tree

9 files changed

+177
-86
lines changed

9 files changed

+177
-86
lines changed

API_CHANGES

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ API changes at 0.50
1616

1717
* GDFONTPATH renamed to TTFPATH
1818

19-
* backend faceColor argument changed to gcFace
19+
* backend faceColor argument changed to rgbFace
20+
21+
* colormap stuff moved to colors.py
22+
23+
* arg_to_rgb in backend_bases moved to class ColorConverter in
24+
colors.py
2025

2126
* GD users must upgrade to gd-2.0.22 and gdmodule-0.52 since new gd
2227
features (clipping, antialiased lines) are now used.

MANIFEST

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ INTERACTIVE
66
KNOWN_BUGS
77
LICENSE
88
LICENSE_PAINT
9-
MANIFEST
109
MANIFEST.in
1110
Makefile
1211
README
@@ -244,32 +243,6 @@ agg2/svg/a 8000 gg_svg_path_tokenizer.h
244243
agg2/svg/svg_test.cpp
245244
examples/README
246245
examples/__init__.py
247-
examples/_tmp.py
248-
examples/_tmp_alignment_test.py
249-
examples/_tmp_arctest.py
250-
examples/_tmp_axes_demo.py
251-
examples/_tmp_bar_stacked.py
252-
examples/_tmp_barchart_demo.py
253-
examples/_tmp_color_demo.py
254-
examples/_tmp_csd_demo.py
255-
examples/_tmp_figtext.py
256-
examples/_tmp_histogram_demo.py
257-
examples/_tmp_legend_demo.py
258-
examples/_tmp_legend_demo2.py
259-
examples/_tmp_line_styles.py
260-
examples/_tmp_log_demo.py
261-
examples/_tmp_log_test.py
262-
examples/_tmp_mri_with_eeg.py
263-
examples/_tmp_multiple_figs_demo.py
264-
examples/_tmp_pcolor_demo.py
265-
examples/_tmp_psd_demo.py
266-
examples/_tmp_scatter_demo.py
267-
examples/_tmp_scatter_demo2.py
268-
examples/_tmp_simple_plot.py
269-
examples/_tmp_stock_demo.py
270-
examples/_tmp_table_demo.py
271-
examples/_tmp_text_handles.py
272-
examples/_tmp_text_themes.py
273246
examples/alignment_test.py
274247
examples/anim.py
275248
examples/arctest.py
@@ -278,7 +251,6 @@ examples/axes_props.py
278251
examples/backend_driver.py
279252
examples/bar_stacked.py
280253
examples/barchart_demo.py
281-
examples/batch_figs.py
282254
examples/break.py
283255
examples/color_demo.py
284256
examples/colours.py
@@ -349,7 +321,7 @@ matplotlib/axes.py
349321
matplotlib/axis.py
350322
matplotlib/backend_bases.py
351323
matplotlib/cbook.py
352-
matplotlib/colormap.py
324+
matplotlib/colors.py
353325
matplotlib/figure.py
354326
matplotlib/legend.py
355327
matplotlib/lines.py
@@ -363,6 +335,7 @@ matplotlib/backends/__init__.py
363335
matplotlib/backends/backend_agg.py
364336
matplotlib/backends/backend_gd.py
365337
matplotlib/backends/backend_gtk.py
338+
matplotlib/backends/backend_gtkagg.py
366339
matplotlib/backends/backend_gtkgd.py
367340
matplotlib/backends/backend_paint.py
368341
matplotlib/backends/backend_ps.py
@@ -371,6 +344,8 @@ matplotlib/backends/backend_wx.py
371344
matplotlib/backends/ttf_font_manager.py
372345
src/_backend_agg.cpp
373346
src/_backend_agg.h
347+
src/_gtkagg.cpp
348+
src/_gtkgd.c
374349
src/font.cpp
375350
test/README
376351
test/agg_font_test.py
@@ -414,13 +389,17 @@ test/vline_demo.py
414389
ttfquery/__init__.py
415390
ttfquery/__init__.pyc
416391
ttfquery/_scriptregistry.py
392+
ttfquery/_scriptregistry.pyc
417393
ttfquery/describe.py
394+
ttfquery/describe.pyc
418395
ttfquery/family_query.py
419396
ttfquery/findsystem.py
397+
ttfquery/findsystem.pyc
420398
ttfquery/font_family_groups.py
421399
ttfquery/glyph.py
422400
ttfquery/glyphquery.py
423401
ttfquery/guessdescription.py
424402
ttfquery/license.txt
425403
ttfquery/metadata_query.py
426404
ttfquery/ttffiles.py
405+
ttfquery/ttffiles.pyc

TODO

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,19 @@
199199

200200
-- gd edge clipping is whacked - see arc test
201201

202-
-- font manager for paint and agg
202+
-- DONE 2004-02-15 font manager for paint and agg
203203

204204
-- website docs for agg - eg, backends.html#Agg
205205

206206
-- build win installer for paint, agg, matplotlib-0.50 with agg
207207

208208
-- incorporate John Gill's PS patch
209209

210-
-- DONE 2004 -02-13 agg bug; when repeated calls to savefig are made,
210+
-- DONE 2004-02-13 agg bug; when repeated calls to savefig are made,
211211
the dpi setting in the second one is ignored.
212+
213+
-- DONE alignment test: facecolor blue
214+
215+
-- axes_demo - strange line artiface in paint
216+
217+
-- figtext missing on ps backend

examples/backend_driver.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
"""
2+
This is use to drive many of the examples across the image backends
3+
and is used for regression testing and comparing backend efficiency
4+
5+
This example creates a lot of temp files name _tmp_*.py. You'll
6+
probably want to remove them after the script runs
7+
8+
"""
9+
10+
from __future__ import division
11+
import os, time
12+
files = (
13+
'alignment_test.py',
14+
'arctest.py',
15+
'axes_demo.py',
16+
'bar_stacked.py',
17+
'barchart_demo.py',
18+
'color_demo.py',
19+
'csd_demo.py',
20+
'figtext.py',
21+
'histogram_demo.py',
22+
'legend_demo.py',
23+
'legend_demo2.py',
24+
'line_styles.py',
25+
'log_demo.py',
26+
'log_test.py',
27+
'mri_with_eeg.py',
28+
'multiple_figs_demo.py',
29+
'pcolor_demo.py',
30+
'psd_demo.py',
31+
'scatter_demo.py',
32+
'scatter_demo2.py',
33+
'simple_plot.py',
34+
'stock_demo.py',
35+
'subplot_demo.py',
36+
'table_demo.py',
37+
'text_handles.py',
38+
'text_themes.py',
39+
)
40+
41+
def drive(backend):
42+
43+
for fname in files:
44+
lines = [
45+
'from __future__ import division\n',
46+
'import matplotlib\n',
47+
'matplotlib.use("%s")\n' % backend]
48+
print '\tdriving %s' % fname
49+
for line in file(fname):
50+
if line.strip().startswith('from __future__ import division'): continue
51+
if line.strip().startswith('matplotlib.use'): continue
52+
if line.strip().startswith('savefig'): continue
53+
if line.strip().startswith('show'): continue
54+
lines.append(line)
55+
basename, ext = os.path.splitext(fname)
56+
outfile = basename + '_%s'%backend
57+
if backend in ('GTK', 'Wx'):
58+
lines.append('show()')
59+
else:
60+
lines.append('savefig("%s", dpi=150)' % outfile)
61+
tmpfile = '_tmp_%s.py' % basename
62+
file(tmpfile, 'w').write(''.join(lines))
63+
os.system('python %s' % tmpfile)
64+
65+
times = {}
66+
backends = ('PS', 'GD', 'Paint', 'Agg', 'Template')
67+
#backends = ('Paint',)
68+
for backend in backends:
69+
print 'testing %s' % backend
70+
t0 = time.time()
71+
drive(backend)
72+
t1 = time.time()
73+
times[backend] = (t1-t0)/60.0
74+
75+
#print times
76+
for backend, elapsed in times.items():
77+
print 'Backend %s took %1.2f minutes to complete' % ( backend, elapsed)
78+
print '\ttemplate ratio %1.3f, template residual %1.3f' % (
79+
elapsed/times['Template'], elapsed-times['Template'])
80+

examples/colours.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"""
44
from Numeric import asarray
55
from matplotlib.mlab import linspace
6-
from matplotlib.backend_bases import arg_to_rgb
6+
from matplotlib.colors import colorConverter
77

88
def pastel(colour, weight=2.4):
99
""" Convert colour into a nice pastel shade"""
10-
rgb = asarray(arg_to_rgb(colour))
10+
rgb = asarray(colorConverter.to_rgb(colour))
1111
# scale colour
1212
maxc = max(rgb)
1313
if maxc < 1.0 and maxc > 0:

examples/text_handles.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ def f(t):
2828
set(ttext, 'fontangle', 'italic')
2929

3030
set(xtext, 'fontsize', 12)
31-
set(xtext, 'fontname', 'Courier')
32-
set(xtext, 'fontweight', 'ultrabold')
31+
set(xtext, 'fontname', 'courier')
32+
set(xtext, 'fontweight', 'bold')
3333
set(xtext, 'color', 'g')
3434

3535
set(ytext, 'fontsize', 12)
36-
set(ytext, 'fontname', 'Helvetica')
36+
set(ytext, 'fontname', 'helvetica')
3737
set(ytext, 'fontweight', 'light')
3838
set(ytext, 'color', 'b')
3939

@@ -42,5 +42,5 @@ def f(t):
4242
#yticklabels = get(gca(), 'yticklabels')
4343
#set(xticklabels, 'fontweight', 'bold')
4444
#set(yticklabels, 'fontangle', 'italic')
45-
45+
savefig('text_handles')
4646
show()

examples/text_themes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def f(t):
1616
plot(t1, f(t1), 'bo', t2, f(t2), 'k')
1717
title('Damped exponential decay', font, fontsize=14, color='r')
1818
text(2, 0.65, 'cos(2 pi t) exp(-t)', font, color='k')
19-
xlabel('time (s)', font)
19+
xlabel('time (s)', font, fontangle='italic')
2020
ylabel('voltage (mV)', font)
2121

2222
savefig('text_themes')

setup.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
from distutils.core import setup
1414
import sys,os
1515
import glob
16-
from setupext import build_gtkgd, build_agg, build_fonttools
16+
from setupext import build_gtkgd, build_agg, build_fonttools, build_gtkagg
1717

1818
# set these flags to build the optional extension modules
19-
BUILD_FONTTOOLS = 0 # includes TTFQuey
20-
BUILD_GTKGD = 0 # requires pygtk and GD src distros installed
21-
BUILD_AGG = 1
19+
BUILD_FONTTOOLS = 0 # includes TTFQuey
20+
BUILD_GTKGD = 0 # requires pygtk and GD src distros installed
21+
BUILD_AGG = 0
22+
BUILD_GTKAGG = 0
2223

2324
data = []
2425
data.extend(glob.glob('fonts/afm/*.afm'))
@@ -43,9 +44,14 @@
4344
build_fonttools(ext_modules, packages)
4445
build_agg(ext_modules, packages)
4546

47+
if BUILD_GTKAGG:
48+
build_fonttools(ext_modules, packages)
49+
build_agg(ext_modules, packages)
50+
build_gtkagg(ext_modules, packages)
51+
4652

4753
setup(name="matplotlib",
48-
version= '0.50p',
54+
version= '0.50q',
4955
description = "Matlab style python plotting package",
5056
author = "John D. Hunter",
5157
author_email="jdhunter@ace.bsd.uchicago.edu",

0 commit comments

Comments
 (0)
0