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

Skip to content

Commit b8883a7

Browse files
committed
removed gtkgd
svn path=/trunk/matplotlib/; revision=346
1 parent 18295ab commit b8883a7

7 files changed

Lines changed: 87 additions & 123 deletions

File tree

API_CHANGES

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
API CHANGES in matplotlib-0.54.3
2+
3+
removed the set_default_font / get_default_font scheme from the
4+
font_manager to unify customization of font defaults with the rest of
5+
the rc scheme. See examples/font_properties_demo.py and help(rc) in
6+
matplotlib.matlab.
7+
8+
19
API CHANGES in matplotlib-0.54
210

311
matlab interface

CHANGELOG

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
New entries should be added at the top
22
=======
3+
4+
2004-06-16 Added new py2exe FAQ entry and added frozen support in
5+
get_data_path for py2exe - JDH
6+
7+
2004-06-16 Removed GTKGD, which was always just a proof-of-concept
8+
backend - JDH
9+
310
2004-06-16 backend_gtk.py updates to replace deprecated functions
411
gtk.mainquit(), gtk.mainloop().
512
Update NavigationToolbar to use the new GtkToolbar API - SC
613

14+
2004-06-15 removed set_default_font from font_manager to unify font
15+
customization using the new function rc. See API_CHANGES
16+
fpr more info - JDH
17+
718
2004-06-15 Improved (yet again!) axis scaling to properly handle
819
singleton plots - JDH
920

@@ -19,7 +30,8 @@ New entries should be added at the top
1930
setting until object creation time; added new rc attrs:
2031
lines.markerfacecolor, lines.markeredgecolor,
2132
lines.markeredgewidth, patch.linewidth, patch.facecolor,
22-
patch.edgecolor, patch.antialiased - JDH
33+
patch.edgecolor, patch.antialiased; see
34+
examples/customize_rc.py for usage - JDH
2335

2436

2537
---------------------------------------------------------------

TODO

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,14 @@
426426

427427
-- change the viewlim on call to log if min ax <=0
428428

429-
-- fix set_def font example and update API_CHANGES
429+
-- DONE fix set_def font example and update API_CHANGES
430430

431431
-- upload 0.54.2 zip
432432

433433
-- DONE need a new way to indicate linestyle
434434

435-
-- update website re debian
435+
-- DONE update website re debian
436+
437+
-- DONE Fix stale link on GTK FAQ entry
438+
439+
-- DONE flush all traces of gtkgd

examples/customize_rc.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"""
2+
I'm not trying to make a good liking figure here, but just to show
3+
some examples of customizing rc params on the fly
4+
5+
If you like to work interactively, and need to create different sets
6+
of defaults for figures (eg one set of defaults for publication, one
7+
set for interactive exmplotation, you may want to define some
8+
functions in a custom module that set the defaults, eg
9+
10+
def set_pub():
11+
rc('font', weight='bold') # bold fonts are easier to see
12+
rc('tick', labelsize=15) # tick labels bigger
13+
rc('lines', lw=1, color='k') # thicker black lines (no budget for color!)
14+
rc('grid', c=0.5, ls='-', lw=0.5) # solid gray grid lines
15+
rc('savefig', dpi=300) # higher res outputs
16+
17+
18+
19+
Then as you are working interactively, you just need to do
20+
21+
>>> set_pub()
22+
>>> subplot(111)
23+
>>> plot([1,2,3])
24+
>>> savefig('myfig')
25+
>>> rcdefaults() # restore the defaults
26+
27+
"""
28+
from matplotlib.matlab import *
29+
30+
subplot(311)
31+
plot([1,2,3])
32+
33+
# the axes attributes need to be set before the call to subplot
34+
rc('font', weight='bold')
35+
rc('tick.major', size=5, pad=7)
36+
rc('tick', labelsize=15)
37+
38+
# using aliases for color, linestyle and linewith; gray, solid, thick
39+
rc('grid', c=0.5, ls='-', lw=5)
40+
41+
subplot(312)
42+
rc('lines', lw=2, color='g')
43+
plot([1,2,3])
44+
grid(True)
45+
46+
rcdefaults()
47+
subplot(313)
48+
plot([1,2,3])
49+
grid(True)
50+
show()

examples/font_properties_demo.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
11
#!/usr/bin/env python
2-
from matplotlib.font_manager import set_default_font, get_default_font
32
from matplotlib.matlab import *
43

5-
font = get_default_font()
6-
font.set_family('serif') # this operates on the default font!
7-
8-
otherFont = font.copy() # this is an independent font
9-
otherFont.set_family('monospace')
10-
otherFont.set_weight('bold')
11-
otherFont.set_size('larger')
4+
font = {'family' : 'monospace',
5+
'weight' : 'bold',
6+
'size' : 'larger',
7+
}
128

139
plot(arange(20))
1410
title('something')
1511

16-
set_default_font(otherFont)
12+
rc('font', **font) # pass in the font dict as kwargs
1713
for i in range(1,15,2):
18-
text(i, i, 'label %d'%i, color='g') # uses otherFont
19-
set_default_font(font) # restore default
20-
xlabel('hi mom') # uses font
14+
text(i, i, 'label %d'%i, color='g') # uses font
15+
16+
rcdefaults() # restore default
17+
xlabel('hi mom')
2118
show()

examples/simple_plot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
23
from matplotlib.matlab import *
34

45
figure(1)

src/_gtkgd.c

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)