Skip to content

Commit b257466

Browse files
committed
added newline sep text
svn path=/trunk/matplotlib/; revision=310
1 parent e1d2637 commit b257466

File tree

6 files changed

+42
-10
lines changed

6 files changed

+42
-10
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
New entries should be added at the top
22
------------------------------------------------------------
3+
4+
2004-05-18 Added newline seperated text with rotations to text.Text
5+
layout - JDH
6+
37
2004-05-16 Added fast pcolor using PolyCollections. - JDH
48

59
2004-05-14 Added fast polygon collections - changed scatter to use

TODO

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@
290290

291291
-- DONE support fontdicts, with deprecation as necessary
292292

293-
-- move text layout to front end and support newlines with rotation.
293+
-- DONE move text layout to front end and support newlines with rotation.
294294

295-
-- aligment test of backend_ps and table_demo on all backends
295+
-- DONE aligment test of backend_ps and table_demo on all backends
296296

297297
-- fix the sqrt mathtext bug revealed by Flavio's example
298298

@@ -345,7 +345,7 @@
345345

346346
-- DONE expose line set dashes
347347

348-
-- fix vertical layout in PS
348+
-- DONE fix vertical layout in PS
349349

350350
-- DONE y clipping broken
351351

@@ -355,10 +355,10 @@
355355

356356
-- DONE scatter demos whacked
357357

358-
-- fix small artist bboxing problems
358+
-- DONE fix small artist bboxing problems
359359

360-
-- fix backend image area problem for vert text in GTK - related to
361-
rect I think
360+
-- DONE fix backend image area problem for vert text in GTK - related to
361+
ascender I think - same problem as above
362362

363363
-- Tim's log y on hist.
364364

@@ -378,9 +378,12 @@
378378

379379
-- DONE - pcolor edge color
380380

381-
-- fix log bar - worked on OSX?
381+
-- DONE fix log bar - worked on OSX?
382382

383383
-- convert rank 1 arrays as per Flaviu's post
384384

385385
-- email tim log bar code after release
386386

387+
-- fix + 2 hack in width, height of ft2font and backend_agg and GTK
388+
389+
-- check mathtext in GTK

examples/histogram_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
x = mu + sigma*randn(10000)
66

77
# the histogram of the data
8-
n, bins, patches = hist(x, 50, normed=1)
8+
n, bins, patches = hist(x, 50, normed=1, bottom=0.001)
99

1010
# add a 'best fit' line
1111
y = normpdf( bins, mu, sigma)
@@ -17,6 +17,7 @@
1717
title(r'$\rm{Histogram of IQ: }\mu=100, \sigma=15$')
1818
axis([40, 160, 0, 0.03])
1919
grid(True)
20+
set(gca(), 'yscale', 'log')
2021
#set(gca(), 'xlim', [40, 160])
2122
#savefig('histogram_demo',dpi=72)
2223
show()

examples/simple_plot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
xlabel('time (s)')
1010
ylabel('voltage (mV)')
1111
title('About as simple as it gets, folks')
12+
#title('AAAAAAAAAAAAAAAAAAAAAAA')
1213
grid(True)
1314
#axis([0,1,-1,1])
14-
savefig('simple_plot', dpi=300)
15+
#savefig('simple_plot', dpi=300)
1516

1617
show()

src/_backend_agg.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,6 +815,29 @@ RendererAgg::draw_text(const Py::Tuple& args) {
815815
(i+x, y+j, p, font->image.buffer[i + j*font->image.width]);
816816
}
817817
}
818+
819+
/* bbox the text for debug purposes
820+
821+
agg::path_storage path;
822+
823+
path.move_to(x, y);
824+
path.line_to(x, y+font->image.height);
825+
path.line_to(x+font->image.width, y+font->image.height);
826+
path.line_to(x+font->image.width, y);
827+
path.close_polygon();
828+
829+
agg::rgba edgecolor(1,0,0,1);
830+
831+
//now fill the edge
832+
agg::conv_stroke<agg::path_storage> stroke(path);
833+
stroke.width(1.0);
834+
theRenderer->color(edgecolor);
835+
//self->theRasterizer->gamma(agg::gamma_power(gamma));
836+
theRasterizer->add_path(stroke);
837+
theRasterizer->render(*slineP8, *theRenderer);
838+
839+
*/
840+
818841
return Py::Object();
819842

820843
}

src/ft2font.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ FT2Font_get_width_height(FT2FontObject *self, PyObject *args)
622622
return Py_BuildValue("(ll)",
623623
(bbox.xMax - bbox.xMin),
624624
(bbox.yMax - bbox.yMin));
625-
}
625+
}
626626

627627

628628
void

0 commit comments

Comments
 (0)