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
|
From: <md...@us...> - 2007-09-12 14:05:25
|
Revision: 3836 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3836&view=rev Author: mdboom Date: 2007-09-12 07:05:20 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Merged revisions 3831-3835 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r3832 | dsdale | 2007-09-11 14:46:47 -0400 (Tue, 11 Sep 2007) | 3 lines removed MANIFEST from revision control. It is generated by MANIFEST.in when building source distribution archives ........ r3833 | jrevans | 2007-09-11 15:40:27 -0400 (Tue, 11 Sep 2007) | 5 lines Added the ability for the following in the various GUI backends: >>> import pylab >>> fig = pylab.figure() >>> fig.canvas.set_window_title("My Plot Window") ........ r3834 | jouni | 2007-09-12 03:04:38 -0400 (Wed, 12 Sep 2007) | 3 lines Further development of dviread. It now attempts to read virtual fonts, but the positioning is still somewhat off. ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_fltkagg.py branches/transforms/lib/matplotlib/backends/backend_gtk.py branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/backends/backend_qt.py branches/transforms/lib/matplotlib/backends/backend_qt4.py branches/transforms/lib/matplotlib/backends/backend_tkagg.py branches/transforms/lib/matplotlib/backends/backend_wx.py branches/transforms/lib/matplotlib/dviread.py Removed Paths: ------------- branches/transforms/MANIFEST Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-3830 + /trunk/matplotlib:1-3835 Deleted: branches/transforms/MANIFEST =================================================================== --- branches/transforms/MANIFEST 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/MANIFEST 2007-09-12 14:05:20 UTC (rev 3836) @@ -1,1398 +0,0 @@ -API_CHANGES -CHANGELOG -INSTALL -INTERACTIVE -KNOWN_BUGS -MANIFEST.in -Makefile -NUMARRAY_ISSUES -README -TODO -__init__.py -makeswig.py -matplotlibrc.template -setup.cfg -setup.py -setupegg.py -setupext.py -CXX/Config.hxx -CXX/Exception.hxx -CXX/Extensions.hxx -CXX/IndirectPythonInterface.cxx -CXX/IndirectPythonInterface.hxx -CXX/Objects.hxx -CXX/Version.hxx -CXX/cxx_extensions.cxx -CXX/cxxextensions.c -CXX/cxxsupport.cxx -agg23/font_freetype/Makefile.am -agg23/font_freetype/agg_font_freetype.cpp -agg23/font_freetype/agg_font_freetype.h -agg23/font_win32_tt/agg_font_win32_tt.cpp -agg23/font_win32_tt/agg_font_win32_tt.h -agg23/include/Makefile.am -agg23/include/agg_alpha_mask_u8.h -agg23/include/agg_arc.h -agg23/include/agg_array.h -agg23/include/agg_arrowhead.h -agg23/include/agg_basics.h -agg23/include/agg_bezier_arc.h -agg23/include/agg_bitset_iterator.h -agg23/include/agg_bounding_rect.h -agg23/include/agg_bspline.h -agg23/include/agg_clip_liang_barsky.h -agg23/include/agg_color_gray.h -agg23/include/agg_color_rgba.h -agg23/include/agg_config.h -agg23/include/agg_conv_adaptor_vcgen.h -agg23/include/agg_conv_adaptor_vpgen.h -agg23/include/agg_conv_bspline.h -agg23/include/agg_conv_clip_polygon.h -agg23/include/agg_conv_clip_polyline.h -agg23/include/agg_conv_close_polygon.h -agg23/include/agg_conv_concat.h -agg23/include/agg_conv_contour.h -agg23/include/agg_conv_curve.h -agg23/include/agg_conv_dash.h -agg23/include/agg_conv_gpc.h -agg23/include/agg_conv_marker.h -agg23/include/agg_conv_marker_adaptor.h -agg23/include/agg_conv_segmentator.h -agg23/include/agg_conv_shorten_path.h -agg23/include/agg_conv_smooth_poly1.h -agg23/include/agg_conv_stroke.h -agg23/include/agg_conv_transform.h -agg23/include/agg_conv_unclose_polygon.h -agg23/include/agg_curves.h -agg23/include/agg_dda_line.h -agg23/include/agg_ellipse.h -agg23/include/agg_ellipse_bresenham.h -agg23/include/agg_embedded_raster_fonts.h -agg23/include/agg_font_cache_manager.h -agg23/include/agg_gamma_functions.h -agg23/include/agg_gamma_lut.h -agg23/include/agg_glyph_raster_bin.h -agg23/include/agg_gsv_text.h -agg23/include/agg_image_filters.h -agg23/include/agg_line_aa_basics.h -agg23/include/agg_math.h -agg23/include/agg_math_stroke.h -agg23/include/agg_path_storage.h -agg23/include/agg_path_storage_integer.h -agg23/include/agg_pattern_filters_rgba.h -agg23/include/agg_pixfmt_amask_adaptor.h -agg23/include/agg_pixfmt_gray.h -agg23/include/agg_pixfmt_rgb.h -agg23/include/agg_pixfmt_rgb_packed.h -agg23/include/agg_pixfmt_rgba.h -agg23/include/agg_rasterizer_outline.h -agg23/include/agg_rasterizer_outline_aa.h -agg23/include/agg_rasterizer_scanline_aa.h -agg23/include/agg_render_scanlines.h -agg23/include/agg_renderer_base.h -agg23/include/agg_renderer_markers.h -agg23/include/agg_renderer_mclip.h -agg23/include/agg_renderer_outline_aa.h -agg23/include/agg_renderer_outline_image.h -agg23/include/agg_renderer_primitives.h -agg23/include/agg_renderer_raster_text.h -agg23/include/agg_renderer_scanline.h -agg23/include/agg_rendering_buffer.h -agg23/include/agg_rendering_buffer_dynarow.h -agg23/include/agg_rounded_rect.h -agg23/include/agg_scanline_bin.h -agg23/include/agg_scanline_boolean_algebra.h -agg23/include/agg_scanline_p.h -agg23/include/agg_scanline_storage_aa.h -agg23/include/agg_scanline_storage_bin.h -agg23/include/agg_scanline_u.h -agg23/include/agg_shorten_path.h -agg23/include/agg_simul_eq.h -agg23/include/agg_span_allocator.h -agg23/include/agg_span_converter.h -agg23/include/agg_span_generator.h -agg23/include/agg_span_gouraud.h -agg23/include/agg_span_gouraud_gray.h -agg23/include/agg_span_gouraud_rgba.h -agg23/include/agg_span_gradient.h -agg23/include/agg_span_gradient_alpha.h -agg23/include/agg_span_image_filter.h -agg23/include/agg_span_image_filter_gray.h -agg23/include/agg_span_image_filter_rgb.h -agg23/include/agg_span_image_filter_rgba.h -agg23/include/agg_span_image_resample.h -agg23/include/agg_span_image_resample_gray.h -agg23/include/agg_span_image_resample_rgb.h -agg23/include/agg_span_image_resample_rgba.h -agg23/include/agg_span_interpolator_adaptor.h -agg23/include/agg_span_interpolator_linear.h -agg23/include/agg_span_interpolator_persp.h -agg23/include/agg_span_interpolator_trans.h -agg23/include/agg_span_pattern.h -agg23/include/agg_span_pattern_filter_gray.h -agg23/include/agg_span_pattern_filter_rgb.h -agg23/include/agg_span_pattern_filter_rgba.h -agg23/include/agg_span_pattern_resample_gray.h -agg23/include/agg_span_pattern_resample_rgb.h -agg23/include/agg_span_pattern_resample_rgba.h -agg23/include/agg_span_pattern_rgb.h -agg23/include/agg_span_pattern_rgba.h -agg23/include/agg_span_solid.h -agg23/include/agg_span_subdiv_adaptor.h -agg23/include/agg_trans_affine.h -agg23/include/agg_trans_bilinear.h -agg23/include/agg_trans_double_path.h -agg23/include/agg_trans_lens.h -agg23/include/agg_trans_perspective.h -agg23/include/agg_trans_single_path.h -agg23/include/agg_trans_viewport.h -agg23/include/agg_trans_warp_magnifier.h -agg23/include/agg_vcgen_bspline.h -agg23/include/agg_vcgen_contour.h -agg23/include/agg_vcgen_dash.h -agg23/include/agg_vcgen_markers_term.h -agg23/include/agg_vcgen_smooth_poly1.h -agg23/include/agg_vcgen_stroke.h -agg23/include/agg_vcgen_vertex_sequence.h -agg23/include/agg_vertex_sequence.h -agg23/include/agg_vpgen_clip_polygon.h -agg23/include/agg_vpgen_clip_polyline.h -agg23/include/agg_vpgen_segmentator.h -agg23/include/ctrl/Makefile.am -agg23/include/ctrl/agg_bezier_ctrl.h -agg23/include/ctrl/agg_cbox_ctrl.h -agg23/include/ctrl/agg_ctrl.h -agg23/include/ctrl/agg_gamma_ctrl.h -agg23/include/ctrl/agg_gamma_spline.h -agg23/include/ctrl/agg_polygon_ctrl.h -agg23/include/ctrl/agg_rbox_ctrl.h -agg23/include/ctrl/agg_scale_ctrl.h -agg23/include/ctrl/agg_slider_ctrl.h -agg23/include/ctrl/agg_spline_ctrl.h -agg23/include/platform/Makefile.am -agg23/include/platform/agg_platform_support.h -agg23/include/platform/mac/agg_mac_pmap.h -agg23/include/platform/win32/agg_win32_bmp.h -agg23/include/util/Makefile.am -agg23/include/util/agg_color_conv.h -agg23/include/util/agg_color_conv_rgb16.h -agg23/include/util/agg_color_conv_rgb8.h -agg23/src/ChangeLog -agg23/src/Makefile -agg23/src/Makefile.am -agg23/src/agg_arc.cpp -agg23/src/agg_arrowhead.cpp -agg23/src/agg_bezier_arc.cpp -agg23/src/agg_bspline.cpp -agg23/src/agg_curves.cpp -agg23/src/agg_embedded_raster_fonts.cpp -agg23/src/agg_gsv_text.cpp -agg23/src/agg_image_filters.cpp -agg23/src/agg_line_aa_basics.cpp -agg23/src/agg_line_profile_aa.cpp -agg23/src/agg_path_storage.cpp -agg23/src/agg_rasterizer_scanline_aa.cpp -agg23/src/agg_rounded_rect.cpp -agg23/src/agg_sqrt_tables.cpp -agg23/src/agg_trans_affine.cpp -agg23/src/agg_trans_double_path.cpp -agg23/src/agg_trans_single_path.cpp -agg23/src/agg_trans_warp_magnifier.cpp -agg23/src/agg_vcgen_bspline.cpp -agg23/src/agg_vcgen_contour.cpp -agg23/src/agg_vcgen_dash.cpp -agg23/src/agg_vcgen_markers_term.cpp -agg23/src/agg_vcgen_smooth_poly1.cpp -agg23/src/agg_vcgen_stroke.cpp -agg23/src/agg_vpgen_clip_polygon.cpp -agg23/src/agg_vpgen_clip_polyline.cpp -agg23/src/agg_vpgen_segmentator.cpp -agg23/src/authors -agg23/src/autogen.sh -agg23/src/configure.in -agg23/src/copying -agg23/src/install -agg23/src/news -agg23/src/readme -agg23/src/ctrl/Makefile.am -agg23/src/ctrl/agg_bezier_ctrl.cpp -agg23/src/ctrl/agg_cbox_ctrl.cpp -agg23/src/ctrl/agg_gamma_ctrl.cpp -agg23/src/ctrl/agg_gamma_spline.cpp -agg23/src/ctrl/agg_polygon_ctrl.cpp -agg23/src/ctrl/agg_rbox_ctrl.cpp -agg23/src/ctrl/agg_scale_ctrl.cpp -agg23/src/ctrl/agg_slider_ctrl.cpp -agg23/src/ctrl/agg_spline_ctrl.cpp -agg23/src/platform/Makefile.am -agg23/src/platform/AmigaOS/agg_platform_support.cpp -agg23/src/platform/BeOS/agg_platform_support.cpp -agg23/src/platform/X11/Makefile.am -agg23/src/platform/X11/agg_platform_support.cpp -agg23/src/platform/mac/agg_mac_pmap.cpp -agg23/src/platform/mac/agg_platform_support.cpp -agg23/src/platform/sdl/agg_platform_support.cpp -agg23/src/platform/win32/agg_platform_support.cpp -agg23/src/platform/win32/agg_win32_bmp.cpp -agg23/svg/agg_svg_exception.h -agg23/svg/agg_svg_parser.cpp -agg23/svg/agg_svg_parser.h -agg23/svg/agg_svg_path_renderer.cpp -agg23/svg/agg_svg_path_renderer.h -agg23/svg/agg_svg_path_tokenizer.cpp -agg23/svg/agg_svg_path_tokenizer.h -agg23/svg/svg_test.cpp -agg23/svg/BeOS/Makefile -agg23/svg/X11/Makefile -agg23/svg/macos_cw/expat.h -agg23/svg/macos_cw/include.h -agg23/svg/macos_cw/xmlparse.h -agg23/svg/win32_api/Makefile -agg23/svg/win32_api/svg_test.dsp -agg23/svg/win32_api/svg_test.dsw -examples/README -examples/__init__.py -examples/accented_text.py -examples/agg_oo.py -examples/agg_resize.py -examples/agg_test.py -examples/alignment_test.py -examples/anim.py -examples/anim_tk.py -examples/animation_blit.py -examples/animation_blit_fltk.py -examples/animation_blit_qt.py -examples/animation_blit_qt4.py -examples/animation_blit_tk.py -examples/animation_blit_wx.py -examples/annotation_demo.py -examples/anscombe.py -examples/arctest.py -examples/arrow_demo.py -examples/axes_demo.py -examples/axes_props.py -examples/axhspan_demo.py -examples/axis_equal_demo.py -examples/backend_driver.py -examples/bar_stacked.py -examples/barchart_demo.py -examples/barcode_demo.py -examples/barh_demo.py -examples/boxplot_demo.py -examples/break.py -examples/broken_barh.py -examples/clippath_test.py -examples/clippedline.py -examples/collections_demo.py -examples/color_by_yvalue.py -examples/color_demo.py -examples/colours.py -examples/contour_demo.py -examples/contour_image.py -examples/contourf_demo.py -examples/coords_demo.py -examples/coords_report.py -examples/csd_demo.py -examples/cursor_demo.py -examples/custom_figure_class.py -examples/custom_ticker1.py -examples/customize_rc.py -examples/dannys_example.py -examples/dash_control.py -examples/dashpointlabel.py -examples/dashtick.py -examples/data_helper.py -examples/date_demo1.py -examples/date_demo2.py -examples/date_demo_convert.py -examples/date_demo_rrule.py -examples/dynamic_collection.py -examples/dynamic_demo.py -examples/dynamic_demo_wx.py -examples/dynamic_image_gtkagg.py -examples/dynamic_image_wxagg.py -examples/dynamic_image_wxagg2.py -examples/ellipse_demo.py -examples/ellipse_rotated.py -examples/embedding_in_gtk.py -examples/embedding_in_gtk2.py -examples/embedding_in_gtk3.py -examples/embedding_in_qt.py -examples/embedding_in_qt4.py -examples/embedding_in_tk.py -examples/embedding_in_tk2.py -examples/embedding_in_wx.py -examples/embedding_in_wx2.py -examples/embedding_in_wx3.py -examples/embedding_in_wx4.py -examples/errorbar_demo.py -examples/figimage_demo.py -examples/figlegend_demo.py -examples/figtext.py -examples/fill_between.py -examples/fill_between_posneg.py -examples/fill_demo.py -examples/fill_demo2.py -examples/fill_spiral.py -examples/finance_demo.py -examples/font_indexing.py -examples/font_table_ttf.py -examples/fonts_demo.py -examples/fonts_demo_kw.py -examples/ftface_props.py -examples/ganged_plots.py -examples/gdtest.py -examples/glyph_to_path.py -examples/gtk_spreadsheet.py -examples/hatch_demo.py -examples/histogram_demo.py -examples/histogram_demo_canvasagg.py -examples/image_demo.py -examples/image_demo2.py -examples/image_demo3.py -examples/image_demo_na.py -examples/image_interp.py -examples/image_masked.py -examples/image_origin.py -examples/integral_demo.py -examples/interactive.py -examples/interactive2.py -examples/interp_demo.py -examples/invert_axes.py -examples/keypress_demo.py -examples/lasso_demo.py -examples/layer_images.py -examples/legend_auto.py -examples/legend_demo.py -examples/legend_demo2.py -examples/legend_scatter.py -examples/line_collection.py -examples/line_collection2.py -examples/line_styles.py -examples/load_converter.py -examples/log_bar.py -examples/log_demo.py -examples/log_test.py -examples/logo.py -examples/major_minor_demo1.py -examples/major_minor_demo2.py -examples/masked_demo.py -examples/mathtext2_demo.py -examples/mathtext_demo.py -examples/matplotlib_icon.py -examples/matshow.py -examples/movie_demo.py -examples/mpl_with_glade.py -examples/mri_demo.py -examples/mri_with_eeg.py -examples/multi_image.py -examples/multiline.py -examples/multiple_figs_demo.py -examples/newscalarformatter_demo.py -examples/object_picker.py -examples/pcolor_demo.py -examples/pcolor_demo2.py -examples/pcolor_log.py -examples/pcolor_nonuniform.py -examples/pcolor_small.py -examples/pick_event_demo.py -examples/picker_demo.py -examples/pie_demo.py -examples/polar_bar.py -examples/polar_demo.py -examples/polar_legend.py -examples/polar_scatter.py -examples/poly_editor.py -examples/poormans_contour.py -examples/print_stdout.py -examples/printing_in_wx.py -examples/psd_demo.py -examples/pstest.py -examples/pylab_with_gtk.py -examples/pythonic_matplotlib.py -examples/quadmesh_demo.py -examples/quiver_demo.py -examples/scatter_custom_symbol.py -examples/scatter_demo.py -examples/scatter_demo2.py -examples/scatter_masked.py -examples/scatter_profile.py -examples/scatter_star_poly.py -examples/set_and_get.py -examples/shared_axis_demo.py -examples/simple3d.py -examples/simple3d_oo.py -examples/simple_plot.py -examples/specgram_demo.py -examples/spy_demos.py -examples/stem_plot.py -examples/stock_demo.py -examples/strip_chart_demo.py -examples/subplot_demo.py -examples/subplot_toolbar.py -examples/subplots_adjust.py -examples/system_monitor.py -examples/table_demo.py -examples/tex_demo.py -examples/text_handles.py -examples/text_rotation.py -examples/text_themes.py -examples/to_numeric.py -examples/toggle_images.py -examples/transoffset.py -examples/two_scales.py -examples/unicode_demo.py -examples/vertical_ticklabels.py -examples/vline_demo.py -examples/webapp_demo.py -examples/wxcursor_demo.py -examples/xcorr_demo.py -examples/zoom_window.py -examples/zorder_demo.py -examples/data/AAPL.dat -examples/data/INTC.dat -examples/data/ct.raw -examples/data/eeg.dat -examples/data/embedding_in_wx3.xrc -examples/data/intc.csv -examples/data/lena.jpg -examples/data/membrane.dat -examples/data/msft.csv -examples/data/s1045.ima -examples/units/__init__.py -examples/units/artist_tests.py -examples/units/bar_unit_demo.py -examples/units/basic_units.py -examples/units/date_converter.py -examples/units/date_support.py -examples/units/evans_test.py -examples/units/evans_test2.py -examples/units/radian_demo.py -examples/units/units_sample.py -examples/units/units_scatter.py -examples/widgets/README -examples/widgets/buttons.py -examples/widgets/check_buttons.py -examples/widgets/cursor.py -examples/widgets/multicursor.py -examples/widgets/radio_buttons.py -examples/widgets/rectangle_selector.py -examples/widgets/sliders.py -examples/widgets/span_selector.py -lib/pylab.py -lib/dateutil/__init__.py -lib/dateutil/easter.py -lib/dateutil/parser.py -lib/dateutil/relativedelta.py -lib/dateutil/rrule.py -lib/dateutil/tz.py -lib/matplotlib/.cvsignore -lib/matplotlib/__init__.py -lib/matplotlib/_cm.py -lib/matplotlib/_contour.py -lib/matplotlib/_image.py -lib/matplotlib/_mathtext_data.py -lib/matplotlib/_pylab_helpers.py -lib/matplotlib/_transforms.py -lib/matplotlib/afm.py -lib/matplotlib/agg.py -lib/matplotlib/art3d.py -lib/matplotlib/artist.py -lib/matplotlib/artist.py~ -lib/matplotlib/axes.py -lib/matplotlib/axes.py~ -lib/matplotlib/axes3d.py -lib/matplotlib/axis.py -lib/matplotlib/axis3d.py -lib/matplotlib/backend_bases.py -lib/matplotlib/cbook.py -lib/matplotlib/cm.py -lib/matplotlib/collections.py -lib/matplotlib/colorbar.py -lib/matplotlib/colors.py -lib/matplotlib/contour.py -lib/matplotlib/dates.py -lib/matplotlib/dviread.py -lib/matplotlib/figure.py -lib/matplotlib/finance.py -lib/matplotlib/font_manager.py -lib/matplotlib/image.py -lib/matplotlib/legend.py -lib/matplotlib/lines.py -lib/matplotlib/mathtext.py -lib/matplotlib/mathtext2.py -lib/matplotlib/mlab.py -lib/matplotlib/nxutils.py -lib/matplotlib/patches.py -lib/matplotlib/proj3d.py -lib/matplotlib/pylab.py -lib/matplotlib/pyparsing.py -lib/matplotlib/quiver.py -lib/matplotlib/table.py -lib/matplotlib/texmanager.py -lib/matplotlib/text.py -lib/matplotlib/ticker.py -lib/matplotlib/transforms.py -lib/matplotlib/units.py -lib/matplotlib/widgets.py -lib/matplotlib/windowing.py -lib/matplotlib/backends/.cvsignore -lib/matplotlib/backends/__init__.py -lib/matplotlib/backends/backend_agg.py -lib/matplotlib/backends/backend_agg2.py -lib/matplotlib/backends/backend_cairo.py -lib/matplotlib/backends/backend_cocoaagg.py -lib/matplotlib/backends/backend_emf.py -lib/matplotlib/backends/backend_fltkagg.py -lib/matplotlib/backends/backend_gd.py -lib/matplotlib/backends/backend_gdk.py -lib/matplotlib/backends/backend_gtk.py -lib/matplotlib/backends/backend_gtkagg.py -lib/matplotlib/backends/backend_gtkcairo.py -lib/matplotlib/backends/backend_paint.py -lib/matplotlib/backends/backend_pdf.py -lib/matplotlib/backends/backend_ps.py -lib/matplotlib/backends/backend_qt.py -lib/matplotlib/backends/backend_qt4.py -lib/matplotlib/backends/backend_qt4agg.py -lib/matplotlib/backends/backend_qtagg.py -lib/matplotlib/backends/backend_svg.py -lib/matplotlib/backends/backend_template.py -lib/matplotlib/backends/backend_tkagg.py -lib/matplotlib/backends/backend_wx.py -lib/matplotlib/backends/backend_wxagg.py -lib/matplotlib/backends/tkagg.py -lib/matplotlib/backends/Matplotlib.nib/classes.nib -lib/matplotlib/backends/Matplotlib.nib/info.nib -lib/matplotlib/backends/Matplotlib.nib/keyedobjects.nib -lib/matplotlib/enthought/__init__.py -lib/matplotlib/enthought/resource/__init__.py -lib/matplotlib/enthought/resource/resource_factory.py -lib/matplotlib/enthought/resource/resource_manager.py -lib/matplotlib/enthought/resource/resource_path.py -lib/matplotlib/enthought/resource/resource_reference.py -lib/matplotlib/enthought/traits/__init__.py -lib/matplotlib/enthought/traits/category.py -lib/matplotlib/enthought/traits/ctraits.c -lib/matplotlib/enthought/traits/has_traits.py -lib/matplotlib/enthought/traits/info_traits.py -lib/matplotlib/enthought/traits/standard.py -lib/matplotlib/enthought/traits/trait_base.py -lib/matplotlib/enthought/traits/trait_db.py -lib/matplotlib/enthought/traits/trait_errors.py -lib/matplotlib/enthought/traits/trait_handlers.py -lib/matplotlib/enthought/traits/trait_notifiers.py -lib/matplotlib/enthought/traits/trait_numeric.py -lib/matplotlib/enthought/traits/traits.py -lib/matplotlib/enthought/traits/ui/__init__.py -lib/matplotlib/enthought/traits/ui/editor.py -lib/matplotlib/enthought/traits/ui/editor_factory.py -lib/matplotlib/enthought/traits/ui/editors.py -lib/matplotlib/enthought/traits/ui/group.py -lib/matplotlib/enthought/traits/ui/handler.py -lib/matplotlib/enthought/traits/ui/help.py -lib/matplotlib/enthought/traits/ui/help_template.py -lib/matplotlib/enthought/traits/ui/helper.py -lib/matplotlib/enthought/traits/ui/include.py -lib/matplotlib/enthought/traits/ui/item.py -lib/matplotlib/enthought/traits/ui/menu.py -lib/matplotlib/enthought/traits/ui/toolkit.py -lib/matplotlib/enthought/traits/ui/tree_node.py -lib/matplotlib/enthought/traits/ui/ui.py -lib/matplotlib/enthought/traits/ui/ui_info.py -lib/matplotlib/enthought/traits/ui/ui_traits.py -lib/matplotlib/enthought/traits/ui/undo.py -lib/matplotlib/enthought/traits/ui/view.py -lib/matplotlib/enthought/traits/ui/view_element.py -lib/matplotlib/enthought/traits/ui/view_elements.py -lib/matplotlib/enthought/traits/ui/null/__init__.py -lib/matplotlib/enthought/traits/ui/null/color_trait.py -lib/matplotlib/enthought/traits/ui/null/font_trait.py -lib/matplotlib/enthought/traits/ui/null/rgb_color_trait.py -lib/matplotlib/enthought/traits/ui/null/rgba_color_trait.py -lib/matplotlib/enthought/traits/ui/null/toolkit.py -lib/matplotlib/enthought/util/__init__.py -lib/matplotlib/enthought/util/resource.py -lib/matplotlib/mpl-data/matplotlibrc -lib/matplotlib/mpl-data/fonts/afm/cmex10.afm -lib/matplotlib/mpl-data/fonts/afm/cmmi10.afm -lib/matplotlib/mpl-data/fonts/afm/cmr10.afm -lib/matplotlib/mpl-data/fonts/afm/cmsy10.afm -lib/matplotlib/mpl-data/fonts/afm/cmtt10.afm -lib/matplotlib/mpl-data/fonts/afm/pagd8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagdo8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagk8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkd8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkdi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkl8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkli8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrro8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvb8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvb8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvbo8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvbo8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvl8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvlo8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvr8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvr8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvro8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvro8an.afm -lib/matplotlib/mpl-data/fonts/afm/pncb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncri8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplri8a.afm -lib/matplotlib/mpl-data/fonts/afm/psyr.afm -lib/matplotlib/mpl-data/fonts/afm/ptmb8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmr8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmri8a.afm -lib/matplotlib/mpl-data/fonts/afm/putb8a.afm -lib/matplotlib/mpl-data/fonts/afm/putbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/putr8a.afm -lib/matplotlib/mpl-data/fonts/afm/putri8a.afm -lib/matplotlib/mpl-data/fonts/afm/pzcmi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pzdr.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-BoldOblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Oblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-BoldOblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Oblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Symbol.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-BoldItalic.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Italic.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Roman.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/ZapfDingbats.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt -lib/matplotlib/mpl-data/fonts/ttf/COPYRIGHT.TXT -lib/matplotlib/mpl-data/fonts/ttf/README.TXT -lib/matplotlib/mpl-data/fonts/ttf/RELEASENOTES.TXT -lib/matplotlib/mpl-data/fonts/ttf/Vera.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraBI.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraIt.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoBI.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoIt.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMono.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraSe.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraSeBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmex10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmr10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf -lib/matplotlib/mpl-data/fonts/ttf/local.conf -lib/matplotlib/mpl-data/images/back.png -lib/matplotlib/mpl-data/images/back.ppm -lib/matplotlib/mpl-data/images/back.svg -lib/matplotlib/mpl-data/images/back.xpm -lib/matplotlib/mpl-data/images/filesave.png -lib/matplotlib/mpl-data/images/filesave.ppm -lib/matplotlib/mpl-data/images/filesave.svg -lib/matplotlib/mpl-data/images/filesave.xpm -lib/matplotlib/mpl-data/images/forward.png -lib/matplotlib/mpl-data/images/forward.ppm -lib/matplotlib/mpl-data/images/forward.svg -lib/matplotlib/mpl-data/images/forward.xpm -lib/matplotlib/mpl-data/images/hand.png -lib/matplotlib/mpl-data/images/hand.ppm -lib/matplotlib/mpl-data/images/hand.svg -lib/matplotlib/mpl-data/images/hand.xpm -lib/matplotlib/mpl-data/images/home.png -lib/matplotlib/mpl-data/images/home.ppm -lib/matplotlib/mpl-data/images/home.svg -lib/matplotlib/mpl-data/images/home.xpm -lib/matplotlib/mpl-data/images/matplotlib.png -lib/matplotlib/mpl-data/images/matplotlib.svg -lib/matplotlib/mpl-data/images/move.png -lib/matplotlib/mpl-data/images/move.ppm -lib/matplotlib/mpl-data/images/move.svg -lib/matplotlib/mpl-data/images/move.xpm -lib/matplotlib/mpl-data/images/stock_close.ppm -lib/matplotlib/mpl-data/images/stock_close.xpm -lib/matplotlib/mpl-data/images/stock_down.ppm -lib/matplotlib/mpl-data/images/stock_down.xpm -lib/matplotlib/mpl-data/images/stock_left.ppm -lib/matplotlib/mpl-data/images/stock_left.xpm -lib/matplotlib/mpl-data/images/stock_refresh.ppm -lib/matplotlib/mpl-data/images/stock_refresh.xpm -lib/matplotlib/mpl-data/images/stock_right.ppm -lib/matplotlib/mpl-data/images/stock_right.xpm -lib/matplotlib/mpl-data/images/stock_save_as.ppm -lib/matplotlib/mpl-data/images/stock_save_as.xpm -lib/matplotlib/mpl-data/images/stock_up.ppm -lib/matplotlib/mpl-data/images/stock_up.xpm -lib/matplotlib/mpl-data/images/stock_zoom-in.ppm -lib/matplotlib/mpl-data/images/stock_zoom-in.xpm -lib/matplotlib/mpl-data/images/stock_zoom-out.ppm -lib/matplotlib/mpl-data/images/stock_zoom-out.xpm -lib/matplotlib/mpl-data/images/subplots.png -lib/matplotlib/mpl-data/images/subplots.ppm -lib/matplotlib/mpl-data/images/subplots.xpm -lib/matplotlib/mpl-data/images/zoom_to_rect.png -lib/matplotlib/mpl-data/images/zoom_to_rect.ppm -lib/matplotlib/mpl-data/images/zoom_to_rect.svg -lib/matplotlib/mpl-data/images/zoom_to_rect.xpm -lib/matplotlib/numerix/.cvsignore -lib/matplotlib/numerix/__init__.py -lib/matplotlib/numerix/_na_imports.py -lib/matplotlib/numerix/_nc_imports.py -lib/matplotlib/numerix/_sp_imports.py -lib/matplotlib/numerix/fft/__init__.py -lib/matplotlib/numerix/linear_algebra/__init__.py -lib/matplotlib/numerix/ma/__init__.py -lib/matplotlib/numerix/mlab/.cvsignore -lib/matplotlib/numerix/mlab/__init__.py -lib/matplotlib/numerix/random_array/__init__.py -lib/matplotlib/toolkits/__init__.py -lib/pytz/__init__.py -lib/pytz/reference.py -lib/pytz/test_tzinfo.py -lib/pytz/tzinfo.py -lib/pytz/zoneinfo/CET.py -lib/pytz/zoneinfo/CST6CDT.py -lib/pytz/zoneinfo/Cuba.py -lib/pytz/zoneinfo/EET.py -lib/pytz/zoneinfo/EST.py -lib/pytz/zoneinfo/EST5EDT.py -lib/pytz/zoneinfo/Egypt.py -lib/pytz/zoneinfo/Eire.py -lib/pytz/zoneinfo/GB.py -lib/pytz/zoneinfo/GB_minus_Eire.py -lib/pytz/zoneinfo/GMT.py -lib/pytz/zoneinfo/GMT0.py -lib/pytz/zoneinfo/GMT_minus_0.py -lib/pytz/zoneinfo/GMT_plus_0.py -lib/pytz/zoneinfo/Greenwich.py -lib/pytz/zoneinfo/HST.py -lib/pytz/zoneinfo/Hongkong.py -lib/pytz/zoneinfo/Iceland.py -lib/pytz/zoneinfo/Iran.py -lib/pytz/zoneinfo/Israel.py -lib/pytz/zoneinfo/Jamaica.py -lib/pytz/zoneinfo/Japan.py -lib/pytz/zoneinfo/Kwajalein.py -lib/pytz/zoneinfo/Libya.py -lib/pytz/zoneinfo/MET.py -lib/pytz/zoneinfo/MST.py -lib/pytz/zoneinfo/MST7MDT.py -lib/pytz/zoneinfo/NZ.py -lib/pytz/zoneinfo/NZ_minus_CHAT.py -lib/pytz/zoneinfo/Navajo.py -lib/pytz/zoneinfo/PRC.py -lib/pytz/zoneinfo/PST8PDT.py -lib/pytz/zoneinfo/Poland.py -lib/pytz/zoneinfo/Portugal.py -lib/pytz/zoneinfo/ROC.py -lib/pytz/zoneinfo/ROK.py -lib/pytz/zoneinfo/Singapore.py -lib/pytz/zoneinfo/Turkey.py -lib/pytz/zoneinfo/UCT.py -lib/pytz/zoneinfo/UTC.py -lib/pytz/zoneinfo/Universal.py -lib/pytz/zoneinfo/WET.py -lib/pytz/zoneinfo/W_minus_SU.py -lib/pytz/zoneinfo/Zulu.py -lib/pytz/zoneinfo/__init__.py -lib/pytz/zoneinfo/posixrules.py -lib/pytz/zoneinfo/Africa/Abidjan.py -lib/pytz/zoneinfo/Africa/Accra.py -lib/pytz/zoneinfo/Africa/Addis_Ababa.py -lib/pytz/zoneinfo/Africa/Algiers.py -lib/pytz/zoneinfo/Africa/Asmera.py -lib/pytz/zoneinfo/Africa/Bamako.py -lib/pytz/zoneinfo/Africa/Bangui.py -lib/pytz/zoneinfo/Africa/Banjul.py -lib/pytz/zoneinfo/Africa/Bissau.py -lib/pytz/zoneinfo/Africa/Blantyre.py -lib/pytz/zoneinfo/Africa/Brazzaville.py -lib/pytz/zoneinfo/Africa/Bujumbura.py -lib/pytz/zoneinfo/Africa/Cairo.py -lib/pytz/zoneinfo/Africa/Casablanca.py -lib/pytz/zoneinfo/Africa/Ceuta.py -lib/pytz/zoneinfo/Africa/Conakry.py -lib/pytz/zoneinfo/Africa/Dakar.py -lib/pytz/zoneinfo/Africa/Dar_es_Salaam.py -lib/pytz/zoneinfo/Africa/Djibouti.py -lib/pytz/zoneinfo/Africa/Douala.py -lib/pytz/zoneinfo/Africa/El_Aaiun.py -lib/pytz/zoneinfo/Africa/Freetown.py -lib/pytz/zoneinfo/Africa/Gaborone.py -lib/pytz/zoneinfo/Africa/Harare.py -lib/pytz/zoneinfo/Africa/Johannesburg.py -lib/pytz/zoneinfo/Africa/Kampala.py -lib/pytz/zoneinfo/Africa/Khartoum.py -lib/pytz/zoneinfo/Africa/Kigali.py -lib/pytz/zoneinfo/Africa/Kinshasa.py -lib/pytz/zoneinfo/Africa/Lagos.py -lib/pytz/zoneinfo/Africa/Libreville.py -lib/pytz/zoneinfo/Africa/Lome.py -lib/pytz/zoneinfo/Africa/Luanda.py -lib/pytz/zoneinfo/Africa/Lubumbashi.py -lib/pytz/zoneinfo/Africa/Lusaka.py -lib/pytz/zoneinfo/Africa/Malabo.py -lib/pytz/zoneinfo/Africa/Maputo.py -lib/pytz/zoneinfo/Africa/Maseru.py -lib/pytz/zoneinfo/Africa/Mbabane.py -lib/pytz/zoneinfo/Africa/Mogadishu.py -lib/pytz/zoneinfo/Africa/Monrovia.py -lib/pytz/zoneinfo/Africa/Nairobi.py -lib/pytz/zoneinfo/Africa/Ndjamena.py -lib/pytz/zoneinfo/Africa/Niamey.py -lib/pytz/zoneinfo/Africa/Nouakchott.py -lib/pytz/zoneinfo/Africa/Ouagadougou.py -lib/pytz/zoneinfo/Africa/Porto_minus_Novo.py -lib/pytz/zoneinfo/Africa/Sao_Tome.py -lib/pytz/zoneinfo/Africa/Timbuktu.py -lib/pytz/zoneinfo/Africa/Tripoli.py -lib/pytz/zoneinfo/Africa/Tunis.py -lib/pytz/zoneinfo/Africa/Windhoek.py -lib/pytz/zoneinfo/Africa/__init__.py -lib/pytz/zoneinfo/America/Adak.py -lib/pytz/zoneinfo/America/Anchorage.py -lib/pytz/zoneinfo/America/Anguilla.py -lib/pytz/zoneinfo/America/Antigua.py -lib/pytz/zoneinfo/America/Araguaina.py -lib/pytz/zoneinfo/America/Aruba.py -lib/pytz/zoneinfo/America/Asuncion.py -lib/pytz/zoneinfo/America/Atka.py -lib/pytz/zoneinfo/America/Bahia.py -lib/pytz/zoneinfo/America/Barbados.py -lib/pytz/zoneinfo/America/Belem.py -lib/pytz/zoneinfo/America/Belize.py -lib/pytz/zoneinfo/America/Boa_Vista.py -lib/pytz/zoneinfo/America/Bogota.py -lib/pytz/zoneinfo/America/Boise.py -lib/pytz/zoneinfo/America/Buenos_Aires.py -lib/pytz/zoneinfo/America/Cambridge_Bay.py -lib/pytz/zoneinfo/America/Campo_Grande.py -lib/pytz/zoneinfo/America/Cancun.py -lib/pytz/zoneinfo/America/Caracas.py -lib/pytz/zoneinfo/America/Catamarca.py -lib/pytz/zoneinfo/America/Cayenne.py -lib/pytz/zoneinfo/America/Cayman.py -lib/pytz/zoneinfo/America/Chicago.py -lib/pytz/zoneinfo/America/Chihuahua.py -lib/pytz/zoneinfo/America/Cordoba.py -lib/pytz/zoneinfo/America/Costa_Rica.py -lib/pytz/zoneinfo/America/Cuiaba.py -lib/pytz/zoneinfo/America/Curacao.py -lib/pytz/zoneinfo/America/Danmarkshavn.py -lib/pytz/zoneinfo/America/Dawson.py -lib/pytz/zoneinfo/America/Dawson_Creek.py -lib/pytz/zoneinfo/America/Denver.py -lib/pytz/zoneinfo/America/Detroit.py -lib/pytz/zoneinfo/America/Dominica.py -lib/pytz/zoneinfo/America/Edmonton.py -lib/pytz/zoneinfo/America/Eirunepe.py -lib/pytz/zoneinfo/America/El_Salvador.py -lib/pytz/zoneinfo/America/Ensenada.py -lib/pytz/zoneinfo/America/Fort_Wayne.py -lib/pytz/zoneinfo/America/Fortaleza.py -lib/pytz/zoneinfo/America/Glace_Bay.py -lib/pytz/zoneinfo/America/Godthab.py -lib/pytz/zoneinfo/America/Goose_Bay.py -lib/pytz/zoneinfo/America/Grand_Turk.py -lib/pytz/zoneinfo/America/Grenada.py -lib/pytz/zoneinfo/America/Guadeloupe.py -lib/pytz/zoneinfo/America/Guatemala.py -lib/pytz/zoneinfo/America/Guayaquil.py -lib/pytz/zoneinfo/America/Guyana.py -lib/pytz/zoneinfo/America/Halifax.py -lib/pytz/zoneinfo/America/Havana.py -lib/pytz/zoneinfo/America/Hermosillo.py -lib/pytz/zoneinfo/America/Indianapolis.py -lib/pytz/zoneinfo/America/Inuvik.py -lib/pytz/zoneinfo/America/Iqaluit.py -lib/pytz/zoneinfo/America/Jamaica.py -lib/pytz/zoneinfo/America/Jujuy.py -lib/pytz/zoneinfo/America/Juneau.py -lib/pytz/zoneinfo/America/Knox_IN.py -lib/pytz/zoneinfo/America/La_Paz.py -lib/pytz/zoneinfo/America/Lima.py -lib/pytz/zoneinfo/America/Los_Angeles.py -lib/pytz/zoneinfo/America/Louisville.py -lib/pytz/zoneinfo/America/Maceio.py -lib/pytz/zoneinfo/America/Managua.py -lib/pytz/zoneinfo/America/Manaus.py -lib/pytz/zoneinfo/America/Martinique.py -lib/pytz/zoneinfo/America/Mazatlan.py -lib/pytz/zoneinfo/America/Mendoza.py -lib/pytz/zoneinfo/America/Menominee.py -lib/pytz/zoneinfo/America/Merida.py -lib/pytz/zoneinfo/America/Mexico_City.py -lib/pytz/zoneinfo/America/Miquelon.py -lib/pytz/zoneinfo/America/Monterrey.py -lib/pytz/zoneinfo/America/Montevideo.py -lib/pytz/zoneinfo/America/Montreal.py -lib/pytz/zoneinfo/America/Montserrat.py -lib/pytz/zoneinfo/America/Nassau.py -lib/pytz/zoneinfo/America/New_York.py -lib/pytz/zoneinfo/America/Nipigon.py -lib/pytz/zoneinfo/America/Nome.py -lib/pytz/zoneinfo/America/Noronha.py -lib/pytz/zoneinfo/America/Panama.py -lib/pytz/zoneinfo/America/Pangnirtung.py -lib/pytz/zoneinfo/America/Paramaribo.py -lib/pytz/zoneinfo/America/Phoenix.py -lib/pytz/zoneinfo/America/Port_minus_au_minus_Prince.py -lib/pytz/zoneinfo/America/Port_of_Spain.py -lib/pytz/zoneinfo/America/Porto_Acre.py -lib/pytz/zoneinfo/America/Porto_Velho.py -lib/pytz/zoneinfo/America/Puerto_Rico.py -lib/pytz/zoneinfo/America/Rainy_River.py -lib/pytz/zoneinfo/America/Rankin_Inlet.py -lib/pytz/zoneinfo/America/Recife.py -lib/pytz/zoneinfo/America/Regina.py -lib/pytz/zoneinfo/America/Rio_Branco.py -lib/pytz/zoneinfo/America/Rosario.py -lib/pytz/zoneinfo/America/Santiago.py -lib/pytz/zoneinfo/America/Santo_Domingo.py -lib/pytz/zoneinfo/America/Sao_Paulo.py -lib/pytz/zoneinfo/America/Scoresbysund.py -lib/pytz/zoneinfo/America/Shiprock.py -lib/pytz/zoneinfo/America/St_Johns.py -lib/pytz/zoneinfo/America/St_Kitts.py -lib/pytz/zoneinfo/America/St_Lucia.py -lib/pytz/zoneinfo/America/St_Thomas.py -lib/pytz/zoneinfo/America/St_Vincent.py -lib/pytz/zoneinfo/America/Swift_Current.py -lib/pytz/zoneinfo/America/Tegucigalpa.py -lib/pytz/zoneinfo/America/Thule.py -lib/pytz/zoneinfo/America/Thunder_Bay.py -lib/pytz/zoneinfo/America/Tijuana.py -lib/pytz/zoneinfo/America/Toronto.py -lib/pytz/zoneinfo/America/Tortola.py -lib/pytz/zoneinfo/America/Vancouver.py -lib/pytz/zoneinfo/America/Virgin.py -lib/pytz/zoneinfo/America/Whitehorse.py -lib/pytz/zoneinfo/America/Winnipeg.py -lib/pytz/zoneinfo/America/Yakutat.py -lib/pytz/zoneinfo/America/Yellowknife.py -lib/pytz/zoneinfo/America/__init__.py -lib/pytz/zoneinfo/America/Argentina/Buenos_Aires.py -lib/pytz/zoneinfo/America/Argentina/Catamarca.py -lib/pytz/zoneinfo/America/Argentina/ComodRivadavia.py -lib/pytz/zoneinfo/America/Argentina/Cordoba.py -lib/pytz/zoneinfo/America/Argentina/Jujuy.py -lib/pytz/zoneinfo/America/Argentina/La_Rioja.py -lib/pytz/zoneinfo/America/Argentina/Mendoza.py -lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos.py -lib/pytz/zoneinfo/America/Argentina/San_Juan.py -lib/pytz/zoneinfo/America/Argentina/Tucuman.py -lib/pytz/zoneinfo/America/Argentina/Ushuaia.py -lib/pytz/zoneinfo/America/Argentina/__init__.py -lib/pytz/zoneinfo/America/Indiana/Indianapolis.py -lib/pytz/zoneinfo/America/Indiana/Knox.py -lib/pytz/zoneinfo/America/Indiana/Marengo.py -lib/pytz/zoneinfo/America/Indiana/Vevay.py -lib/pytz/zoneinfo/America/Indiana/__init__.py -lib/pytz/zoneinfo/America/Kentucky/Louisville.py -lib/pytz/zoneinfo/America/Kentucky/Monticello.py -lib/pytz/zoneinfo/America/Kentucky/__init__.py -lib/pytz/zoneinfo/America/North_Dakota/Center.py -lib/pytz/zoneinfo/America/North_Dakota/__init__.py -lib/pytz/zoneinfo/Antarctica/Casey.py -lib/pytz/zoneinfo/Antarctica/Davis.py -lib/pytz/zoneinfo/Antarctica/DumontDUrville.py -lib/pytz/zoneinfo/Antarctica/Mawson.py -lib/pytz/zoneinfo/Antarctica/McMurdo.py -lib/pytz/zoneinfo/Antarctica/Palmer.py -lib/pytz/zoneinfo/Antarctica/Rothera.py -lib/pytz/zoneinfo/Antarctica/South_Pole.py -lib/pytz/zoneinfo/Antarctica/Syowa.py -lib/pytz/zoneinfo/Antarctica/Vostok.py -lib/pytz/zoneinfo/Antarctica/__init__.py -lib/pytz/zoneinfo/Arctic/Longyearbyen.py -lib/pytz/zoneinfo/Arctic/__init__.py -lib/pytz/zoneinfo/Asia/Aden.py -lib/pytz/zoneinfo/Asia/Almaty.py -lib/pytz/zoneinfo/Asia/Amman.py -lib/pytz/zoneinfo/Asia/Anadyr.py -lib/pytz/zoneinfo/Asia/Aqtau.py -lib/pytz/zoneinfo/Asia/Aqtobe.py -lib/pytz/zoneinfo/Asia/Ashgabat.py -lib/pytz/zoneinfo/Asia/Ashkhabad.py -lib/pytz/zoneinfo/Asia/Baghdad.py -lib/pytz/zoneinfo/Asia/Bahrain.py -lib/pytz/zoneinfo/Asia/Baku.py -lib/pytz/zoneinfo/Asia/Bangkok.py -lib/pytz/zoneinfo/Asia/Beirut.py -lib/pytz/zoneinfo/Asia/Bishkek.py -lib/pytz/zoneinfo/Asia/Brunei.py -lib/pytz/zoneinfo/Asia/Calcutta.py -lib/pytz/zoneinfo/Asia/Choibalsan.py -lib/pytz/zoneinfo/Asia/Chongqing.py -lib/pytz/zoneinfo/Asia/Chungking.py -lib/pytz/zoneinfo/Asia/Colombo.py -lib/pytz/zoneinfo/Asia/Dacca.py -lib/pytz/zoneinfo/Asia/Damascus.py -lib/pytz/zoneinfo/Asia/Dhaka.py -lib/pytz/zoneinfo/Asia/Dili.py -lib/pytz/zoneinfo/Asia/Dubai.py -lib/pytz/zoneinfo/Asia/Dushanbe.py -lib/pytz/zoneinfo/Asia/Gaza.py -lib/pytz/zoneinfo/Asia/Harbin.py -lib/pytz/zoneinfo/Asia/Hong_Kong.py -lib/pytz/zoneinfo/Asia/Hovd.py -lib/pytz/zoneinfo/Asia/Irkutsk.py -lib/pytz/zoneinfo/Asia/Istanbul.py -lib/pytz/zoneinfo/Asia/Jakarta.py -lib/pytz/zoneinfo/Asia/Jayapura.py -lib/pytz/zoneinfo/Asia/Jerusalem.py -lib/pytz/zoneinfo/Asia/Kabul.py -lib/pytz/zoneinfo/Asia/Kamchatka.py -lib/pytz/zoneinfo/Asia/Karachi.py -lib/pytz/zoneinfo/Asia/Kashgar.py -lib/pytz/zoneinfo/Asia/Katmandu.py -lib/pytz/zoneinfo/Asia/Krasnoyarsk.py -lib/pytz/zoneinfo/Asia/Kuala_Lumpur.py -lib/pytz/zoneinfo/Asia/Kuching.py -lib/pytz/zoneinfo/Asia/Kuwait.py -lib/pytz/zoneinfo/Asia/Macao.py -lib/pytz/zoneinfo/Asia/Macau.py -lib/pytz/zoneinfo/Asia/Magadan.py -lib/pytz/zoneinfo/Asia/Makassar.py -lib/pytz/zoneinfo/Asia/Manila.py -lib/pytz/zoneinfo/Asia/Muscat.py -lib/pytz/zoneinfo/Asia/Nicosia.py -lib/pytz/zoneinfo/Asia/Novosibirsk.py -lib/pytz/zoneinfo/Asia/Omsk.py -lib/pytz/zoneinfo/Asia/Oral.py -lib/pytz/zoneinfo/Asia/Phnom_Penh.py -lib/pytz/zoneinfo/Asia/Pontianak.py -lib/pytz/zoneinfo/Asia/Pyongyang.py -lib/pytz/zoneinfo/Asia/Qatar.py -lib/pytz/zoneinfo/Asia/Qyzylorda.py -lib/pytz/zoneinfo/Asia/Rangoon.py -lib/pytz/zoneinfo/Asia/Riyadh.py -lib/pytz/zoneinfo/Asia/Saigon.py -lib/pytz/zoneinfo/Asia/Sakhalin.py -lib/pytz/zoneinfo/Asia/Samarkand.py -lib/pytz/zoneinfo/Asia/Seoul.py -lib/pytz/zoneinfo/Asia/Shanghai.py -lib/pytz/zoneinfo/Asia/Singapore.py -lib/pytz/zoneinfo/Asia/Taipei.py -lib/pytz/zoneinfo/Asia/Tashkent.py -lib/pytz/zoneinfo/Asia/Tbilisi.py -lib/pytz/zoneinfo/Asia/Tehran.py -lib/pytz/zoneinfo/Asia/Tel_Aviv.py -lib/pytz/zoneinfo/Asia/Thimbu.py -lib/pytz/zoneinfo/Asia/Thimphu.py -lib/pytz/zoneinfo/Asia/Tokyo.py -lib/pytz/zoneinfo/Asia/Ujung_Pandang.py -lib/pytz/zoneinfo/Asia/Ulaanbaatar.py -lib/pytz/zoneinfo/Asia/Ulan_Bator.py -lib/pytz/zoneinfo/Asia/Urumqi.py -lib/pytz/zoneinfo/Asia/Vientiane.py -lib/pytz/zoneinfo/Asia/Vladivostok.py -lib/pytz/zoneinfo/Asia/Yakutsk.py -lib/pytz/zoneinfo/Asia/Yekaterinburg.py -lib/pytz/zoneinfo/Asia/Yerevan.py -lib/pytz/zoneinfo/Asia/__init__.py -lib/pytz/zoneinfo/Atlantic/Azores.py -lib/pytz/zoneinfo/Atlantic/Bermuda.py -lib/pytz/zoneinfo/Atlantic/Canary.py -lib/pytz/zoneinfo/Atlantic/Cape_Verde.py -lib/pytz/zoneinfo/Atlantic/Faeroe.py -lib/pytz/zoneinfo/Atlantic/Jan_Mayen.py -lib/pytz/zoneinfo/Atlantic/Madeira.py -lib/pytz/zoneinfo/Atlantic/Reykjavik.py -lib/pytz/zoneinfo/Atlantic/South_Georgia.py -lib/pytz/zoneinfo/Atlantic/St_Helena.py -lib/pytz/zoneinfo/Atlantic/Stanley.py -lib/pytz/zoneinfo/Atlantic/__init__.py -lib/pytz/zoneinfo/Australia/ACT.py -lib/pytz/zoneinfo/Australia/Adelaide.py -lib/pytz/zoneinfo/Australia/Brisbane.py -lib/pytz/zoneinfo/Australia/Broken_Hill.py -lib/pytz/zoneinfo/Australia/Canberra.py -lib/pytz/zoneinfo/Australia/Darwin.py -lib/pytz/zoneinfo/Australia/Hobart.py -lib/pytz/zoneinfo/Australia/LHI.py -lib/pytz/zoneinfo/Australia/Lindeman.py -lib/pytz/zoneinfo/Australia/Lord_Howe.py -lib/pytz/zoneinfo/Australia/Melbourne.py -lib/pytz/zoneinfo/Australia/NSW.py -lib/pytz/zoneinfo/Australia/North.py -lib/pytz/zoneinfo/Australia/Perth.py -lib/pytz/zoneinfo/Australia/Queensland.py -lib/pytz/zoneinfo/Australia/South.py -lib/pytz/zoneinfo/Australia/Sydney.py -lib/pytz/zoneinfo/Australia/Tasmania.py -lib/pytz/zoneinfo/Australia/Victoria.py -lib/pytz/zoneinfo/Australia/West.py -lib/pytz/zoneinfo/Australia/Yancowinna.py -lib/pytz/zoneinfo/Australia/__init__.py -lib/pytz/zoneinfo/Brazil/Acre.py -lib/pytz/zoneinfo/Brazil/DeNoronha.py -lib/pytz/zoneinfo/Brazil/East.py -lib/pytz/zoneinfo/Brazil/West.py -lib/pytz/zoneinfo/Brazil/__init__.py -lib/pytz/zoneinfo/Canada/Atlantic.py -lib/pytz/zoneinfo/Canada/Central.py -lib/pytz/zoneinfo/Canada/East_minus_Saskatchewan.py -lib/pytz/zoneinfo/Canada/Eastern.py -lib/pytz/zoneinfo/Canada/Mountain.py -lib/pytz/zoneinfo/Canada/Newfoundland.py -lib/pytz/zoneinfo/Canada/Pacific.py -lib/pytz/zoneinfo/Canada/Saskatchewan.py -lib/pytz/zoneinfo/Canada/Yukon.py -lib/pytz/zoneinfo/Canada/__init__.py -lib/pytz/zoneinfo/Chile/Continental.py -lib/pytz/zoneinfo/Chile/EasterIsland.py -lib/pytz/zoneinfo/Chile/__init__.py -lib/pytz/zoneinfo/Etc/GMT.py -lib/pytz/zoneinfo/Etc/GMT0.py -lib/pytz/zoneinfo/Etc/GMT_minus_0.py -lib/pytz/zoneinfo/Etc/GMT_minus_1.py -lib/pytz/zoneinfo/Etc/GMT_minus_10.py -lib/pytz/zoneinfo/Etc/GMT_minus_11.py -lib/pytz/zoneinfo/Etc/GMT_minus_12.py -lib/pytz/zoneinfo/Etc/GMT_minus_13.py -lib/pytz/zoneinfo/Etc/GMT_minus_14.py -lib/pytz/zoneinfo/Etc/GMT_minus_2.py -lib/pytz/zoneinfo/Etc/GMT_minus_3.py -lib/pytz/zoneinfo/Etc/GMT_minus_4.py -lib/pytz/zoneinfo/Etc/GMT_minus_5.py -lib/pytz/zoneinfo/Etc/GMT_minus_6.py -lib/pytz/zoneinfo/Etc/GMT_minus_7.py -lib/pytz/zoneinfo/Etc/GMT_minus_8.py -lib/pytz/zoneinfo/Etc/GMT_minus_9.py -lib/pytz/zoneinfo/Etc/GMT_plus_0.py -lib/pytz/zoneinfo/Etc/GMT_plus_1.py -lib/pytz/zoneinfo/Etc/GMT_plus_10.py -lib/pytz/zoneinfo/Etc/GMT_plus_11.py -lib/pytz/zoneinfo/Etc/GMT_plus_12.py -lib/pytz/zoneinfo/Etc/GMT_plus_2.py -lib/pytz/zoneinfo/Etc/GMT_plus_3.py -lib/pytz/zoneinfo/Etc/GMT_plus_4.py -lib/pytz/zoneinfo/Etc/GMT_plus_5.py -lib/pytz/zoneinfo/Etc/GMT_plus_6.py -lib/pytz/zoneinfo/Etc/GMT_plus_7.py -lib/pytz/zoneinfo/Etc/GMT_plus_8.py -lib/pytz/zoneinfo/Etc/GMT_plus_9.py -lib/pytz/zoneinfo/Etc/Greenwich.py -lib/pytz/zoneinfo/Etc/UCT.py -lib/pytz/zoneinfo/Etc/UTC.py -lib/pytz/zoneinfo/Etc/Universal.py -lib/pytz/zoneinfo/Etc/Zulu.py -lib/pytz/zoneinfo/Etc/__init__.py -lib/pytz/zoneinfo/Europe/Amsterdam.py -lib/pytz/zoneinfo/Europe/Andorra.py -lib/pytz/zoneinfo/Europe/Athens.py -lib/pytz/zoneinfo/Europe/Belfast.py -lib/pytz/zoneinfo/Europe/Belgrade.py -lib/pytz/zoneinfo/Europe/Berlin.py -lib/pytz/zoneinfo/Europe/Bratislava.py -lib/pytz/zoneinfo/Europe/Brussels.py -lib/pytz/zoneinfo/Europe/Bucharest.py -lib/pytz/zoneinfo/Europe/Budapest.py -lib/pytz/zoneinfo/Europe/Chisinau.py -lib/pytz/zoneinfo/Europe/Copenhagen.py -lib/pytz/zoneinfo/Europe/Dublin.py -lib/pytz/zoneinfo/Europe/Gibraltar.py -lib/pytz/zoneinfo/Europe/Helsinki.py -lib/pytz/zoneinfo/Europe/Istanbul.py -lib/pytz/zoneinfo/Europe/Kaliningrad.py -lib/pytz/zoneinfo/Europe/Kiev.py -lib/pytz/zoneinfo/Europe/Lisbon.py -lib/pytz/zoneinfo/Europe/Ljubljana.py -lib/pytz/zoneinfo/Europe/London.py -lib/pytz/zoneinfo/Europe/Luxembourg.py -lib/pytz/zoneinfo/Europe/Madrid.py -lib/pytz/zoneinfo/Europe/Malta.py -lib/pytz/zoneinfo/Europe/Mariehamn.py -lib/pytz/zoneinfo/Europe/Minsk.py -lib/pytz/zoneinfo/Europe/Monaco.py -lib/pytz/zoneinfo/Europe/Moscow.py -lib/pytz/zoneinfo/Europe/Nicosia.py -lib/pytz/zoneinfo/Europe/Oslo.py -lib/pytz/zoneinfo/Europe/Paris.py -lib/pytz/zoneinfo/Europe/Prague.py -lib/pytz/zoneinfo/Europe/Riga.py -lib/pytz/zoneinfo/Europe/Rome.py -lib/pytz/zoneinfo/Europe/Samara.py -lib/pytz/zoneinfo/Europe/San_Marino.py -lib/pytz/zoneinfo/Europe/Sarajevo.py -lib/pytz/zoneinfo/Europe/Simferopol.py -lib/pytz/zoneinfo/Europe/Skopje.py -lib/pytz/zoneinfo/Europe/Sofia.py -lib/pytz/zoneinfo/Europe/Stockholm.py -lib/pytz/zoneinfo/Europe/Tallinn.py -lib/pytz/zoneinfo/Europe/Tirane.py -lib/pytz/zoneinfo/Europe/Tiraspol.py -lib/pytz/zoneinfo/Europe/Uzhgorod.py -lib/pytz/zoneinfo/Europe/Vaduz.py -lib/pytz/zoneinfo/Europe/Vatican.py -lib/pytz/zoneinfo/Europe/Vienna.py -lib/pytz/zoneinfo/Europe/Vilnius.py -lib/pytz/zoneinfo/Europe/Warsaw.py -lib/pytz/zoneinfo/Europe/Zagreb.py -lib/pytz/zoneinfo/Europe/Zaporozhye.py -lib/pytz/zoneinfo/Europe/Zurich.py -lib/pytz/zoneinfo/Europe/__init__.py -lib/pytz/zoneinfo/Indian/Antananarivo.py -lib/pytz/zoneinfo/Indian/Chagos.py -lib/pytz/zoneinfo/Indian/Christmas.py -lib/pytz/zoneinfo/Indian/Cocos.py -lib/pytz/zoneinfo/Indian/Comoro.py -lib/pytz/zoneinfo/Indian/Kerguelen.py -lib/pytz/zoneinfo/Indian/Mahe.py -lib/pytz/zoneinfo/Indian/Maldives.py -lib/pytz/zoneinfo/Indian/Mauritius.py -lib/pytz/zoneinfo/Indian/Mayotte.py -lib/pytz/zoneinfo/Indian/Reunion.py -lib/pytz/zoneinfo/Indian/__init__.py -lib/pytz/zoneinfo/Mexico/BajaNorte.py -lib/pytz/zoneinfo/Mexico/BajaSur.py -lib/pytz/zoneinfo/Mexico/General.py -lib/pytz/zoneinfo/Mexico/__init__.py -lib/pytz/zoneinfo/Pacific/Apia.py -lib/pytz/zoneinfo/Pacific/Auckland.py -lib/pytz/zoneinfo/Pacific/Chatham.py -lib/pytz/zoneinfo/Pacific/Easter.py -lib/pytz/zoneinfo/Pacific/Efate.py -lib/pytz/zoneinfo/Pacific/Enderbury.py -lib/pytz/zoneinfo/Pacific/Fakaofo.py -lib/pytz/zoneinfo/Pacific/Fiji.py -lib/pytz/zoneinfo/Pacific/Funafuti.py -lib/pytz/zoneinfo/Pacific/Galapagos.py -lib/pytz/zoneinfo/Pacific/Gambier.py -lib/pytz/zoneinfo/Pacific/Guadalcanal.py -lib/pytz/zoneinfo/Pacific/Guam.py -lib/pytz/zoneinfo/Pacific/Honolulu.py -lib/pytz/zoneinfo/Pacific/Johnston.py -lib/pytz/zoneinfo/Pacific/Kiritimati.py -lib/pytz/zoneinfo/Pacific/Kosrae.py -lib/pytz/zoneinfo/Pacific/Kwajalein.py -lib/pytz/zoneinfo/Pacific/Majuro.py -lib/pytz/zoneinfo/Pacific/Marquesas.py -lib/pytz/zoneinfo/Pacific/Midway.py -lib/pytz/zoneinfo/Pacific/Nauru.py -lib/pytz/zoneinfo/Pacific/Niue.py -lib/pytz/zoneinfo/Pacific/Norfolk.py -lib/pytz/zoneinfo/Pacific/Noumea.py -lib/pytz/zoneinfo/Pacific/Pago_Pago.py -lib/pytz/zoneinfo/Pacific/Palau.py -lib/pytz/zoneinfo/Pacific/Pitcairn.py -lib/pytz/zoneinfo/Pacific/Ponape.py -lib/pytz/zoneinfo/Pacific/Port_Moresby.py -lib/pytz/zoneinfo/Pacific/Rarotonga.py -lib/pytz/zoneinfo/Pacific/Saipan.py -lib/pytz/zoneinfo/Pacific/Samoa.py -lib/pytz/zoneinfo/Pacific/Tahiti.py -lib/pytz/zoneinfo/Pacific/Tarawa.py -lib/pytz/zoneinfo/Pacific/Tongatapu.py -lib/pytz/zoneinfo/Pacific/Truk.py -lib/pytz/zoneinfo/Pacific/Wake.py -lib/pytz/zoneinfo/Pacific/Wallis.py -lib/pytz/zoneinfo/Pacific/Yap.py -lib/pytz/zoneinfo/Pacific/__init__.py -lib/pytz/zoneinfo/SystemV/AST4.py -lib/pytz/zoneinfo/SystemV/AST4ADT.py -lib/pytz/zoneinfo/SystemV/CST6.py -lib/pytz/zoneinfo/SystemV/CST6CDT.py -lib/pytz/zoneinfo/SystemV/EST5.py -lib/pytz/zoneinfo/SystemV/EST5EDT.py -lib/pytz/zoneinfo/SystemV/HST10.py -lib/pytz/zoneinfo/SystemV/MST7.py -lib/pytz/zoneinfo/SystemV/MST7MDT.py -lib/pytz/zoneinfo/SystemV/PST8.py -lib/pytz/zoneinfo/SystemV/PST8PDT.py -lib/pytz/zoneinfo/SystemV/YST9.py -lib/pytz/zoneinfo/SystemV/YST9YDT.py -lib/pytz/zoneinfo/SystemV/__init__.py -lib/pytz/zoneinfo/US/Alaska.py -lib/pytz/zoneinfo/US/Aleutian.py -lib/pytz/zoneinfo/US/Arizona.py -lib/pytz/zoneinfo/US/Central.py -lib/pytz/zoneinfo/US/East_minus_Indiana.py -lib/pytz/zoneinfo/US/Eastern.py -lib/pytz/zoneinfo/US/Hawaii.py -lib/pytz/zoneinfo/US/Indiana_minus_Starke.py -lib/pytz/zoneinfo/US/Michigan.py -lib/pytz/zoneinfo/US/Mountain.py -lib/pytz/zoneinfo/US/Pacific.py -lib/pytz/zoneinfo/US/Pacific_minus_New.py -lib/pytz/zoneinfo/US/Samoa.py -lib/pytz/zoneinfo/US/__init__.py -lib/subprocess/__init__.py -lib/subprocess/subprocess.py -license/DATEUTIL_LICENSE.txt -license/LICENSE -license/LICENSE_BAKOMA -license/LICENSE_COLORBREWER -license/LICENSE_PAINT -license/LICENSE_PIL -license/LICENSE_YORICK -license/LICENSE_enthought.txt -license/PYTZ_LICENSE.txt -src/MPL_isnan.h -src/_backend_agg.cpp -src/_backend_agg.h -src/_backend_gdk.c -src/_gtkagg.cpp -src/_image.cpp -src/_image.h -src/_isnan.c -src/_na_backend_agg.cpp -src/_na_backend_gdk.c -src/_na_cntr.c -src/_na_image.cpp -src/_na_nxutils.c -src/_na_transforms.cpp -src/_nc_backend_agg.cpp -src/_nc_backend_gdk.c -src/_nc_cntr.c -src/_nc_image.cpp -src/_nc_nxutils.c -src/_nc_transforms.cpp -src/_ns_backend_agg.cpp -src/_ns_backend_gdk.c -src/_ns_cntr.c -src/_ns_image.cpp -src/_ns_nxutils.c -src/_ns_transforms.cpp -src/_subprocess.c -src/_tkagg.cpp -src/_transforms.cpp -src/_transforms.h -src/_windowing.cpp -src/_wxagg.cpp -src/agg.cxx -src/cntr.c -src/ft2font.cpp -src/ft2font.h -src/mplutils.cpp -src/mplutils.h -src/numerix.h -src/nxutils.c -src/swig_runtime.h -swig/agg.i -swig/agg_basics.i -swig/agg_buffer.h -swig/agg_conv_curve.i -swig/agg_conv_stroke.i -swig/agg_conv_transform.i -swig/agg_path_storage.i -swig/agg_rasterizer_scanline_aa.i -swig/agg_renderer_base.i -swig/agg_renderer_scanline.i -swig/agg_scanline_bin.i -swig/agg_span_image_filter.i -swig/agg_trans_affine.i -swig/agg_typedefs.h -swig/agg_typemaps.i Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -1209,6 +1209,14 @@ def get_default_filetype(self): raise NotImplementedError + def set_window_title(self, title): + """ + Set the title text of the window containing the figure. Note that + this has no effect if there is no window (eg, a PS backend). + """ + if hasattr(self, "manager"): + self.manager.set_window_title(title) + def switch_backends(self, FigureCanvasClass): """ instantiate an instance of FigureCanvasClass @@ -1321,6 +1329,13 @@ """ pass + def set_window_title(self, title): + """ + Set the title text of the window containing the figure. Note that + this has no effect if there is no window (eg, a PS backend). + """ + pass + # cursors class Cursors: #namespace HAND, POINTER, SELECT_REGION, MOVE = range(4) Modified: branches/transforms/lib/matplotlib/backends/backend_fltkagg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_fltkagg.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_fltkagg.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -299,6 +299,9 @@ self.canvas.draw() self.window.redraw() + def set_window_title(self, title): + self.window_title=title + self.window.label(title) class AxisMenu: def __init__(self, toolbar): Modified: branches/transforms/lib/matplotlib/backends/backend_gtk.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_gtk.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -460,6 +460,8 @@ toolbar = None return toolbar + def set_window_title(self, title): + self.window.set_title(title) def resize(self, width, height): 'set the canvas size in pixels' Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -491,6 +491,7 @@ return fontdictObject def embedType1(self, filename, fontinfo): + # TODO: font effects such as SlantFont fh = open(filename, 'rb') matplotlib.verbose.report( 'Embedding Type 1 font ' + filename, 'debug') @@ -520,8 +521,15 @@ if fontinfo.encodingfile is not None: enc = dviread.Encoding(fontinfo.encodingfile) - widths = [ afmdata.get_width_from_char_name(ch) - for ch in enc ] + widths = [] + for ch in enc: + try: + widths.append(afmdata.get_width_from_char_name(ch)) + except KeyError: + matplotlib.verbose.report( + 'No width for %s in %s' % (ch, fullname), 'debug') + widths.append(0) + differencesArray = [ Name(ch) for ch in enc ] differencesArray = [ 0 ] + differencesArray firstchar = 0 @@ -538,11 +546,24 @@ firstchar = not_None.next() lastchar = max(not_None) widths = widths[firstchar:lastchar+1] + for i,w in enumerate(widths): + if w is None: widths[i] = 0 - differencesArray = [ firstchar ] + differencesArray = [ ] + need_idx = True for ch in range(firstchar, lastchar+1): - differencesArray.append(Name( - afmdata.get_name_char(ch, isord=True))) + try: + name = afmdata.get_name_char(ch, isord=True) + if need_idx: + differencesArray.append(ch) + need_idx = False + differencesArray.append(Name(name)) + except KeyError: + matplotlib.verbose.report( + 'No name for glyph %d in %s' % (ch, fullname), + 'debug') + need_idx = True + fontdict = { 'Type': Name('Font'), @@ -1448,17 +1469,16 @@ # Gather font information and do some setup for combining # characters into strings. - oldfontnum, seq = None, [] - for x1, y1, fontnum, glyph, width in page.text: - if fontnum != oldfontnum: - texname, fontsize = dvi.fontinfo(fontnum) - fontinfo = self.tex_font_mapping(texname) + oldfont, seq = None, [] + for x1, y1, dvifont, glyph, width in page.text: + if dvifont != oldfont: + fontinfo = self.tex_font_mapping(dvifont.texname) pdfname = self.file.fontName(fontinfo.filename) self.file.fontInfo[pdfname] = Bunch( encodingfile=fontinfo.encoding, afmfile=fontinfo.afm) - seq += [['font', pdfname, fontsize]] - oldfontnum = fontnum + seq += [['font', pdfname, dvifont.size]] + oldfont = dvifont seq += [['text', x1, y1, [chr(glyph)], x1+width]] seq += [('end',)] Modified: branches/transforms/lib/matplotlib/backends/backend_qt.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_qt.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -247,6 +247,9 @@ if DEBUG: print "destroy figure manager" self.window.close(True) + def set_window_title(self, title): + self.window.setCaption(title) + class NavigationToolbar2QT( NavigationToolbar2, qt.QWidget ): # list of toolitems to add to the toolbar, format is: # text, tooltip_text, image_file, callback(str) Modified: branches/transforms/lib/matplotlib/backends/backend_qt4.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_qt4.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -249,6 +249,9 @@ if DEBUG: print "destroy figure manager" self.window.close() + def set_window_title(self, title): + self.window.setWindowTitle(title) + class NavigationToolbar2QT( NavigationToolbar2, QtGui.QWidget ): # list of toolitems to add to the toolbar, format is: # text, tooltip_text, image_file, callback(str) Modified: branches/transforms/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -350,6 +350,9 @@ pass self.window = None + def set_window_title(self, title): + self.window.wm_title(title) + class AxisMenu: def __init__(self, master, naxes): self._master = master Modified: branches/transforms/lib/matplotlib/backends/backend_wx.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/backends/backend_wx.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -1399,6 +1399,9 @@ #wx.GetApp().ProcessIdle() wx.WakeUpIdle() + def set_window_title(self, title): + self.window.SetTitle(title) + # Identifiers for toolbar controls - images_wx contains bitmaps for the images # used in the controls. wxWindows does not provide any stock images, so I've # 'stolen' those from GTK2, and transformed them into the appropriate format. Modified: branches/transforms/lib/matplotlib/dviread.py =================================================================== --- branches/transforms/lib/matplotlib/dviread.py 2007-09-12 13:36:25 UTC (rev 3835) +++ branches/transforms/lib/matplotlib/dviread.py 2007-09-12 14:05:20 UTC (rev 3836) @@ -9,15 +9,13 @@ for page in dvi: # iterate over pages w, h, d = page.width, page.height, page.descent for x,y,font,glyph,width in page.text: - fontname, pointsize = dvi.fontinfo(font) + fontname = font.texname + pointsize = font.size ... for x,y,height,width in page.boxes: ... """ -# TODO: support TeX virtual fonts (*.vf) which... [truncated message content] |
From: <md...@us...> - 2007-09-12 13:36:31
|
Revision: 3835 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3835&view=rev Author: mdboom Date: 2007-09-12 06:36:25 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Second pass, using a stateful transform tree. Modified Paths: -------------- branches/transforms/lib/matplotlib/affine.py branches/transforms/lib/matplotlib/artist.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/backends/backend_tkagg.py branches/transforms/lib/matplotlib/figure.py branches/transforms/lib/matplotlib/legend.py branches/transforms/lib/matplotlib/lines.py branches/transforms/lib/matplotlib/table.py branches/transforms/lib/matplotlib/text.py branches/transforms/lib/matplotlib/ticker.py Removed Paths: ------------- branches/transforms/lib/matplotlib/bbox.py Modified: branches/transforms/lib/matplotlib/affine.py =================================================================== --- branches/transforms/lib/matplotlib/affine.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/affine.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -6,19 +6,203 @@ import numpy as N from numpy.linalg import inv +from sets import Set -class Transform(object): +# MGDTODO: This creates a ton of cyclical references. We may want to +# consider using weak references + +class TransformNode(object): + def __init__(self): + self._parents = Set() + + def invalidate(self): + if not self._do_invalidation(): + for parent in self._parents: + parent.invalidate() + + def _do_invalidation(self): + return False + + def add_children(self, children): + for child in children: + child._parents.add(self) + +class Bbox(TransformNode): + def __init__(self, points): + TransformNode.__init__(self) + self._points = N.asarray(points, N.float_) + self.track = False + + def __del__(self): + if self.track: + print "Bbox::__del__" + + #@staticmethod + def unit(): + return Bbox([[0,0], [1,1]]) + unit = staticmethod(unit) + + #@staticmethod + def from_lbwh(left, bottom, width, height): + return Bbox([[left, bottom], [left + width, bottom + height]]) + from_lbwh = staticmethod(from_lbwh) + + #@staticmethod + def from_lbrt(left, bottom, right, top): + return Bbox([[left, bottom], [right, top]]) + from_lbrt = staticmethod(from_lbrt) + + def update_from_data(self, x, y): + self._points = N.array([[x.min(), y.min()], [x.max(), y.max()]], N.float_) + self.invalidate() + if self.track: + print "Bbox::update_from_data", self._points + + def copy(self): + if self.track: + print "Bbox::copy" + return Bbox(self._points.copy()) + + def __repr__(self): + return 'Bbox(%s)' % repr(self._points) + __str__ = __repr__ + + def __cmp__(self, other): + # MGDTODO: Totally suboptimal + if isinstance(other, Bbox): + return (self._points == other._points).all() + return -1 + + # MGDTODO: Probably a more efficient ways to do this... + def _get_xmin(self): + if self.track: + print "Bbox::_get_xmin" + return self._points[0, 0] + def _set_xmin(self, val): + print "Bbox::_set_xmin" + self._points[0, 0] = val + self.invalidate() + xmin = property(_get_xmin, _set_xmin) + + def _get_ymin(self): + return self._points[0, 1] + def _set_ymin(self, val): + self._points[0, 1] = val + self.invalidate() + ymin = property(_get_ymin, _set_ymin) + + def _get_xmax(self): + return self._points[1, 0] + def _set_xmax(self, val): + self._points[1, 0] = val + self.invalidate() + xmax = property(_get_xmax, _set_xmax) + + def _get_ymax(self): + return self._points[1, 1] + def _set_ymax(self, val): + self._points[1, 1] = val + self.invalidate() + ymax = property(_get_ymax, _set_ymax) + + def _get_min(self): + return self._points[0] + def _set_min(self, val): + self._points[0] = val + self.invalidate() + min = property(_get_min, _set_min) + + def _get_max(self): + return self._points[1] + def _set_max(self, val): + self._points[1] = val + self.invalidate() + max = property(_get_max, _set_max) + + def _get_intervalx(self): + return self._points[:,0] + def _set_intervalx(self, interval): + self._points[:,0] = interval + self.invalidate() + intervalx = property(_get_intervalx, _set_intervalx) + + def _get_intervaly(self): + return self._points[:,1] + def _set_intervaly(self, interval): + self._points[:,1] = interval + self.invalidate() + intervaly = property(_get_intervaly, _set_intervaly) + + def _get_width(self): + return self.xmax - self.xmin + width = property(_get_width) + + def _get_height(self): + return self.ymax - self.ymin + height = property(_get_height) + + def transformed(self, transform): + return Bbox(self.transform(self._points)) + + def inverse_transformed(self, transform): + return Bbox(self.transform.inverted()(self._points)) + + def get_bounds(self): + return (self.xmin, self.ymin, + self.xmax - self.xmin, self.ymax - self.ymin) + + def expanded(self, sw, sh): + width = self.width() + height = self.height() + deltaw = (sw * width - width) / 2.0 + deltah = (sh * height - height) / 2.0 + a = N.array([[-deltaw, -deltah], [deltaw, deltah]]) + return Bbox(self._points + a) + + def contains(self, x, y): + return (x >= self.xmin and x <= self.xmax and + y >= self.ymin and y <= self.ymax) + + #@staticmethod + def union(bboxes): + """ + Return the Bbox that bounds all bboxes + """ + assert(len(bboxes)) + + if len(bboxes) == 1: + return bboxes[0] + + bbox = bboxes[0] + xmin = bbox.xmin + ymin = bbox.ymin + xmax = bbox.xmax + ymax = bbox.ymax + + for bbox in bboxes[1:]: + xmin = min(xmin, bbox.xmin) + ymin = min(ymin, bbox.ymin) + xmax = max(xmax, bbox.xmax) + ymax = max(ymax, bbox.ymax) + + return Bbox.from_lbrt(xmin, ymin, xmax, ymax) + union = staticmethod(union) + +class Transform(TransformNode): + def __init__(self): + TransformNode.__init__(self) + def __call__(self, points): raise NotImplementedError() def __add__(self, other): if isinstance(other, Transform): - return CompositeTransform(self, other) + return composite_transform_factory(self, other) raise TypeError("Can not add Transform to object of type '%s'" % type(other)) def __radd__(self, other): if isinstance(other, Transform): - return CompositeTransform(other, self) + return composite_transform_factory(other, self) raise TypeError("Can not add Transform to object of type '%s'" % type(other)) def has_inverse(self): @@ -30,15 +214,9 @@ def is_separable(self): return False -class CompositeTransform(Transform): - def __init__(self, a, b): - assert a.output_dims == b.input_dims - self.a = a - self.b = b - - def __call__(self, points): - return self.b(self.a(points)) - + def is_affine(self): + return False + class Affine2D(Transform): input_dims = 2 output_dims = 2 @@ -51,15 +229,22 @@ b d f 0 0 1 """ + Transform.__init__(self) if matrix is None: matrix = N.identity(3) else: assert matrix.shape == (3, 3) - self.mtx = matrix + self._mtx = matrix + self._inverted = None def __repr__(self): - return "Affine2D(%s)" % repr(self.mtx) + return "Affine2D(%s)" % repr(self._mtx) __str__ = __repr__ + + def _do_invalidation(self): + result = self._inverted is None + self._inverted = None + return result #@staticmethod def from_values(a, b, c, d, e, f): @@ -67,7 +252,8 @@ from_values = staticmethod(from_values) def to_values(self): - return tuple(self.mtx[:2].swapaxes(0, 1).flatten()) + mtx = self.get_matrix() + return tuple(mtx[:2].swapaxes(0, 1).flatten()) #@staticmethod def matrix_from_values(a, b, c, d, e, f): @@ -78,6 +264,9 @@ return affine matrix_from_values = staticmethod(matrix_from_values) + def get_matrix(self): + return self._mtx + def __call__(self, points): """ Applies the transformation to a set of 2D points and @@ -91,13 +280,14 @@ # to separate the matrix out into the translation and scale components # and apply each separately (which is still sub-optimal) - # This is nicer for now, however, since we can just keep a + # This is easier for now, however, since we can just keep a # regular affine matrix around # MGDTODO: Trap cases where this isn't an array and fix there - points = N.array(points, N.float_) + mtx = self.get_matrix() + points = N.asarray(points, N.float_) new_points = points.swapaxes(0, 1) new_points = N.vstack((new_points, N.ones((1, points.shape[0])))) - result = N.dot(self.mtx, new_points)[:2] + result = N.dot(mtx, new_points)[:2] return result.swapaxes(0, 1) #@staticmethod @@ -105,8 +295,9 @@ return N.dot(b, a) _concat = staticmethod(_concat) + #@staticmethod def concat(a, b): - return Affine2D(Affine2D._concat(a.mtx, b.mtx)) + return Affine2D(Affine2D._concat(a._mtx, b._mtx)) concat = staticmethod(concat) #@staticmethod @@ -114,100 +305,246 @@ return Affine2D(N.identity(3)) identity = staticmethod(identity) - def __add__(self, other): - if isinstance(other, Affine2D): - return Affine2D.concat(self, other) - return Transform.__add__(self, other) - - def __radd__(self, other): - if isinstance(other, Affine2D): - return Affine2D.concat(other, self) - return Transform.__radd__(self, other) - - def rotated(self, theta): + def rotate(self, theta): a = N.cos(theta) b = N.sin(theta) rotate_mtx = self.matrix_from_values(a, b, -b, a, 0, 0) - return Affine2D(self._concat(self.mtx, rotate_mtx)) + self._mtx = self._concat(self._mtx, rotate_mtx) + self.invalidate() + return self - def rotated_deg(self, degrees): - return self.rotated(degrees*N.pi/180.) + def rotate_deg(self, degrees): + return self.rotate(degrees*N.pi/180.) - def translated(self, tx, ty): + def translate(self, tx, ty): translate_mtx = self.matrix_from_values(1., 0., 0., 1., tx, ty) - return Affine2D(self._concat(self.mtx, translate_mtx)) + self._mtx = self._concat(self._mtx, translate_mtx) + self.invalidate() + return self - def scaled(self, sx, sy=None): + def scale(self, sx, sy=None): if sy is None: sy = sx scale_mtx = self.matrix_from_values(sx, 0., 0., sy, 0., 0.) - return Affine2D(self._concat(self.mtx, scale_mtx)) + self._mtx = self._concat(self._mtx, scale_mtx) + self.invalidate() + return self def inverted(self): - # MGDTODO: We may want to optimize by storing the inverse - # of the transform with every transform - return Affine2D(inv(self.mtx)) + if self._inverted is None: + mtx = self.get_matrix() + self._inverted = Affine2D(inv(mtx)) + return self._inverted def is_separable(self): - mtx = self.mtx + mtx = self.get_matrix() return mtx[0, 1] == 0.0 and mtx[1, 0] == 0.0 + def is_affine(self): + return True + class BlendedAffine2D(Affine2D): def __init__(self, x_transform, y_transform): -# assert isinstance(x_transform, Affine2D) -# assert isinstance(y_transform, Affine2D) + assert x_transform.is_affine() + assert y_transform.is_affine() assert x_transform.is_separable() assert y_transform.is_separable() - x_mtx = x_transform.mtx - y_mtx = y_transform.mtx - self.mtx = self.matrix_from_values( - x_mtx[0,0], 0.0, 0.0, y_mtx[1,1], x_mtx[0,2], y_mtx[1,2]) -# This is a placeholder since eventually we may need to handle the -# more general case of two transforms that aren't affines -BlendedTransform = BlendedAffine2D + Transform.__init__(self) + self.add_children([x_transform, y_transform]) + self._x = x_transform + self._y = y_transform + self._mtx = None + self._inverted = None -def blend_xy_sep_transform(x_transform, y_transform): - return BlendedAffine2D(x_transform, y_transform) + def __repr__(self): + return "BlendedAffine2D(%s,%s)" % (self._x, self._y) + __str__ = __repr__ + + def _do_invalidation(self): + if self._mtx is not None: + self._mtx = None + Affine2D._do_invalidation(self) + return False + return True -def get_bbox_transform(boxin, boxout): - x_scale = boxout.width() / boxin.width() - y_scale = boxout.height() / boxin.height() + def _make__mtx(self): + if self._mtx is None: + x_mtx = self._x.get_matrix() + y_mtx = self._y.get_matrix() + self._mtx = N.vstack([x_mtx[0], y_mtx[1], [0.0, 0.0, 1.0]]) +# self._mtx = self.matrix_from_values( +# x_mtx[0,0], 0.0, 0.0, y_mtx[1,1], x_mtx[0,2], y_mtx[1,2]) + print "Blended", x_mtx, y_mtx, self._mtx + + def is_separable(self): + return True + + def get_matrix(self): + self._make__mtx() + return self._mtx - # MGDTODO: Optimize - return Affine2D() \ - .translated(-boxin.xmin(), -boxin.ymin()) \ - .scaled(x_scale, y_scale) \ - .translated(boxout.xmin(), boxout.ymin()) +class BlendedTransform(Transform): + def __init__(self, x_transform, y_transform): + assert x_transform.is_separable() + assert y_transform.is_separable() + + Transform.__init__(self) + self.add_children([x_transform, y_transform]) + self._x = x_transform + self._y = y_transform + + def __call__(self, points): + # MGDTODO: Implement me + pass + +class CompositeAffine2D(Affine2D): + def __init__(self, a, b): + assert a.is_affine() + assert b.is_affine() + + Transform.__init__(self) + self.add_children([a, b]) + self._a = a + self._b = b + self._mtx = None + self._inverted = None + + def __repr__(self): + return "CompositeAffine2D(%s, %s)" % (self._a, self._b) + __str__ = __repr__ + + def _do_invalidation(self): + self._mtx = None + Affine2D._do_invalidation(self) -if __name__ == '__main__': - print Affine2D.from_values(1., 0, 0, 1, 0, 0) - - print "translated", Affine2D.identity().translated(5, 4) - print "rotated", Affine2D.identity().rotated_deg(30) - print "scaled", Affine2D.identity().scaled(5, 4) - - transform = Affine2D.identity().rotated_deg(30).translated(5, 4) + def _make__mtx(self): + if self._mtx is None: + self._mtx = self._concat( + self._b.get_matrix(), + self._a.get_matrix()) - points = N.array([[1, 2], [3, 4], [5, 6]]) + def get_matrix(self): + self._make__mtx() + return self._mtx + +class CompositeTransform(Transform): + def __init__(self, a, b): + assert a.output_dims == b.input_dims - print inv(transform.mtx) + Transform.__init__(self) + self.add_children([a, b]) + self._a = a + self._b = b + + def __call__(self, points): + # MGDTODO: Optimize here by concatenating affines if possible + return self._b(self._a(points)) + +class BboxTransform(Affine2D): + def __init__(self, boxin, boxout): + assert isinstance(boxin, Bbox) + assert isinstance(boxout, Bbox) + + Transform.__init__(self) + self.add_children([boxin, boxout]) + self._boxin = boxin + self._boxout = boxout + self._mtx = None + self._inverted = None + + def __repr__(self): + return "BboxTransform(%s, %s)" % (self._boxin, self._boxout) + __str__ = __repr__ + + def _do_invalidation(self): + if self._mtx is not None: + self._mtx = None + Affine2D._do_invalidation(self) + return False + return True + + def _make__mtx(self): + if self._mtx is None: + boxin = self._boxin + boxout = self._boxout + x_scale = boxout.width / boxin.width + y_scale = boxout.height / boxin.height + + # MGDTODO: Optimize + affine = Affine2D() \ + .translate(-boxin.xmin, -boxin.ymin) \ + .scale(x_scale, y_scale) \ + .translate(boxout.xmin, boxout.ymin) + + self._mtx = affine._mtx + + def __call__(self, points): + self._make__mtx() + return Affine2D.__call__(self, points) + + def inverted(self): + self._make__mtx() + return Affine2D.inverted(self) + + def is_separable(self): + return True + + def get_matrix(self): + self._make__mtx() + return self._mtx - print transform(points) +def blend_xy_sep_transform(x_transform, y_transform): + if x_transform.is_affine() and y_transform.is_affine(): + return BlendedAffine2D(x_transform, y_transform) + return BlendedTransform(x_transform, y_transform) - transform = Affine2D.identity().scaled(5., 1.).translated(10, 0) - print transform - print transform.inverted() +def composite_transform_factory(a, b): + if a.is_affine() and b.is_affine(): + return CompositeAffine2D(a, b) + return CompositeTransform(a, b) - from bbox import Bbox - print "BBOX" - boxin = Bbox([[10, 10], [320, 240]]) - boxout = Bbox([[25, 25], [640, 400]]) - print boxin._points, boxin.xmin(), boxin.ymin(), boxin.xmax(), boxin.ymax() - print boxout._points, boxout.xmin(), boxout.ymin(), boxout.xmax(), boxout.ymax() - trans = get_bbox_transform(boxin, boxout) - print trans - print trans(N.array([[10, 10], [320, 240]])) - print trans([[10, 10]]) +# MGDTODO: There's probably a better place for this +def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): + ''' + Ensure the endpoints of a range are not too close together. + + "too close" means the interval is smaller than 'tiny' times + the maximum absolute value. + + If they are too close, each will be moved by the 'expander'. + If 'increasing' is True and vmin > vmax, they will be swapped, + regardless of whether they are too close. + ''' + swapped = False + if vmax < vmin: + vmin, vmax = vmax, vmin + swapped = True + if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny: + if vmin==0.0: + vmin = -expander + vmax = expander + else: + vmin -= expander*abs(vmin) + vmax += expander*abs(vmax) + if swapped and not increasing: + vmin, vmax = vmax, vmin + return vmin, vmax + +# MGDTODO: Optimize +def interval_contains(interval, val): + return interval[0] <= val and interval[1] >= val + +def interval_contains_open(interval, val): + return interval[0] < val and interval[1] > val +if __name__ == '__main__': + bbox1 = Bbox([[10., 15.], [20., 25.]]) + bbox2 = Bbox([[30., 35.], [40., 45.]]) + trans = BboxTransform(bbox1, bbox2) + print trans(bbox1._points) + + bbox2.intervalx = 50, 55 + print trans(bbox1._points) + __all__ = ['Transform', 'Affine2D'] Modified: branches/transforms/lib/matplotlib/artist.py =================================================================== --- branches/transforms/lib/matplotlib/artist.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/artist.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -138,7 +138,6 @@ ACCEPTS: a matplotlib.transform transformation instance """ - print "set_transform", t self._transform = t self._transformSet = True self.pchanged() Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/axes.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -12,7 +12,6 @@ from matplotlib import affine as maffine from matplotlib import agg from matplotlib import axis as maxis -from matplotlib import bbox as mbbox from matplotlib import cbook from matplotlib import collections as mcoll from matplotlib import colors as mcolors @@ -33,7 +32,6 @@ iterable = cbook.iterable is_string_like = cbook.is_string_like -Wrapper = cbook.Wrapper def delete_masked_points(*args): @@ -484,8 +482,8 @@ """ martist.Artist.__init__(self) - self._position = rect - self._originalPosition = rect + self._position = maffine.Bbox.from_lbwh(*rect) + self._originalPosition = self._position.copy() self.set_axes(self) self.set_aspect('auto') self.set_adjustable('box') @@ -615,11 +613,11 @@ """ martist.Artist.set_figure(self, fig) - l, b, w, h = self._position - xmin = fig.bbox.xmin() - xmax = fig.bbox.xmax() - ymin = fig.bbox.ymin() - ymax = fig.bbox.ymax() + l, b, w, h = self._position.get_bounds() + xmin = fig.bbox.xmin + xmax = fig.bbox.xmax + ymin = fig.bbox.ymin + ymax = fig.bbox.ymax figw = xmax-xmin figh = ymax-ymin self.left = l*figw @@ -627,7 +625,7 @@ self.right = (l+w)*figw self.top = (b+h)*figh - self.bbox = mbbox.Bbox.from_lbrt( + self.bbox = maffine.Bbox.from_lbrt( self.left, self.bottom, self.right, self.top, ) @@ -639,7 +637,7 @@ set the dataLim and viewLim BBox attributes and the transData and transAxes Transformation attributes """ - Bbox = mbbox.Bbox + Bbox = maffine.Bbox if self._sharex is not None: left = self._sharex.viewLim.xmin() right = self._sharex.viewLim.xmax() @@ -655,11 +653,12 @@ self.viewLim = Bbox.from_lbrt(left, bottom, right, top) self.dataLim = Bbox.unit() + self.dataLim.track = True - self.transData = maffine.get_bbox_transform( + self.transData = maffine.BboxTransform( self.viewLim, self.bbox) - self.transAxes = maffine.get_bbox_transform( - self.dataLim, self.bbox) + self.transAxes = maffine.BboxTransform( + Bbox.unit(), self.bbox) print "_set_lim_and_transforms", self.viewLim, self.transData, self.dataLim, self.transAxes, self.bbox @@ -1184,9 +1183,8 @@ # MGDTODO ## self.dataLim.update_numerix(x, y, -1) print "update_datalim_numerix", self.dataLim, - self.dataLim = mbbox.Bbox.from_data(x, y) + self.dataLim.update_from_data(x, y) print self.dataLim - # MGDTODO side-effects def _get_verts_in_data_coords(self, trans, xys): if trans == self.transData: @@ -1247,7 +1245,7 @@ axis direction reversal that has already been done. """ # if image data only just use the datalim - print "autoscale_view" + print "autoscale_view", self._autoscaleon, scalex, scaley if not self._autoscaleon: return if (tight or (len(self.images)>0 and @@ -1504,7 +1502,7 @@ def get_xlim(self): 'Get the x axis range [xmin, xmax]' - return self.viewLim.intervalx().get_bounds() + return self.viewLim.intervalx def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs): @@ -1549,12 +1547,10 @@ # and min(xmin, xmax)<=0): # raise ValueError('Cannot set nonpositive limits with log transform') - xmin, xmax = mbbox.nonsingular(xmin, xmax, increasing=False) + xmin, xmax = maffine.nonsingular(xmin, xmax, increasing=False) - # MGDTODO: This is fairly cumbersome - # MGDTODO: side-effects on x-bounds should propagate - self.viewLim = mbbox.Bbox.from_lbrt(xmin, self.viewLim.ymin(), xmax, self.viewLim.ymax()) - print 'set_xlim', self.viewLim + self.viewLim.intervalx = (xmin, xmax) + print 'set_xlim', self.viewLim, xmin, xmax return xmin, xmax @@ -1634,7 +1630,7 @@ def get_ylim(self): 'Get the y axis range [ymin, ymax]' - return self.viewLim.intervaly().get_bounds() + return self.viewLim.intervaly def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): """ @@ -1677,9 +1673,8 @@ # and min(ymin, ymax)<=0): # raise ValueError('Cannot set nonpositive limits with log transform') - ymin, ymax = mbbox.nonsingular(ymin, ymax, increasing=False) - # MGDTODO: side-effects on y-bounds should propagate - self.viewLim = mbbox.Bbox.from_lbrt(self.viewLim.xmin(), ymin, self.viewLim.xmax(), ymax) + ymin, ymax = maffine.nonsingular(ymin, ymax, increasing=False) + self.viewLim.intervaly = (ymin, ymax) if emit: self.callbacks.process('ylim_changed', self) print "set_ylim", self.viewLim Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/axis.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -15,8 +15,8 @@ from ticker import NullFormatter, FixedFormatter, ScalarFormatter, LogFormatter from ticker import NullLocator, FixedLocator, LinearLocator, LogLocator, AutoLocator -from affine import Affine2D, blend_xy_sep_transform -from bbox import bbox_union +from affine import Affine2D, Bbox, blend_xy_sep_transform, interval_contains, \ + interval_contains_open from font_manager import FontProperties from text import Text, TextWithDash, _process_text_args from patches import bbox_artist @@ -160,7 +160,7 @@ def draw(self, renderer): if not self.get_visible(): return renderer.open_group(self.__name__) - midPoint = self.get_view_interval().contains_open( self.get_loc() ) + midPoint = interval_contains_open(self.get_view_interval(), self.get_loc() ) if midPoint: if self.gridOn: self.gridline.draw(renderer) @@ -239,7 +239,7 @@ trans = blend_xy_sep_transform( self.axes.transData, self.axes.transAxes) #offset the text downward with a post transformation - trans = trans + Affine2D().translated(0, -1 * self._padPixels) + trans = trans + Affine2D().translate(0, -1 * self._padPixels) t.set_transform(trans) self._set_artist_props(t) @@ -264,7 +264,7 @@ trans = blend_xy_sep_transform( self.axes.transData, self.axes.transAxes) # offset the text upward with a post transformation - trans = trans + Affine2D().translated(0, self._padPixels) + trans = trans + Affine2D().translate(0, self._padPixels) t.set_transform( trans ) self._set_artist_props(t) return t @@ -331,11 +331,11 @@ def get_view_interval(self): 'return the Interval instance for this axis view limits' - return self.axes.viewLim.intervalx() + return self.axes.viewLim.intervalx def get_data_interval(self): 'return the Interval instance for this axis data limits' - return self.axes.dataLim.intervalx() + return self.axes.dataLim.intervalx class YTick(Tick): @@ -362,7 +362,7 @@ trans = blend_xy_sep_transform( self.axes.transAxes, self.axes.transData) # offset the text leftward with a post transformation - trans = trans + Affine2D().translated(-1 * self._padPixels, 0) + trans = trans + Affine2D().translate(-1 * self._padPixels, 0) t.set_transform( trans ) #t.set_transform( self.axes.transData ) @@ -385,7 +385,7 @@ trans = blend_xy_sep_transform( self.axes.transAxes, self.axes.transData) # offset the text rightward with a post transformation - trans = trans + Affine2D().translated(self._padPixels, 0) + trans = trans + Affine2D().translate(self._padPixels, 0) t.set_transform( trans ) self._set_artist_props(t) return t @@ -455,11 +455,11 @@ def get_view_interval(self): 'return the Interval instance for this axis view limits' - return self.axes.viewLim.intervaly() + return self.axes.viewLim.intervaly def get_data_interval(self): 'return the Interval instance for this axis data limits' - return self.axes.dataLim.intervaly() + return self.axes.dataLim.intervaly class Ticker: @@ -575,7 +575,7 @@ interval = self.get_view_interval() for tick, loc, label in zip(majorTicks, majorLocs, majorLabels): if tick is None: continue - if not interval.contains(loc): continue + if not interval_contains(interval, loc): continue seen[loc] = 1 tick.update_position(loc) tick.set_label1(label) @@ -1034,19 +1034,19 @@ bottom = self.axes.bbox.ymin() else: - bbox = bbox_union(bboxes) - bottom = bbox.ymin() + bbox = Bbox.union(bboxes) + bottom = bbox.ymin self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi/72.0)) # self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi.get()/72.0)) MGDTODO else: if not len(bboxes2): - top = self.axes.bbox.ymax() + top = self.axes.bbox.ymax else: bbox = bbox_union(bboxes2) - top = bbox.ymax() + top = bbox.ymax self.label.set_position( (x, top+self.LABELPAD*self.figure.dpi.get()/72.0)) @@ -1059,8 +1059,8 @@ if not len(bboxes): bottom = self.axes.bbox.ymin() else: - bbox = bbox_union(bboxes) - bottom = bbox.ymin() + bbox = Bbox.union(bboxes) + bottom = bbox.ymin self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi/72.0)) # self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) MGDTODO @@ -1133,11 +1133,11 @@ def get_view_interval(self): 'return the Interval instance for this axis view limits' - return self.axes.viewLim.intervalx() + return self.axes.viewLim.intervalx def get_data_interval(self): 'return the Interval instance for this axis data limits' - return self.axes.dataLim.intervalx() + return self.axes.dataLim.intervalx class YAxis(Axis): @@ -1223,11 +1223,11 @@ x,y = self.label.get_position() if self.label_position == 'left': if not len(bboxes): - left = self.axes.bbox.xmin() + left = self.axes.bbox.xmin else: - bbox = bbox_union(bboxes) - left = bbox.xmin() + bbox = Bbox.union(bboxes) + left = bbox.xmin self.label.set_position( (left-self.LABELPAD*self.figure.dpi/72.0, y)) # self.label.set_position( (left-self.LABELPAD*self.figure.dpi.get()/72.0, y)) MGDTODO @@ -1248,7 +1248,7 @@ boxes of all the ticklabels """ x,y = self.offsetText.get_position() - top = self.axes.bbox.ymax() + top = self.axes.bbox.ymax self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi/72.0)) # self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) MGDTODO @@ -1335,11 +1335,11 @@ def get_view_interval(self): 'return the Interval instance for this axis view limits' - return self.axes.viewLim.intervaly() + return self.axes.viewLim.intervaly def get_data_interval(self): 'return the Interval instance for this axis data limits' - return self.axes.dataLim.intervaly() + return self.axes.dataLim.intervaly Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -84,7 +84,7 @@ from matplotlib.font_manager import findfont from matplotlib.ft2font import FT2Font, LOAD_DEFAULT from matplotlib.mathtext import MathTextParser -from matplotlib.bbox import Bbox +from matplotlib.affine import Bbox from _backend_agg import RendererAgg as _RendererAgg Modified: branches/transforms/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -219,13 +219,13 @@ def motion_notify_event(self, event): x = event.x # flipy so y=0 is bottom of canvas - y = self.figure.bbox.height() - event.y + y = self.figure.bbox.height - event.y FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event) def button_press_event(self, event): x = event.x # flipy so y=0 is bottom of canvas - y = self.figure.bbox.height() - event.y + y = self.figure.bbox.height - event.y num = getattr(event, 'num', None) if sys.platform=='darwin': @@ -239,7 +239,7 @@ def button_release_event(self, event): x = event.x # flipy so y=0 is bottom of canvas - y = self.figure.bbox.height() - event.y + y = self.figure.bbox.height - event.y num = getattr(event, 'num', None) @@ -609,7 +609,7 @@ return b def _init_toolbar(self): - xmin, xmax = self.canvas.figure.bbox.intervalx().get_bounds() + xmin, xmax = self.canvas.figure.bbox.intervalx height, width = 50, xmax-xmin Tk.Frame.__init__(self, master=self.window, width=width, height=height, Deleted: branches/transforms/lib/matplotlib/bbox.py =================================================================== --- branches/transforms/lib/matplotlib/bbox.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/bbox.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -1,161 +0,0 @@ -""" -A convenience class for handling bounding boxes - -2007 Michael Droettboom -""" - -import numpy as N - -class Interval: - def __init__(self, bounds): - self._bounds = N.array(bounds, N.float_) - - def contains(self, value): - bounds = self._bounds - return value >= bounds[0] and value <= bounds[1] - - def contains_open(self, value): - bounds = self._bounds - return value > bounds[0] and value < bounds[1] - - def get_bounds(self): - return self._bounds - - def span(self): - bounds = self._bounds - return bounds[1] - bounds[0] - -class Bbox: - def __init__(self, points): - self._points = N.array(points, N.float_) - - #@staticmethod - def unit(): - return Bbox([[0,0], [1,1]]) - unit = staticmethod(unit) - - #@staticmethod - def from_lbwh(left, bottom, width, height): - return Bbox([[left, bottom], [left + width, bottom + height]]) - from_lbwh = staticmethod(from_lbwh) - - #@staticmethod - def from_lbrt(left, bottom, right, top): - return Bbox([[left, bottom], [right, top]]) - from_lbrt = staticmethod(from_lbrt) - - #@staticmethod - def from_data(x, y): - return Bbox([[x.min(), y.min()], [x.max(), y.max()]]) - from_data = staticmethod(from_data) - - def copy(self): - return Bbox(self._points.copy()) - - def __repr__(self): - return 'Bbox(%s)' % repr(self._points) - __str__ = __repr__ - - def __cmp__(self, other): - # MGDTODO: Totally suboptimal - if isinstance(other, Bbox): - return (self._points == other._points).all() - return -1 - - # MGDTODO: Probably a more efficient ways to do this... - def xmin(self): - return self._points[0,0] - - def ymin(self): - return self._points[0,1] - - def xmax(self): - return self._points[1,0] - - def ymax(self): - return self._points[1,1] - - def width(self): - return self.xmax() - self.xmin() - - def height(self): - return self.ymax() - self.ymin() - - def transform(self, transform): - return Bbox(transform(self._points)) - - def inverse_transform(self, transform): - return Bbox(transform.inverted()(self._points)) - - def get_bounds(self): - return (self.xmin(), self.ymin(), - self.xmax() - self.xmin(), self.ymax() - self.ymin()) - - # MGDTODO: This is an inefficient way to do this - def intervalx(self): - return Interval(self._points[0]) - - def intervaly(self): - return Interval(self._points[1]) - - def scaled(self, sw, sh): - width = self.width() - height = self.height() - deltaw = (sw * width - width) / 2.0 - deltah = (sh * height - height) / 2.0 - a = N.array([[-deltaw, -deltah], [deltaw, deltah]]) - return Bbox(self._points + a) - - def contains(self, x, y): - return (x >= self.xmin() and x <= self.xmax() and - y >= self.ymin() and y <= self.ymax()) - -def bbox_union(bboxes): - """ - Return the Bbox that bounds all bboxes - """ - assert(len(bboxes)) - - if len(bboxes) == 1: - return bboxes[0] - - bbox = bboxes[0] - xmin = bbox.xmin() - ymin = bbox.ymin() - xmax = bbox.xmax() - ymax = bbox.ymax() - - for bbox in bboxes[1:]: - xmin = min(xmin, bbox.xmin()) - ymin = min(ymin, bbox.ymin()) - xmax = max(xmax, bbox.xmax()) - ymax = max(ymax, bbox.ymax()) - - return Bbox.from_lbrt(xmin, ymin, xmax, ymax) - -# MGDTODO: There's probably a better place for this -def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): - ''' - Ensure the endpoints of a range are not too close together. - - "too close" means the interval is smaller than 'tiny' times - the maximum absolute value. - - If they are too close, each will be moved by the 'expander'. - If 'increasing' is True and vmin > vmax, they will be swapped, - regardless of whether they are too close. - ''' - swapped = False - if vmax < vmin: - vmin, vmax = vmax, vmin - swapped = True - if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny: - if vmin==0.0: - vmin = -expander - vmax = expander - else: - vmin -= expander*abs(vmin) - vmax += expander*abs(vmax) - if swapped and not increasing: - vmin, vmax = vmax, vmin - return vmin, vmax Modified: branches/transforms/lib/matplotlib/figure.py =================================================================== --- branches/transforms/lib/matplotlib/figure.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/figure.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -18,8 +18,7 @@ from text import Text, _process_text_args from legend import Legend -from affine import get_bbox_transform -from bbox import Bbox +from affine import Bbox, BboxTransform from ticker import FormatStrFormatter from cm import ScalarMappable from contour import ContourSet @@ -105,7 +104,7 @@ class Figure(Artist): def __str__(self): - return "Figure(%gx%g)"%(self.figwidth, self.figheight) + return "Figure(%gx%g)"%(self.bbox.max) # return "Figure(%gx%g)"%(self.figwidth.get(),self.figheight.get()) def __init__(self, @@ -130,13 +129,13 @@ if edgecolor is None: edgecolor = rcParams['figure.edgecolor'] self.dpi = dpi - self.figwidth = figsize[0] * dpi - self.figheight = figsize[1] * dpi - self.bbox = Bbox.from_lbwh(0, 0, self.figwidth, self.figheight) + figwidth = figsize[0] * dpi + figheight = figsize[1] * dpi + self.bbox = Bbox.from_lbwh(0, 0, figwidth, figheight) self.frameon = frameon - self.transFigure = get_bbox_transform( Bbox.unit(), self.bbox) + self.transFigure = BboxTransform( Bbox.unit(), self.bbox) @@ -325,9 +324,9 @@ else: w,h = args - - self.figwidth = w - self.figheight = h + dpival = self.dpi + self.bbox.max = w * dpival, h * dpival + print self.bbox # self.figwidth.set(w) MGDTODO # self.figheight.set(h) @@ -341,7 +340,7 @@ manager.resize(int(canvasw), int(canvash)) def get_size_inches(self): - return self.figwidth, self.figheight + return self.bbox.max # return self.figwidth.get(), self.figheight.get() MGDTODO def get_edgecolor(self): @@ -354,12 +353,12 @@ def get_figwidth(self): 'Return the figwidth as a float' - return self.figwidth + return self.bbox.xmax # return self.figwidth.get() MGDTODO def get_figheight(self): 'Return the figheight as a float' - return self.figheight.get() + return self.bbox.ymax def get_dpi(self): 'Return the dpi as a float' @@ -402,7 +401,7 @@ ACCEPTS: float """ # self.figwidth.set(val) MGDTODO - self.figwidth = val + self.bbox.xmax = val def set_figheight(self, val): """ @@ -411,7 +410,7 @@ ACCEPTS: float """ # MGDTODO (set()) - self.figheight = val + self.bbox.ymax = val def set_frameon(self, b): """ Modified: branches/transforms/lib/matplotlib/legend.py =================================================================== --- branches/transforms/lib/matplotlib/legend.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/legend.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -34,8 +34,7 @@ from patches import Patch, Rectangle, RegularPolygon, Shadow, bbox_artist, draw_bbox from collections import LineCollection, RegularPolyCollection, PatchCollection from text import Text -from affine import get_bbox_transform -from bbox import Bbox, bbox_union +from affine import Bbox, BboxTransform def line_cuts_bbox(line, bbox): """ Return True if and only if line cuts bbox. """ @@ -165,7 +164,7 @@ else: raise TypeError("Legend needs either Axes or Figure as parent") self.parent = parent - self.set_transform( get_bbox_transform( Bbox.unit(), parent.bbox) ) + self.set_transform( BboxTransform( Bbox.unit(), parent.bbox) ) if loc is None: loc = rcParams["legend.loc"] @@ -260,10 +259,10 @@ bboxesAll = bboxesText bboxesAll.extend(bboxesHandles) - bbox = bbox_union(bboxesAll) + bbox = Bbox.union(bboxesAll) self.save = bbox - ibox = bbox.inverse_transform(self.get_transform()) + ibox = bbox.inverse_transformed(self.get_transform()) self.ibox = ibox return ibox @@ -531,7 +530,7 @@ if not len(self.legendHandles) and not len(self.texts): return def get_tbounds(text): #get text bounds in axes coords bbox = text.get_window_extent(renderer) - bboxa = bbox.inverse_transform(self.get_transform()) + bboxa = bbox.inverse_transformed(self.get_transform()) return bboxa.get_bounds() hpos = [] Modified: branches/transforms/lib/matplotlib/lines.py =================================================================== --- branches/transforms/lib/matplotlib/lines.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/lines.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -14,11 +14,11 @@ import numerix.ma as ma from matplotlib import verbose import artist +from affine import Bbox from artist import Artist, setp from cbook import iterable, is_string_like, is_numlike from colors import colorConverter -from bbox import Bbox from matplotlib import rcParams # special-purpose marker identifiers: Modified: branches/transforms/lib/matplotlib/table.py =================================================================== --- branches/transforms/lib/matplotlib/table.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/table.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -29,7 +29,7 @@ from patches import Rectangle from cbook import enumerate, is_string_like, flatten from text import Text -from bbox import Bbox, bbox_union +from affine import Bbox @@ -130,7 +130,7 @@ def get_text_bounds(self, renderer): """ Get text bounds in axes co-ordinates. """ bbox = self._text.get_window_extent(renderer) - bbox.inverse_transform(self.get_transform()) + bboxa = bbox.inverse_transformed(self.get_transform()) return bboxa.get_bounds() def get_required_width(self, renderer): Modified: branches/transforms/lib/matplotlib/text.py =================================================================== --- branches/transforms/lib/matplotlib/text.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/text.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -15,7 +15,7 @@ from cbook import enumerate, is_string_like, maxdict, is_numlike from font_manager import FontProperties from patches import bbox_artist, YAArrow -from bbox import Bbox, bbox_union +from affine import Bbox from lines import Line2D import matplotlib.nxutils as nxutils Modified: branches/transforms/lib/matplotlib/ticker.py =================================================================== --- branches/transforms/lib/matplotlib/ticker.py 2007-09-12 07:04:38 UTC (rev 3834) +++ branches/transforms/lib/matplotlib/ticker.py 2007-09-12 13:36:25 UTC (rev 3835) @@ -115,7 +115,7 @@ import matplotlib as mpl from matplotlib import verbose, rcParams from matplotlib import cbook -from matplotlib import bbox as mbbox +from matplotlib import affine as maffine @@ -148,8 +148,9 @@ cases where the Intervals do not need to be updated automatically. ''' - self.dataInterval = mbbox.Interval([vmin, vmax]) - self.viewInterval = mbbox.Interval([vmin, vmax]) + # MGDTODO: Interval no longer exists + self.dataInterval = maffine.Interval([vmin, vmax]) + self.viewInterval = maffine.Interval([vmin, vmax]) class Formatter(TickHelper): """ @@ -341,7 +342,8 @@ self.locs = locs if len(self.locs) > 0: self.verify_intervals() - d = abs(self.viewInterval.span()) + vmin, vmax = self.viewInterval + d = abs(vmax - vmin) if self._useOffset: self._set_offset(d) self._set_orderOfMagnitude(d) self._set_format() @@ -571,7 +573,7 @@ def autoscale(self): 'autoscale the view limits' self.verify_intervals() - return mbbox.nonsingular(*self.dataInterval.get_bounds()) + return maffine.nonsingular(*self.dataInterval.get_bounds()) def pan(self, numsteps): 'Pan numticks (can be positive or negative)' @@ -713,7 +715,7 @@ vmin = math.floor(scale*vmin)/scale vmax = math.ceil(scale*vmax)/scale - return mbbox.nonsingular(vmin, vmax) + return maffine.nonsingular(vmin, vmax) def closeto(x,y): @@ -797,7 +799,7 @@ vmin -=1 vmax +=1 - return mbbox.nonsingular(vmin, vmax) + return maffine.nonsingular(vmin, vmax) def scale_range(vmin, vmax, n = 1, threshold=100): dv = abs(vmax - vmin) @@ -864,14 +866,14 @@ def __call__(self): self.verify_intervals() - vmin, vmax = self.viewInterval.get_bounds() - vmin, vmax = mbbox.nonsingular(vmin, vmax, expander = 0.05) + vmin, vmax = self.viewInterval + vmin, vmax = maffine.nonsingular(vmin, vmax, expander = 0.05) return self.bin_boundaries(vmin, vmax) def autoscale(self): self.verify_intervals() - dmin, dmax = self.dataInterval.get_bounds() - dmin, dmax = mbbox.nonsingular(dmin, dmax, expander = 0.05) + dmin, dmax = self.dataInterval + dmin, dmax = maffine.nonsingular(dmin, dmax, expander = 0.05) return npy.take(self.bin_boundaries(dmin, dmax), [0,-1]) @@ -972,7 +974,7 @@ if vmin==vmax: vmin = decade_down(vmin,self._base) vmax = decade_up(vmax,self._base) - return mbbox.nonsingular(vmin, vmax) + return maffine.nonsingular(vmin, vmax) class AutoLocator(MaxNLocator): def __init__(self): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2007-09-12 07:16:51
|
Revision: 3834 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3834&view=rev Author: jouni Date: 2007-09-12 00:04:38 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Further development of dviread. It now attempts to read virtual fonts, but the positioning is still somewhat off. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py trunk/matplotlib/lib/matplotlib/dviread.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-11 19:40:27 UTC (rev 3833) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-12 07:04:38 UTC (rev 3834) @@ -491,6 +491,7 @@ return fontdictObject def embedType1(self, filename, fontinfo): + # TODO: font effects such as SlantFont fh = open(filename, 'rb') matplotlib.verbose.report( 'Embedding Type 1 font ' + filename, 'debug') @@ -520,8 +521,15 @@ if fontinfo.encodingfile is not None: enc = dviread.Encoding(fontinfo.encodingfile) - widths = [ afmdata.get_width_from_char_name(ch) - for ch in enc ] + widths = [] + for ch in enc: + try: + widths.append(afmdata.get_width_from_char_name(ch)) + except KeyError: + matplotlib.verbose.report( + 'No width for %s in %s' % (ch, fullname), 'debug') + widths.append(0) + differencesArray = [ Name(ch) for ch in enc ] differencesArray = [ 0 ] + differencesArray firstchar = 0 @@ -538,11 +546,24 @@ firstchar = not_None.next() lastchar = max(not_None) widths = widths[firstchar:lastchar+1] + for i,w in enumerate(widths): + if w is None: widths[i] = 0 - differencesArray = [ firstchar ] + differencesArray = [ ] + need_idx = True for ch in range(firstchar, lastchar+1): - differencesArray.append(Name( - afmdata.get_name_char(ch, isord=True))) + try: + name = afmdata.get_name_char(ch, isord=True) + if need_idx: + differencesArray.append(ch) + need_idx = False + differencesArray.append(Name(name)) + except KeyError: + matplotlib.verbose.report( + 'No name for glyph %d in %s' % (ch, fullname), + 'debug') + need_idx = True + fontdict = { 'Type': Name('Font'), @@ -1448,17 +1469,16 @@ # Gather font information and do some setup for combining # characters into strings. - oldfontnum, seq = None, [] - for x1, y1, fontnum, glyph, width in page.text: - if fontnum != oldfontnum: - texname, fontsize = dvi.fontinfo(fontnum) - fontinfo = self.tex_font_mapping(texname) + oldfont, seq = None, [] + for x1, y1, dvifont, glyph, width in page.text: + if dvifont != oldfont: + fontinfo = self.tex_font_mapping(dvifont.texname) pdfname = self.file.fontName(fontinfo.filename) self.file.fontInfo[pdfname] = Bunch( encodingfile=fontinfo.encoding, afmfile=fontinfo.afm) - seq += [['font', pdfname, fontsize]] - oldfontnum = fontnum + seq += [['font', pdfname, dvifont.size]] + oldfont = dvifont seq += [['text', x1, y1, [chr(glyph)], x1+width]] seq += [('end',)] Modified: trunk/matplotlib/lib/matplotlib/dviread.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-11 19:40:27 UTC (rev 3833) +++ trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-12 07:04:38 UTC (rev 3834) @@ -9,15 +9,13 @@ for page in dvi: # iterate over pages w, h, d = page.width, page.height, page.descent for x,y,font,glyph,width in page.text: - fontname, pointsize = dvi.fontinfo(font) + fontname = font.texname + pointsize = font.size ... for x,y,height,width in page.boxes: ... """ -# TODO: support TeX virtual fonts (*.vf) which are a sort of -# subroutine collections for dvi files - import matplotlib import matplotlib.cbook as mpl_cbook import numpy as npy @@ -85,8 +83,7 @@ x,y,h,w = elt e = 0 # zero depth else: # glyph - x,y,f,g,w = elt - font = self.fonts[f] + x,y,font,g,w = elt h = (font.scale * font.tfm.height[g]) >> 20 e = (font.scale * font.tfm.depth[g]) >> 20 minx = min(minx, x) @@ -96,7 +93,8 @@ maxy_pure = max(maxy_pure, y) d = self.dpi / (72.27 * 2**16) # from TeX's "scaled points" to dpi units - text = [ ((x-minx)*d, (maxy-y)*d, f, g, w*d) for (x,y,f,g,w) in self.text ] + text = [ ((x-minx)*d, (maxy-y)*d, DviFont(f), g, w*d) + for (x,y,f,g,w) in self.text ] boxes = [ ((x-minx)*d, (maxy-y)*d, h*d, w*d) for (x,y,h,w) in self.boxes ] return mpl_cbook.Bunch(text=text, boxes=boxes, @@ -104,14 +102,6 @@ height=(maxy_pure-miny)*d, descent=(maxy-maxy_pure)*d) - def fontinfo(self, f): - """ - texname, pointsize = dvi.fontinfo(fontnum) - - Name and size in points (Adobe points, not TeX points). - """ - return self.fonts[f].name, self.fonts[f].scale * (72.0 / (72.27 * 2**16)) - def _read(self): """ Read one page from the file. Return True if successful, @@ -235,17 +225,21 @@ # I think we can assume this is constant self.state = _dvistate.outer - def _width_of(self, char): - font = self.fonts[self.f] - width = font.tfm.width[char] - width = (width * font.scale) >> 20 - return width + def _width_of(self, char, font): + width = font.tfm.width.get(char, None) + if width is not None: + return (width * font.scale) >> 20 + matplotlib.verbose.report( + 'No width for char %d in font %s' % (char, font.name), + 'debug') + return 0 + def _set_char(self, char): if self.state != _dvistate.inpage: raise ValueError, "misplaced set_char in dvi file" self._put_char(char) - self.h += self._width_of(char) + self.h += self._width_of(char, self.fonts[self.f]) def _set_rule(self, a, b): if self.state != _dvistate.inpage: @@ -256,7 +250,15 @@ def _put_char(self, char): if self.state != _dvistate.inpage: raise ValueError, "misplaced put_char in dvi file" - self.text.append((self.h, self.v, self.f, char, self._width_of(char))) + font = self.fonts[self.f] + if font.vf is None: + self.text.append((self.h, self.v, font, char, + self._width_of(char, font))) + else: + self.text.extend([(self.h + x, self.v + y, f, g, w) + for x, y, f, g, w in font.vf[char].text]) + self.boxes.extend([(self.h + x, self.v + y, a, b) + for x, y, a, b in font.vf[char].boxes]) def _put_rule(self, a, b): if self.state != _dvistate.inpage: @@ -269,8 +271,8 @@ def _bop(self, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, p): if self.state != _dvistate.outer: - print '+++', self.state - raise ValueError, "misplaced bop in dvi file" + raise ValueError, \ + "misplaced bop in dvi file (state %d)" % self.state self.state = _dvistate.inpage self.h, self.v, self.w, self.x, self.y, self.z = 0, 0, 0, 0, 0, 0 self.stack = [] @@ -345,16 +347,18 @@ 'debug') def _fnt_def(self, k, c, s, d, a, l, n): - filename = find_tex_file(n[-l:] + '.tfm') - tfm = Tfm(filename) + tfm = _tfmfile(n[-l:]) if c != 0 and tfm.checksum != 0 and c != tfm.checksum: raise ValueError, 'tfm checksum mismatch: %s'%n # It seems that the assumption behind the following check is incorrect: #if d != tfm.design_size: # raise ValueError, 'tfm design size mismatch: %d in dvi, %d in %s'%\ # (d, tfm.design_size, n) - self.fonts[k] = mpl_cbook.Bunch(scale=s, tfm=tfm, name=n) + vf = _vffile(n[-l:]) + + self.fonts[k] = mpl_cbook.Bunch(scale=s, tfm=tfm, name=n, vf=vf) + def _post(self): if self.state != _dvistate.outer: raise ValueError, "misplaced post in dvi file" @@ -365,6 +369,121 @@ def _post_post(self): raise NotImplementedError +class DviFont(object): + __slots__ = ('texname', 'size') + + def __init__(self, f): + """ + Object that holds a font's texname and size and supports comparison. + + The size is in Adobe points (converted from TeX points). + """ + # TODO: would it make more sense to have the size in dpi units? + self.texname = f.name + self.size = f.scale * (72.0 / (72.27 * 2**16)) + + def __eq__(self, other): + return self.__class__ == other.__class__ and \ + self.texname == other.texname and self.size == other.size + + def __ne__(self, other): + return not self.__eq__(other) + +class Vf(Dvi): + """ + A virtual font (*.vf file) containing subroutines for dvi files. + + Usage: + vf = Vf(filename) + glyph = vf[code] + glyph.text, glyph.boxes, glyph.width + """ + + def __init__(self, filename): + Dvi.__init__(self, filename, 0) + self._first_font = None + self._chars = {} + self._packet_ends = None + self._read() + self.close() + + def __getitem__(self, code): + return self._chars[code] + + def _dispatch(self, byte): + # If we are in a packet, execute the dvi instructions + if self.state == _dvistate.inpage: + byte_at = self.file.tell()-1 + if byte_at == self._packet_ends: + self._finalize_packet() + # fall through + elif byte_at > self._packet_ends: + raise ValueError, "Packet length mismatch in vf file" + else: + if byte in (139, 140) or byte >= 243: + raise ValueError, "Inappropriate opcode %d in vf file" % byte + Dvi._dispatch(self, byte) + return + + # We are outside a packet + if byte < 242: # a short packet (length given by byte) + cc, tfm = self._arg(1), self._arg(3) + self._init_packet(byte, cc, tfm) + elif byte == 242: # a long packet + pl, cc, tfm = [ self._arg(x) for x in (4, 4, 4) ] + self._init_packet(pl, cc, tfm) + elif 243 <= byte <= 246: + Dvi._dispatch(self, byte) + elif byte == 247: # preamble + i, k = self._arg(1), self._arg(1) + x = self.file.read(k) + cs, ds = self._arg(4), self._arg(4) + self._pre(i, x, cs, ds) + elif byte == 248: # postamble (just some number of 248s) + self.state = _dvistate.post_post + else: + raise ValueError, "unknown vf opcode %d" % byte + + def _init_packet(self, pl, cc, tfm): + if self.state != _dvistate.outer: + raise ValueError, "Misplaced packet in vf file" + self.state = _dvistate.inpage + self._packet_ends = self.file.tell() + pl + self._packet_char = cc + self._packet_width = tfm + self.h, self.v, self.w, self.x, self.y, self.z = 0, 0, 0, 0, 0, 0 + self.stack, self.text, self.boxes = [], [], [] + self.f = self._first_font + + def _finalize_packet(self): + self._chars[self._packet_char] = mpl_cbook.Bunch( + text=self.text, boxes=self.boxes, width = self._packet_width) + self.state = _dvistate.outer + + def _pre(self, i, x, cs, ds): + if self.state != _dvistate.pre: + raise ValueError, "pre command in middle of vf file" + if i != 202: + raise ValueError, "Unknown vf format %d" % i + matplotlib.verbose.report('vf file comment: ' + x, 'debug') + self.state = _dvistate.outer + # cs = checksum, ds = design size + + def _fnt_def(self, k, *args): + Dvi._fnt_def(self, k, *args) + if self._first_font is None: + self._first_font = k + +def fix2comp(num): + """ + Convert from two's complement to negative. + """ + assert 0 <= num < 2**32 + if num & 2**31: + return num - 2**32 + else: + return num + class Tfm(object): """ A TeX Font Metric file. This implementation covers only the bare @@ -380,12 +499,16 @@ """ def __init__(self, filename): + matplotlib.verbose.report('opening tfm file ' + filename, 'debug') file = open(filename, 'rb') try: header1 = file.read(24) lh, bc, ec, nw, nh, nd = \ struct.unpack('!6H', header1[2:14]) + matplotlib.verbose.report( + 'lh=%d, bc=%d, ec=%d, nw=%d, nh=%d, nd=%d' % ( + lh, bc, ec, nw, nh, nd), 'debug') header2 = file.read(4*lh) self.checksum, self.design_size = \ struct.unpack('!2I', header2[:8]) @@ -399,12 +522,12 @@ self.width, self.height, self.depth = {}, {}, {} widths, heights, depths = \ - [ struct.unpack('!%dI' % n, x) - for n,x in [(nw, widths), (nh, heights), (nd, depths)] ] + [ struct.unpack('!%dI' % (len(x)/4), x) + for x in (widths, heights, depths) ] for i in range(ec-bc): - self.width[bc+i] = widths[ord(char_info[4*i])] - self.height[bc+i] = heights[ord(char_info[4*i+1]) >> 4] - self.depth[bc+i] = depths[ord(char_info[4*i+1]) & 0xf] + self.width[bc+i] = fix2comp(widths[ord(char_info[4*i])]) + self.height[bc+i] = fix2comp(heights[ord(char_info[4*i+1]) >> 4]) + self.depth[bc+i] = fix2comp(depths[ord(char_info[4*i+1]) & 0xf]) class PsfontsMap(object): @@ -530,9 +653,12 @@ # Expecting something like /FooEncoding [ if '[' in line: state = 1 - line = line[line.index('[')+1].strip() + line = line[line.index('[')+1:].strip() if state == 1: + if ']' in line: # ] def + line = line[:line.index(']')] + state = 2 words = line.split() for w in words: if w.startswith('/'): @@ -541,10 +667,6 @@ result.extend(subwords[1:]) else: raise ValueError, "Broken name in encoding file: " + w - - # Expecting ] def - if ']' in line: - break return result @@ -572,6 +694,32 @@ return result +_tfmcache = {} +_vfcache = {} + +def _fontfile(texname, class_, suffix, cache): + try: + return cache[texname] + except KeyError: + pass + + filename = find_tex_file(texname + suffix) + if filename: + result = class_(filename) + else: + result = None + + cache[texname] = result + return result + +def _tfmfile(texname): + return _fontfile(texname, Tfm, '.tfm', _tfmcache) + +def _vffile(texname): + return _fontfile(texname, Vf, '.vf', _vfcache) + + + if __name__ == '__main__': matplotlib.verbose.set_level('debug') dvi = Dvi('foo.dvi', 72) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jr...@us...> - 2007-09-11 19:40:29
|
Revision: 3833 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3833&view=rev Author: jrevans Date: 2007-09-11 12:40:27 -0700 (Tue, 11 Sep 2007) Log Message: ----------- Added the ability for the following in the various GUI backends: >>> import pylab >>> fig = pylab.figure() >>> fig.canvas.set_window_title("My Plot Window") Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_qt.py trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_wx.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -1205,6 +1205,14 @@ def get_default_filetype(self): raise NotImplementedError + def set_window_title(self, title): + """ + Set the title text of the window containing the figure. Note that + this has no effect if there is no window (eg, a PS backend). + """ + if hasattr(self, "manager"): + self.manager.set_window_title(title) + def switch_backends(self, FigureCanvasClass): """ instantiate an instance of FigureCanvasClass @@ -1317,6 +1325,13 @@ """ pass + def set_window_title(self, title): + """ + Set the title text of the window containing the figure. Note that + this has no effect if there is no window (eg, a PS backend). + """ + pass + # cursors class Cursors: #namespace HAND, POINTER, SELECT_REGION, MOVE = range(4) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -299,6 +299,9 @@ self.canvas.draw() self.window.redraw() + def set_window_title(self, title): + self.window_title=title + self.window.label(title) class AxisMenu: def __init__(self, toolbar): Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -460,6 +460,8 @@ toolbar = None return toolbar + def set_window_title(self, title): + self.window.set_title(title) def resize(self, width, height): 'set the canvas size in pixels' Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -247,6 +247,9 @@ if DEBUG: print "destroy figure manager" self.window.close(True) + def set_window_title(self, title): + self.window.setCaption(title) + class NavigationToolbar2QT( NavigationToolbar2, qt.QWidget ): # list of toolitems to add to the toolbar, format is: # text, tooltip_text, image_file, callback(str) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -249,6 +249,9 @@ if DEBUG: print "destroy figure manager" self.window.close() + def set_window_title(self, title): + self.window.setWindowTitle(title) + class NavigationToolbar2QT( NavigationToolbar2, QtGui.QWidget ): # list of toolitems to add to the toolbar, format is: # text, tooltip_text, image_file, callback(str) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -349,6 +349,9 @@ pass self.window = None + def set_window_title(self, title): + self.window.wm_title(title) + class AxisMenu: def __init__(self, master, naxes): self._master = master Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2007-09-11 18:46:47 UTC (rev 3832) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2007-09-11 19:40:27 UTC (rev 3833) @@ -1399,6 +1399,9 @@ #wx.GetApp().ProcessIdle() wx.WakeUpIdle() + def set_window_title(self, title): + self.window.SetTitle(title) + # Identifiers for toolbar controls - images_wx contains bitmaps for the images # used in the controls. wxWindows does not provide any stock images, so I've # 'stolen' those from GTK2, and transformed them into the appropriate format. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ds...@us...> - 2007-09-11 18:46:50
|
Revision: 3832 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3832&view=rev Author: dsdale Date: 2007-09-11 11:46:47 -0700 (Tue, 11 Sep 2007) Log Message: ----------- removed MANIFEST from revision control. It is generated by MANIFEST.in when building source distribution archives Removed Paths: ------------- trunk/matplotlib/MANIFEST Deleted: trunk/matplotlib/MANIFEST =================================================================== --- trunk/matplotlib/MANIFEST 2007-09-11 17:57:47 UTC (rev 3831) +++ trunk/matplotlib/MANIFEST 2007-09-11 18:46:47 UTC (rev 3832) @@ -1,1398 +0,0 @@ -API_CHANGES -CHANGELOG -INSTALL -INTERACTIVE -KNOWN_BUGS -MANIFEST.in -Makefile -NUMARRAY_ISSUES -README -TODO -__init__.py -makeswig.py -matplotlibrc.template -setup.cfg -setup.py -setupegg.py -setupext.py -CXX/Config.hxx -CXX/Exception.hxx -CXX/Extensions.hxx -CXX/IndirectPythonInterface.cxx -CXX/IndirectPythonInterface.hxx -CXX/Objects.hxx -CXX/Version.hxx -CXX/cxx_extensions.cxx -CXX/cxxextensions.c -CXX/cxxsupport.cxx -agg23/font_freetype/Makefile.am -agg23/font_freetype/agg_font_freetype.cpp -agg23/font_freetype/agg_font_freetype.h -agg23/font_win32_tt/agg_font_win32_tt.cpp -agg23/font_win32_tt/agg_font_win32_tt.h -agg23/include/Makefile.am -agg23/include/agg_alpha_mask_u8.h -agg23/include/agg_arc.h -agg23/include/agg_array.h -agg23/include/agg_arrowhead.h -agg23/include/agg_basics.h -agg23/include/agg_bezier_arc.h -agg23/include/agg_bitset_iterator.h -agg23/include/agg_bounding_rect.h -agg23/include/agg_bspline.h -agg23/include/agg_clip_liang_barsky.h -agg23/include/agg_color_gray.h -agg23/include/agg_color_rgba.h -agg23/include/agg_config.h -agg23/include/agg_conv_adaptor_vcgen.h -agg23/include/agg_conv_adaptor_vpgen.h -agg23/include/agg_conv_bspline.h -agg23/include/agg_conv_clip_polygon.h -agg23/include/agg_conv_clip_polyline.h -agg23/include/agg_conv_close_polygon.h -agg23/include/agg_conv_concat.h -agg23/include/agg_conv_contour.h -agg23/include/agg_conv_curve.h -agg23/include/agg_conv_dash.h -agg23/include/agg_conv_gpc.h -agg23/include/agg_conv_marker.h -agg23/include/agg_conv_marker_adaptor.h -agg23/include/agg_conv_segmentator.h -agg23/include/agg_conv_shorten_path.h -agg23/include/agg_conv_smooth_poly1.h -agg23/include/agg_conv_stroke.h -agg23/include/agg_conv_transform.h -agg23/include/agg_conv_unclose_polygon.h -agg23/include/agg_curves.h -agg23/include/agg_dda_line.h -agg23/include/agg_ellipse.h -agg23/include/agg_ellipse_bresenham.h -agg23/include/agg_embedded_raster_fonts.h -agg23/include/agg_font_cache_manager.h -agg23/include/agg_gamma_functions.h -agg23/include/agg_gamma_lut.h -agg23/include/agg_glyph_raster_bin.h -agg23/include/agg_gsv_text.h -agg23/include/agg_image_filters.h -agg23/include/agg_line_aa_basics.h -agg23/include/agg_math.h -agg23/include/agg_math_stroke.h -agg23/include/agg_path_storage.h -agg23/include/agg_path_storage_integer.h -agg23/include/agg_pattern_filters_rgba.h -agg23/include/agg_pixfmt_amask_adaptor.h -agg23/include/agg_pixfmt_gray.h -agg23/include/agg_pixfmt_rgb.h -agg23/include/agg_pixfmt_rgb_packed.h -agg23/include/agg_pixfmt_rgba.h -agg23/include/agg_rasterizer_outline.h -agg23/include/agg_rasterizer_outline_aa.h -agg23/include/agg_rasterizer_scanline_aa.h -agg23/include/agg_render_scanlines.h -agg23/include/agg_renderer_base.h -agg23/include/agg_renderer_markers.h -agg23/include/agg_renderer_mclip.h -agg23/include/agg_renderer_outline_aa.h -agg23/include/agg_renderer_outline_image.h -agg23/include/agg_renderer_primitives.h -agg23/include/agg_renderer_raster_text.h -agg23/include/agg_renderer_scanline.h -agg23/include/agg_rendering_buffer.h -agg23/include/agg_rendering_buffer_dynarow.h -agg23/include/agg_rounded_rect.h -agg23/include/agg_scanline_bin.h -agg23/include/agg_scanline_boolean_algebra.h -agg23/include/agg_scanline_p.h -agg23/include/agg_scanline_storage_aa.h -agg23/include/agg_scanline_storage_bin.h -agg23/include/agg_scanline_u.h -agg23/include/agg_shorten_path.h -agg23/include/agg_simul_eq.h -agg23/include/agg_span_allocator.h -agg23/include/agg_span_converter.h -agg23/include/agg_span_generator.h -agg23/include/agg_span_gouraud.h -agg23/include/agg_span_gouraud_gray.h -agg23/include/agg_span_gouraud_rgba.h -agg23/include/agg_span_gradient.h -agg23/include/agg_span_gradient_alpha.h -agg23/include/agg_span_image_filter.h -agg23/include/agg_span_image_filter_gray.h -agg23/include/agg_span_image_filter_rgb.h -agg23/include/agg_span_image_filter_rgba.h -agg23/include/agg_span_image_resample.h -agg23/include/agg_span_image_resample_gray.h -agg23/include/agg_span_image_resample_rgb.h -agg23/include/agg_span_image_resample_rgba.h -agg23/include/agg_span_interpolator_adaptor.h -agg23/include/agg_span_interpolator_linear.h -agg23/include/agg_span_interpolator_persp.h -agg23/include/agg_span_interpolator_trans.h -agg23/include/agg_span_pattern.h -agg23/include/agg_span_pattern_filter_gray.h -agg23/include/agg_span_pattern_filter_rgb.h -agg23/include/agg_span_pattern_filter_rgba.h -agg23/include/agg_span_pattern_resample_gray.h -agg23/include/agg_span_pattern_resample_rgb.h -agg23/include/agg_span_pattern_resample_rgba.h -agg23/include/agg_span_pattern_rgb.h -agg23/include/agg_span_pattern_rgba.h -agg23/include/agg_span_solid.h -agg23/include/agg_span_subdiv_adaptor.h -agg23/include/agg_trans_affine.h -agg23/include/agg_trans_bilinear.h -agg23/include/agg_trans_double_path.h -agg23/include/agg_trans_lens.h -agg23/include/agg_trans_perspective.h -agg23/include/agg_trans_single_path.h -agg23/include/agg_trans_viewport.h -agg23/include/agg_trans_warp_magnifier.h -agg23/include/agg_vcgen_bspline.h -agg23/include/agg_vcgen_contour.h -agg23/include/agg_vcgen_dash.h -agg23/include/agg_vcgen_markers_term.h -agg23/include/agg_vcgen_smooth_poly1.h -agg23/include/agg_vcgen_stroke.h -agg23/include/agg_vcgen_vertex_sequence.h -agg23/include/agg_vertex_sequence.h -agg23/include/agg_vpgen_clip_polygon.h -agg23/include/agg_vpgen_clip_polyline.h -agg23/include/agg_vpgen_segmentator.h -agg23/include/ctrl/Makefile.am -agg23/include/ctrl/agg_bezier_ctrl.h -agg23/include/ctrl/agg_cbox_ctrl.h -agg23/include/ctrl/agg_ctrl.h -agg23/include/ctrl/agg_gamma_ctrl.h -agg23/include/ctrl/agg_gamma_spline.h -agg23/include/ctrl/agg_polygon_ctrl.h -agg23/include/ctrl/agg_rbox_ctrl.h -agg23/include/ctrl/agg_scale_ctrl.h -agg23/include/ctrl/agg_slider_ctrl.h -agg23/include/ctrl/agg_spline_ctrl.h -agg23/include/platform/Makefile.am -agg23/include/platform/agg_platform_support.h -agg23/include/platform/mac/agg_mac_pmap.h -agg23/include/platform/win32/agg_win32_bmp.h -agg23/include/util/Makefile.am -agg23/include/util/agg_color_conv.h -agg23/include/util/agg_color_conv_rgb16.h -agg23/include/util/agg_color_conv_rgb8.h -agg23/src/ChangeLog -agg23/src/Makefile -agg23/src/Makefile.am -agg23/src/agg_arc.cpp -agg23/src/agg_arrowhead.cpp -agg23/src/agg_bezier_arc.cpp -agg23/src/agg_bspline.cpp -agg23/src/agg_curves.cpp -agg23/src/agg_embedded_raster_fonts.cpp -agg23/src/agg_gsv_text.cpp -agg23/src/agg_image_filters.cpp -agg23/src/agg_line_aa_basics.cpp -agg23/src/agg_line_profile_aa.cpp -agg23/src/agg_path_storage.cpp -agg23/src/agg_rasterizer_scanline_aa.cpp -agg23/src/agg_rounded_rect.cpp -agg23/src/agg_sqrt_tables.cpp -agg23/src/agg_trans_affine.cpp -agg23/src/agg_trans_double_path.cpp -agg23/src/agg_trans_single_path.cpp -agg23/src/agg_trans_warp_magnifier.cpp -agg23/src/agg_vcgen_bspline.cpp -agg23/src/agg_vcgen_contour.cpp -agg23/src/agg_vcgen_dash.cpp -agg23/src/agg_vcgen_markers_term.cpp -agg23/src/agg_vcgen_smooth_poly1.cpp -agg23/src/agg_vcgen_stroke.cpp -agg23/src/agg_vpgen_clip_polygon.cpp -agg23/src/agg_vpgen_clip_polyline.cpp -agg23/src/agg_vpgen_segmentator.cpp -agg23/src/authors -agg23/src/autogen.sh -agg23/src/configure.in -agg23/src/copying -agg23/src/install -agg23/src/news -agg23/src/readme -agg23/src/ctrl/Makefile.am -agg23/src/ctrl/agg_bezier_ctrl.cpp -agg23/src/ctrl/agg_cbox_ctrl.cpp -agg23/src/ctrl/agg_gamma_ctrl.cpp -agg23/src/ctrl/agg_gamma_spline.cpp -agg23/src/ctrl/agg_polygon_ctrl.cpp -agg23/src/ctrl/agg_rbox_ctrl.cpp -agg23/src/ctrl/agg_scale_ctrl.cpp -agg23/src/ctrl/agg_slider_ctrl.cpp -agg23/src/ctrl/agg_spline_ctrl.cpp -agg23/src/platform/Makefile.am -agg23/src/platform/AmigaOS/agg_platform_support.cpp -agg23/src/platform/BeOS/agg_platform_support.cpp -agg23/src/platform/X11/Makefile.am -agg23/src/platform/X11/agg_platform_support.cpp -agg23/src/platform/mac/agg_mac_pmap.cpp -agg23/src/platform/mac/agg_platform_support.cpp -agg23/src/platform/sdl/agg_platform_support.cpp -agg23/src/platform/win32/agg_platform_support.cpp -agg23/src/platform/win32/agg_win32_bmp.cpp -agg23/svg/agg_svg_exception.h -agg23/svg/agg_svg_parser.cpp -agg23/svg/agg_svg_parser.h -agg23/svg/agg_svg_path_renderer.cpp -agg23/svg/agg_svg_path_renderer.h -agg23/svg/agg_svg_path_tokenizer.cpp -agg23/svg/agg_svg_path_tokenizer.h -agg23/svg/svg_test.cpp -agg23/svg/BeOS/Makefile -agg23/svg/X11/Makefile -agg23/svg/macos_cw/expat.h -agg23/svg/macos_cw/include.h -agg23/svg/macos_cw/xmlparse.h -agg23/svg/win32_api/Makefile -agg23/svg/win32_api/svg_test.dsp -agg23/svg/win32_api/svg_test.dsw -examples/README -examples/__init__.py -examples/accented_text.py -examples/agg_oo.py -examples/agg_resize.py -examples/agg_test.py -examples/alignment_test.py -examples/anim.py -examples/anim_tk.py -examples/animation_blit.py -examples/animation_blit_fltk.py -examples/animation_blit_qt.py -examples/animation_blit_qt4.py -examples/animation_blit_tk.py -examples/animation_blit_wx.py -examples/annotation_demo.py -examples/anscombe.py -examples/arctest.py -examples/arrow_demo.py -examples/axes_demo.py -examples/axes_props.py -examples/axhspan_demo.py -examples/axis_equal_demo.py -examples/backend_driver.py -examples/bar_stacked.py -examples/barchart_demo.py -examples/barcode_demo.py -examples/barh_demo.py -examples/boxplot_demo.py -examples/break.py -examples/broken_barh.py -examples/clippath_test.py -examples/clippedline.py -examples/collections_demo.py -examples/color_by_yvalue.py -examples/color_demo.py -examples/colours.py -examples/contour_demo.py -examples/contour_image.py -examples/contourf_demo.py -examples/coords_demo.py -examples/coords_report.py -examples/csd_demo.py -examples/cursor_demo.py -examples/custom_figure_class.py -examples/custom_ticker1.py -examples/customize_rc.py -examples/dannys_example.py -examples/dash_control.py -examples/dashpointlabel.py -examples/dashtick.py -examples/data_helper.py -examples/date_demo1.py -examples/date_demo2.py -examples/date_demo_convert.py -examples/date_demo_rrule.py -examples/dynamic_collection.py -examples/dynamic_demo.py -examples/dynamic_demo_wx.py -examples/dynamic_image_gtkagg.py -examples/dynamic_image_wxagg.py -examples/dynamic_image_wxagg2.py -examples/ellipse_demo.py -examples/ellipse_rotated.py -examples/embedding_in_gtk.py -examples/embedding_in_gtk2.py -examples/embedding_in_gtk3.py -examples/embedding_in_qt.py -examples/embedding_in_qt4.py -examples/embedding_in_tk.py -examples/embedding_in_tk2.py -examples/embedding_in_wx.py -examples/embedding_in_wx2.py -examples/embedding_in_wx3.py -examples/embedding_in_wx4.py -examples/errorbar_demo.py -examples/figimage_demo.py -examples/figlegend_demo.py -examples/figtext.py -examples/fill_between.py -examples/fill_between_posneg.py -examples/fill_demo.py -examples/fill_demo2.py -examples/fill_spiral.py -examples/finance_demo.py -examples/font_indexing.py -examples/font_table_ttf.py -examples/fonts_demo.py -examples/fonts_demo_kw.py -examples/ftface_props.py -examples/ganged_plots.py -examples/gdtest.py -examples/glyph_to_path.py -examples/gtk_spreadsheet.py -examples/hatch_demo.py -examples/histogram_demo.py -examples/histogram_demo_canvasagg.py -examples/image_demo.py -examples/image_demo2.py -examples/image_demo3.py -examples/image_demo_na.py -examples/image_interp.py -examples/image_masked.py -examples/image_origin.py -examples/integral_demo.py -examples/interactive.py -examples/interactive2.py -examples/interp_demo.py -examples/invert_axes.py -examples/keypress_demo.py -examples/lasso_demo.py -examples/layer_images.py -examples/legend_auto.py -examples/legend_demo.py -examples/legend_demo2.py -examples/legend_scatter.py -examples/line_collection.py -examples/line_collection2.py -examples/line_styles.py -examples/load_converter.py -examples/log_bar.py -examples/log_demo.py -examples/log_test.py -examples/logo.py -examples/major_minor_demo1.py -examples/major_minor_demo2.py -examples/masked_demo.py -examples/mathtext2_demo.py -examples/mathtext_demo.py -examples/matplotlib_icon.py -examples/matshow.py -examples/movie_demo.py -examples/mpl_with_glade.py -examples/mri_demo.py -examples/mri_with_eeg.py -examples/multi_image.py -examples/multiline.py -examples/multiple_figs_demo.py -examples/newscalarformatter_demo.py -examples/object_picker.py -examples/pcolor_demo.py -examples/pcolor_demo2.py -examples/pcolor_log.py -examples/pcolor_nonuniform.py -examples/pcolor_small.py -examples/pick_event_demo.py -examples/picker_demo.py -examples/pie_demo.py -examples/polar_bar.py -examples/polar_demo.py -examples/polar_legend.py -examples/polar_scatter.py -examples/poly_editor.py -examples/poormans_contour.py -examples/print_stdout.py -examples/printing_in_wx.py -examples/psd_demo.py -examples/pstest.py -examples/pylab_with_gtk.py -examples/pythonic_matplotlib.py -examples/quadmesh_demo.py -examples/quiver_demo.py -examples/scatter_custom_symbol.py -examples/scatter_demo.py -examples/scatter_demo2.py -examples/scatter_masked.py -examples/scatter_profile.py -examples/scatter_star_poly.py -examples/set_and_get.py -examples/shared_axis_demo.py -examples/simple3d.py -examples/simple3d_oo.py -examples/simple_plot.py -examples/specgram_demo.py -examples/spy_demos.py -examples/stem_plot.py -examples/stock_demo.py -examples/strip_chart_demo.py -examples/subplot_demo.py -examples/subplot_toolbar.py -examples/subplots_adjust.py -examples/system_monitor.py -examples/table_demo.py -examples/tex_demo.py -examples/text_handles.py -examples/text_rotation.py -examples/text_themes.py -examples/to_numeric.py -examples/toggle_images.py -examples/transoffset.py -examples/two_scales.py -examples/unicode_demo.py -examples/vertical_ticklabels.py -examples/vline_demo.py -examples/webapp_demo.py -examples/wxcursor_demo.py -examples/xcorr_demo.py -examples/zoom_window.py -examples/zorder_demo.py -examples/data/AAPL.dat -examples/data/INTC.dat -examples/data/ct.raw -examples/data/eeg.dat -examples/data/embedding_in_wx3.xrc -examples/data/intc.csv -examples/data/lena.jpg -examples/data/membrane.dat -examples/data/msft.csv -examples/data/s1045.ima -examples/units/__init__.py -examples/units/artist_tests.py -examples/units/bar_unit_demo.py -examples/units/basic_units.py -examples/units/date_converter.py -examples/units/date_support.py -examples/units/evans_test.py -examples/units/evans_test2.py -examples/units/radian_demo.py -examples/units/units_sample.py -examples/units/units_scatter.py -examples/widgets/README -examples/widgets/buttons.py -examples/widgets/check_buttons.py -examples/widgets/cursor.py -examples/widgets/multicursor.py -examples/widgets/radio_buttons.py -examples/widgets/rectangle_selector.py -examples/widgets/sliders.py -examples/widgets/span_selector.py -lib/pylab.py -lib/dateutil/__init__.py -lib/dateutil/easter.py -lib/dateutil/parser.py -lib/dateutil/relativedelta.py -lib/dateutil/rrule.py -lib/dateutil/tz.py -lib/matplotlib/.cvsignore -lib/matplotlib/__init__.py -lib/matplotlib/_cm.py -lib/matplotlib/_contour.py -lib/matplotlib/_image.py -lib/matplotlib/_mathtext_data.py -lib/matplotlib/_pylab_helpers.py -lib/matplotlib/_transforms.py -lib/matplotlib/afm.py -lib/matplotlib/agg.py -lib/matplotlib/art3d.py -lib/matplotlib/artist.py -lib/matplotlib/artist.py~ -lib/matplotlib/axes.py -lib/matplotlib/axes.py~ -lib/matplotlib/axes3d.py -lib/matplotlib/axis.py -lib/matplotlib/axis3d.py -lib/matplotlib/backend_bases.py -lib/matplotlib/cbook.py -lib/matplotlib/cm.py -lib/matplotlib/collections.py -lib/matplotlib/colorbar.py -lib/matplotlib/colors.py -lib/matplotlib/contour.py -lib/matplotlib/dates.py -lib/matplotlib/dviread.py -lib/matplotlib/figure.py -lib/matplotlib/finance.py -lib/matplotlib/font_manager.py -lib/matplotlib/image.py -lib/matplotlib/legend.py -lib/matplotlib/lines.py -lib/matplotlib/mathtext.py -lib/matplotlib/mathtext2.py -lib/matplotlib/mlab.py -lib/matplotlib/nxutils.py -lib/matplotlib/patches.py -lib/matplotlib/proj3d.py -lib/matplotlib/pylab.py -lib/matplotlib/pyparsing.py -lib/matplotlib/quiver.py -lib/matplotlib/table.py -lib/matplotlib/texmanager.py -lib/matplotlib/text.py -lib/matplotlib/ticker.py -lib/matplotlib/transforms.py -lib/matplotlib/units.py -lib/matplotlib/widgets.py -lib/matplotlib/windowing.py -lib/matplotlib/backends/.cvsignore -lib/matplotlib/backends/__init__.py -lib/matplotlib/backends/backend_agg.py -lib/matplotlib/backends/backend_agg2.py -lib/matplotlib/backends/backend_cairo.py -lib/matplotlib/backends/backend_cocoaagg.py -lib/matplotlib/backends/backend_emf.py -lib/matplotlib/backends/backend_fltkagg.py -lib/matplotlib/backends/backend_gd.py -lib/matplotlib/backends/backend_gdk.py -lib/matplotlib/backends/backend_gtk.py -lib/matplotlib/backends/backend_gtkagg.py -lib/matplotlib/backends/backend_gtkcairo.py -lib/matplotlib/backends/backend_paint.py -lib/matplotlib/backends/backend_pdf.py -lib/matplotlib/backends/backend_ps.py -lib/matplotlib/backends/backend_qt.py -lib/matplotlib/backends/backend_qt4.py -lib/matplotlib/backends/backend_qt4agg.py -lib/matplotlib/backends/backend_qtagg.py -lib/matplotlib/backends/backend_svg.py -lib/matplotlib/backends/backend_template.py -lib/matplotlib/backends/backend_tkagg.py -lib/matplotlib/backends/backend_wx.py -lib/matplotlib/backends/backend_wxagg.py -lib/matplotlib/backends/tkagg.py -lib/matplotlib/backends/Matplotlib.nib/classes.nib -lib/matplotlib/backends/Matplotlib.nib/info.nib -lib/matplotlib/backends/Matplotlib.nib/keyedobjects.nib -lib/matplotlib/enthought/__init__.py -lib/matplotlib/enthought/resource/__init__.py -lib/matplotlib/enthought/resource/resource_factory.py -lib/matplotlib/enthought/resource/resource_manager.py -lib/matplotlib/enthought/resource/resource_path.py -lib/matplotlib/enthought/resource/resource_reference.py -lib/matplotlib/enthought/traits/__init__.py -lib/matplotlib/enthought/traits/category.py -lib/matplotlib/enthought/traits/ctraits.c -lib/matplotlib/enthought/traits/has_traits.py -lib/matplotlib/enthought/traits/info_traits.py -lib/matplotlib/enthought/traits/standard.py -lib/matplotlib/enthought/traits/trait_base.py -lib/matplotlib/enthought/traits/trait_db.py -lib/matplotlib/enthought/traits/trait_errors.py -lib/matplotlib/enthought/traits/trait_handlers.py -lib/matplotlib/enthought/traits/trait_notifiers.py -lib/matplotlib/enthought/traits/trait_numeric.py -lib/matplotlib/enthought/traits/traits.py -lib/matplotlib/enthought/traits/ui/__init__.py -lib/matplotlib/enthought/traits/ui/editor.py -lib/matplotlib/enthought/traits/ui/editor_factory.py -lib/matplotlib/enthought/traits/ui/editors.py -lib/matplotlib/enthought/traits/ui/group.py -lib/matplotlib/enthought/traits/ui/handler.py -lib/matplotlib/enthought/traits/ui/help.py -lib/matplotlib/enthought/traits/ui/help_template.py -lib/matplotlib/enthought/traits/ui/helper.py -lib/matplotlib/enthought/traits/ui/include.py -lib/matplotlib/enthought/traits/ui/item.py -lib/matplotlib/enthought/traits/ui/menu.py -lib/matplotlib/enthought/traits/ui/toolkit.py -lib/matplotlib/enthought/traits/ui/tree_node.py -lib/matplotlib/enthought/traits/ui/ui.py -lib/matplotlib/enthought/traits/ui/ui_info.py -lib/matplotlib/enthought/traits/ui/ui_traits.py -lib/matplotlib/enthought/traits/ui/undo.py -lib/matplotlib/enthought/traits/ui/view.py -lib/matplotlib/enthought/traits/ui/view_element.py -lib/matplotlib/enthought/traits/ui/view_elements.py -lib/matplotlib/enthought/traits/ui/null/__init__.py -lib/matplotlib/enthought/traits/ui/null/color_trait.py -lib/matplotlib/enthought/traits/ui/null/font_trait.py -lib/matplotlib/enthought/traits/ui/null/rgb_color_trait.py -lib/matplotlib/enthought/traits/ui/null/rgba_color_trait.py -lib/matplotlib/enthought/traits/ui/null/toolkit.py -lib/matplotlib/enthought/util/__init__.py -lib/matplotlib/enthought/util/resource.py -lib/matplotlib/mpl-data/matplotlibrc -lib/matplotlib/mpl-data/fonts/afm/cmex10.afm -lib/matplotlib/mpl-data/fonts/afm/cmmi10.afm -lib/matplotlib/mpl-data/fonts/afm/cmr10.afm -lib/matplotlib/mpl-data/fonts/afm/cmsy10.afm -lib/matplotlib/mpl-data/fonts/afm/cmtt10.afm -lib/matplotlib/mpl-data/fonts/afm/pagd8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagdo8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagk8a.afm -lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkd8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkdi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkl8a.afm -lib/matplotlib/mpl-data/fonts/afm/pbkli8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrbo8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pcrro8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvb8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvb8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvbo8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvbo8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvl8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvlo8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvr8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvr8an.afm -lib/matplotlib/mpl-data/fonts/afm/phvro8a.afm -lib/matplotlib/mpl-data/fonts/afm/phvro8an.afm -lib/matplotlib/mpl-data/fonts/afm/pncb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pncri8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplb8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplr8a.afm -lib/matplotlib/mpl-data/fonts/afm/pplri8a.afm -lib/matplotlib/mpl-data/fonts/afm/psyr.afm -lib/matplotlib/mpl-data/fonts/afm/ptmb8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmr8a.afm -lib/matplotlib/mpl-data/fonts/afm/ptmri8a.afm -lib/matplotlib/mpl-data/fonts/afm/putb8a.afm -lib/matplotlib/mpl-data/fonts/afm/putbi8a.afm -lib/matplotlib/mpl-data/fonts/afm/putr8a.afm -lib/matplotlib/mpl-data/fonts/afm/putri8a.afm -lib/matplotlib/mpl-data/fonts/afm/pzcmi8a.afm -lib/matplotlib/mpl-data/fonts/afm/pzdr.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-BoldOblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier-Oblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Courier.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-BoldOblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica-Oblique.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Helvetica.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Symbol.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Bold.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-BoldItalic.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Italic.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/Times-Roman.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/ZapfDingbats.afm -lib/matplotlib/mpl-data/fonts/pdfcorefonts/readme.txt -lib/matplotlib/mpl-data/fonts/ttf/COPYRIGHT.TXT -lib/matplotlib/mpl-data/fonts/ttf/README.TXT -lib/matplotlib/mpl-data/fonts/ttf/RELEASENOTES.TXT -lib/matplotlib/mpl-data/fonts/ttf/Vera.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraBI.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraIt.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoBI.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMoIt.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraMono.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraSe.ttf -lib/matplotlib/mpl-data/fonts/ttf/VeraSeBd.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmex10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmmi10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmr10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmsy10.ttf -lib/matplotlib/mpl-data/fonts/ttf/cmtt10.ttf -lib/matplotlib/mpl-data/fonts/ttf/local.conf -lib/matplotlib/mpl-data/images/back.png -lib/matplotlib/mpl-data/images/back.ppm -lib/matplotlib/mpl-data/images/back.svg -lib/matplotlib/mpl-data/images/back.xpm -lib/matplotlib/mpl-data/images/filesave.png -lib/matplotlib/mpl-data/images/filesave.ppm -lib/matplotlib/mpl-data/images/filesave.svg -lib/matplotlib/mpl-data/images/filesave.xpm -lib/matplotlib/mpl-data/images/forward.png -lib/matplotlib/mpl-data/images/forward.ppm -lib/matplotlib/mpl-data/images/forward.svg -lib/matplotlib/mpl-data/images/forward.xpm -lib/matplotlib/mpl-data/images/hand.png -lib/matplotlib/mpl-data/images/hand.ppm -lib/matplotlib/mpl-data/images/hand.svg -lib/matplotlib/mpl-data/images/hand.xpm -lib/matplotlib/mpl-data/images/home.png -lib/matplotlib/mpl-data/images/home.ppm -lib/matplotlib/mpl-data/images/home.svg -lib/matplotlib/mpl-data/images/home.xpm -lib/matplotlib/mpl-data/images/matplotlib.png -lib/matplotlib/mpl-data/images/matplotlib.svg -lib/matplotlib/mpl-data/images/move.png -lib/matplotlib/mpl-data/images/move.ppm -lib/matplotlib/mpl-data/images/move.svg -lib/matplotlib/mpl-data/images/move.xpm -lib/matplotlib/mpl-data/images/stock_close.ppm -lib/matplotlib/mpl-data/images/stock_close.xpm -lib/matplotlib/mpl-data/images/stock_down.ppm -lib/matplotlib/mpl-data/images/stock_down.xpm -lib/matplotlib/mpl-data/images/stock_left.ppm -lib/matplotlib/mpl-data/images/stock_left.xpm -lib/matplotlib/mpl-data/images/stock_refresh.ppm -lib/matplotlib/mpl-data/images/stock_refresh.xpm -lib/matplotlib/mpl-data/images/stock_right.ppm -lib/matplotlib/mpl-data/images/stock_right.xpm -lib/matplotlib/mpl-data/images/stock_save_as.ppm -lib/matplotlib/mpl-data/images/stock_save_as.xpm -lib/matplotlib/mpl-data/images/stock_up.ppm -lib/matplotlib/mpl-data/images/stock_up.xpm -lib/matplotlib/mpl-data/images/stock_zoom-in.ppm -lib/matplotlib/mpl-data/images/stock_zoom-in.xpm -lib/matplotlib/mpl-data/images/stock_zoom-out.ppm -lib/matplotlib/mpl-data/images/stock_zoom-out.xpm -lib/matplotlib/mpl-data/images/subplots.png -lib/matplotlib/mpl-data/images/subplots.ppm -lib/matplotlib/mpl-data/images/subplots.xpm -lib/matplotlib/mpl-data/images/zoom_to_rect.png -lib/matplotlib/mpl-data/images/zoom_to_rect.ppm -lib/matplotlib/mpl-data/images/zoom_to_rect.svg -lib/matplotlib/mpl-data/images/zoom_to_rect.xpm -lib/matplotlib/numerix/.cvsignore -lib/matplotlib/numerix/__init__.py -lib/matplotlib/numerix/_na_imports.py -lib/matplotlib/numerix/_nc_imports.py -lib/matplotlib/numerix/_sp_imports.py -lib/matplotlib/numerix/fft/__init__.py -lib/matplotlib/numerix/linear_algebra/__init__.py -lib/matplotlib/numerix/ma/__init__.py -lib/matplotlib/numerix/mlab/.cvsignore -lib/matplotlib/numerix/mlab/__init__.py -lib/matplotlib/numerix/random_array/__init__.py -lib/matplotlib/toolkits/__init__.py -lib/pytz/__init__.py -lib/pytz/reference.py -lib/pytz/test_tzinfo.py -lib/pytz/tzinfo.py -lib/pytz/zoneinfo/CET.py -lib/pytz/zoneinfo/CST6CDT.py -lib/pytz/zoneinfo/Cuba.py -lib/pytz/zoneinfo/EET.py -lib/pytz/zoneinfo/EST.py -lib/pytz/zoneinfo/EST5EDT.py -lib/pytz/zoneinfo/Egypt.py -lib/pytz/zoneinfo/Eire.py -lib/pytz/zoneinfo/GB.py -lib/pytz/zoneinfo/GB_minus_Eire.py -lib/pytz/zoneinfo/GMT.py -lib/pytz/zoneinfo/GMT0.py -lib/pytz/zoneinfo/GMT_minus_0.py -lib/pytz/zoneinfo/GMT_plus_0.py -lib/pytz/zoneinfo/Greenwich.py -lib/pytz/zoneinfo/HST.py -lib/pytz/zoneinfo/Hongkong.py -lib/pytz/zoneinfo/Iceland.py -lib/pytz/zoneinfo/Iran.py -lib/pytz/zoneinfo/Israel.py -lib/pytz/zoneinfo/Jamaica.py -lib/pytz/zoneinfo/Japan.py -lib/pytz/zoneinfo/Kwajalein.py -lib/pytz/zoneinfo/Libya.py -lib/pytz/zoneinfo/MET.py -lib/pytz/zoneinfo/MST.py -lib/pytz/zoneinfo/MST7MDT.py -lib/pytz/zoneinfo/NZ.py -lib/pytz/zoneinfo/NZ_minus_CHAT.py -lib/pytz/zoneinfo/Navajo.py -lib/pytz/zoneinfo/PRC.py -lib/pytz/zoneinfo/PST8PDT.py -lib/pytz/zoneinfo/Poland.py -lib/pytz/zoneinfo/Portugal.py -lib/pytz/zoneinfo/ROC.py -lib/pytz/zoneinfo/ROK.py -lib/pytz/zoneinfo/Singapore.py -lib/pytz/zoneinfo/Turkey.py -lib/pytz/zoneinfo/UCT.py -lib/pytz/zoneinfo/UTC.py -lib/pytz/zoneinfo/Universal.py -lib/pytz/zoneinfo/WET.py -lib/pytz/zoneinfo/W_minus_SU.py -lib/pytz/zoneinfo/Zulu.py -lib/pytz/zoneinfo/__init__.py -lib/pytz/zoneinfo/posixrules.py -lib/pytz/zoneinfo/Africa/Abidjan.py -lib/pytz/zoneinfo/Africa/Accra.py -lib/pytz/zoneinfo/Africa/Addis_Ababa.py -lib/pytz/zoneinfo/Africa/Algiers.py -lib/pytz/zoneinfo/Africa/Asmera.py -lib/pytz/zoneinfo/Africa/Bamako.py -lib/pytz/zoneinfo/Africa/Bangui.py -lib/pytz/zoneinfo/Africa/Banjul.py -lib/pytz/zoneinfo/Africa/Bissau.py -lib/pytz/zoneinfo/Africa/Blantyre.py -lib/pytz/zoneinfo/Africa/Brazzaville.py -lib/pytz/zoneinfo/Africa/Bujumbura.py -lib/pytz/zoneinfo/Africa/Cairo.py -lib/pytz/zoneinfo/Africa/Casablanca.py -lib/pytz/zoneinfo/Africa/Ceuta.py -lib/pytz/zoneinfo/Africa/Conakry.py -lib/pytz/zoneinfo/Africa/Dakar.py -lib/pytz/zoneinfo/Africa/Dar_es_Salaam.py -lib/pytz/zoneinfo/Africa/Djibouti.py -lib/pytz/zoneinfo/Africa/Douala.py -lib/pytz/zoneinfo/Africa/El_Aaiun.py -lib/pytz/zoneinfo/Africa/Freetown.py -lib/pytz/zoneinfo/Africa/Gaborone.py -lib/pytz/zoneinfo/Africa/Harare.py -lib/pytz/zoneinfo/Africa/Johannesburg.py -lib/pytz/zoneinfo/Africa/Kampala.py -lib/pytz/zoneinfo/Africa/Khartoum.py -lib/pytz/zoneinfo/Africa/Kigali.py -lib/pytz/zoneinfo/Africa/Kinshasa.py -lib/pytz/zoneinfo/Africa/Lagos.py -lib/pytz/zoneinfo/Africa/Libreville.py -lib/pytz/zoneinfo/Africa/Lome.py -lib/pytz/zoneinfo/Africa/Luanda.py -lib/pytz/zoneinfo/Africa/Lubumbashi.py -lib/pytz/zoneinfo/Africa/Lusaka.py -lib/pytz/zoneinfo/Africa/Malabo.py -lib/pytz/zoneinfo/Africa/Maputo.py -lib/pytz/zoneinfo/Africa/Maseru.py -lib/pytz/zoneinfo/Africa/Mbabane.py -lib/pytz/zoneinfo/Africa/Mogadishu.py -lib/pytz/zoneinfo/Africa/Monrovia.py -lib/pytz/zoneinfo/Africa/Nairobi.py -lib/pytz/zoneinfo/Africa/Ndjamena.py -lib/pytz/zoneinfo/Africa/Niamey.py -lib/pytz/zoneinfo/Africa/Nouakchott.py -lib/pytz/zoneinfo/Africa/Ouagadougou.py -lib/pytz/zoneinfo/Africa/Porto_minus_Novo.py -lib/pytz/zoneinfo/Africa/Sao_Tome.py -lib/pytz/zoneinfo/Africa/Timbuktu.py -lib/pytz/zoneinfo/Africa/Tripoli.py -lib/pytz/zoneinfo/Africa/Tunis.py -lib/pytz/zoneinfo/Africa/Windhoek.py -lib/pytz/zoneinfo/Africa/__init__.py -lib/pytz/zoneinfo/America/Adak.py -lib/pytz/zoneinfo/America/Anchorage.py -lib/pytz/zoneinfo/America/Anguilla.py -lib/pytz/zoneinfo/America/Antigua.py -lib/pytz/zoneinfo/America/Araguaina.py -lib/pytz/zoneinfo/America/Aruba.py -lib/pytz/zoneinfo/America/Asuncion.py -lib/pytz/zoneinfo/America/Atka.py -lib/pytz/zoneinfo/America/Bahia.py -lib/pytz/zoneinfo/America/Barbados.py -lib/pytz/zoneinfo/America/Belem.py -lib/pytz/zoneinfo/America/Belize.py -lib/pytz/zoneinfo/America/Boa_Vista.py -lib/pytz/zoneinfo/America/Bogota.py -lib/pytz/zoneinfo/America/Boise.py -lib/pytz/zoneinfo/America/Buenos_Aires.py -lib/pytz/zoneinfo/America/Cambridge_Bay.py -lib/pytz/zoneinfo/America/Campo_Grande.py -lib/pytz/zoneinfo/America/Cancun.py -lib/pytz/zoneinfo/America/Caracas.py -lib/pytz/zoneinfo/America/Catamarca.py -lib/pytz/zoneinfo/America/Cayenne.py -lib/pytz/zoneinfo/America/Cayman.py -lib/pytz/zoneinfo/America/Chicago.py -lib/pytz/zoneinfo/America/Chihuahua.py -lib/pytz/zoneinfo/America/Cordoba.py -lib/pytz/zoneinfo/America/Costa_Rica.py -lib/pytz/zoneinfo/America/Cuiaba.py -lib/pytz/zoneinfo/America/Curacao.py -lib/pytz/zoneinfo/America/Danmarkshavn.py -lib/pytz/zoneinfo/America/Dawson.py -lib/pytz/zoneinfo/America/Dawson_Creek.py -lib/pytz/zoneinfo/America/Denver.py -lib/pytz/zoneinfo/America/Detroit.py -lib/pytz/zoneinfo/America/Dominica.py -lib/pytz/zoneinfo/America/Edmonton.py -lib/pytz/zoneinfo/America/Eirunepe.py -lib/pytz/zoneinfo/America/El_Salvador.py -lib/pytz/zoneinfo/America/Ensenada.py -lib/pytz/zoneinfo/America/Fort_Wayne.py -lib/pytz/zoneinfo/America/Fortaleza.py -lib/pytz/zoneinfo/America/Glace_Bay.py -lib/pytz/zoneinfo/America/Godthab.py -lib/pytz/zoneinfo/America/Goose_Bay.py -lib/pytz/zoneinfo/America/Grand_Turk.py -lib/pytz/zoneinfo/America/Grenada.py -lib/pytz/zoneinfo/America/Guadeloupe.py -lib/pytz/zoneinfo/America/Guatemala.py -lib/pytz/zoneinfo/America/Guayaquil.py -lib/pytz/zoneinfo/America/Guyana.py -lib/pytz/zoneinfo/America/Halifax.py -lib/pytz/zoneinfo/America/Havana.py -lib/pytz/zoneinfo/America/Hermosillo.py -lib/pytz/zoneinfo/America/Indianapolis.py -lib/pytz/zoneinfo/America/Inuvik.py -lib/pytz/zoneinfo/America/Iqaluit.py -lib/pytz/zoneinfo/America/Jamaica.py -lib/pytz/zoneinfo/America/Jujuy.py -lib/pytz/zoneinfo/America/Juneau.py -lib/pytz/zoneinfo/America/Knox_IN.py -lib/pytz/zoneinfo/America/La_Paz.py -lib/pytz/zoneinfo/America/Lima.py -lib/pytz/zoneinfo/America/Los_Angeles.py -lib/pytz/zoneinfo/America/Louisville.py -lib/pytz/zoneinfo/America/Maceio.py -lib/pytz/zoneinfo/America/Managua.py -lib/pytz/zoneinfo/America/Manaus.py -lib/pytz/zoneinfo/America/Martinique.py -lib/pytz/zoneinfo/America/Mazatlan.py -lib/pytz/zoneinfo/America/Mendoza.py -lib/pytz/zoneinfo/America/Menominee.py -lib/pytz/zoneinfo/America/Merida.py -lib/pytz/zoneinfo/America/Mexico_City.py -lib/pytz/zoneinfo/America/Miquelon.py -lib/pytz/zoneinfo/America/Monterrey.py -lib/pytz/zoneinfo/America/Montevideo.py -lib/pytz/zoneinfo/America/Montreal.py -lib/pytz/zoneinfo/America/Montserrat.py -lib/pytz/zoneinfo/America/Nassau.py -lib/pytz/zoneinfo/America/New_York.py -lib/pytz/zoneinfo/America/Nipigon.py -lib/pytz/zoneinfo/America/Nome.py -lib/pytz/zoneinfo/America/Noronha.py -lib/pytz/zoneinfo/America/Panama.py -lib/pytz/zoneinfo/America/Pangnirtung.py -lib/pytz/zoneinfo/America/Paramaribo.py -lib/pytz/zoneinfo/America/Phoenix.py -lib/pytz/zoneinfo/America/Port_minus_au_minus_Prince.py -lib/pytz/zoneinfo/America/Port_of_Spain.py -lib/pytz/zoneinfo/America/Porto_Acre.py -lib/pytz/zoneinfo/America/Porto_Velho.py -lib/pytz/zoneinfo/America/Puerto_Rico.py -lib/pytz/zoneinfo/America/Rainy_River.py -lib/pytz/zoneinfo/America/Rankin_Inlet.py -lib/pytz/zoneinfo/America/Recife.py -lib/pytz/zoneinfo/America/Regina.py -lib/pytz/zoneinfo/America/Rio_Branco.py -lib/pytz/zoneinfo/America/Rosario.py -lib/pytz/zoneinfo/America/Santiago.py -lib/pytz/zoneinfo/America/Santo_Domingo.py -lib/pytz/zoneinfo/America/Sao_Paulo.py -lib/pytz/zoneinfo/America/Scoresbysund.py -lib/pytz/zoneinfo/America/Shiprock.py -lib/pytz/zoneinfo/America/St_Johns.py -lib/pytz/zoneinfo/America/St_Kitts.py -lib/pytz/zoneinfo/America/St_Lucia.py -lib/pytz/zoneinfo/America/St_Thomas.py -lib/pytz/zoneinfo/America/St_Vincent.py -lib/pytz/zoneinfo/America/Swift_Current.py -lib/pytz/zoneinfo/America/Tegucigalpa.py -lib/pytz/zoneinfo/America/Thule.py -lib/pytz/zoneinfo/America/Thunder_Bay.py -lib/pytz/zoneinfo/America/Tijuana.py -lib/pytz/zoneinfo/America/Toronto.py -lib/pytz/zoneinfo/America/Tortola.py -lib/pytz/zoneinfo/America/Vancouver.py -lib/pytz/zoneinfo/America/Virgin.py -lib/pytz/zoneinfo/America/Whitehorse.py -lib/pytz/zoneinfo/America/Winnipeg.py -lib/pytz/zoneinfo/America/Yakutat.py -lib/pytz/zoneinfo/America/Yellowknife.py -lib/pytz/zoneinfo/America/__init__.py -lib/pytz/zoneinfo/America/Argentina/Buenos_Aires.py -lib/pytz/zoneinfo/America/Argentina/Catamarca.py -lib/pytz/zoneinfo/America/Argentina/ComodRivadavia.py -lib/pytz/zoneinfo/America/Argentina/Cordoba.py -lib/pytz/zoneinfo/America/Argentina/Jujuy.py -lib/pytz/zoneinfo/America/Argentina/La_Rioja.py -lib/pytz/zoneinfo/America/Argentina/Mendoza.py -lib/pytz/zoneinfo/America/Argentina/Rio_Gallegos.py -lib/pytz/zoneinfo/America/Argentina/San_Juan.py -lib/pytz/zoneinfo/America/Argentina/Tucuman.py -lib/pytz/zoneinfo/America/Argentina/Ushuaia.py -lib/pytz/zoneinfo/America/Argentina/__init__.py -lib/pytz/zoneinfo/America/Indiana/Indianapolis.py -lib/pytz/zoneinfo/America/Indiana/Knox.py -lib/pytz/zoneinfo/America/Indiana/Marengo.py -lib/pytz/zoneinfo/America/Indiana/Vevay.py -lib/pytz/zoneinfo/America/Indiana/__init__.py -lib/pytz/zoneinfo/America/Kentucky/Louisville.py -lib/pytz/zoneinfo/America/Kentucky/Monticello.py -lib/pytz/zoneinfo/America/Kentucky/__init__.py -lib/pytz/zoneinfo/America/North_Dakota/Center.py -lib/pytz/zoneinfo/America/North_Dakota/__init__.py -lib/pytz/zoneinfo/Antarctica/Casey.py -lib/pytz/zoneinfo/Antarctica/Davis.py -lib/pytz/zoneinfo/Antarctica/DumontDUrville.py -lib/pytz/zoneinfo/Antarctica/Mawson.py -lib/pytz/zoneinfo/Antarctica/McMurdo.py -lib/pytz/zoneinfo/Antarctica/Palmer.py -lib/pytz/zoneinfo/Antarctica/Rothera.py -lib/pytz/zoneinfo/Antarctica/South_Pole.py -lib/pytz/zoneinfo/Antarctica/Syowa.py -lib/pytz/zoneinfo/Antarctica/Vostok.py -lib/pytz/zoneinfo/Antarctica/__init__.py -lib/pytz/zoneinfo/Arctic/Longyearbyen.py -lib/pytz/zoneinfo/Arctic/__init__.py -lib/pytz/zoneinfo/Asia/Aden.py -lib/pytz/zoneinfo/Asia/Almaty.py -lib/pytz/zoneinfo/Asia/Amman.py -lib/pytz/zoneinfo/Asia/Anadyr.py -lib/pytz/zoneinfo/Asia/Aqtau.py -lib/pytz/zoneinfo/Asia/Aqtobe.py -lib/pytz/zoneinfo/Asia/Ashgabat.py -lib/pytz/zoneinfo/Asia/Ashkhabad.py -lib/pytz/zoneinfo/Asia/Baghdad.py -lib/pytz/zoneinfo/Asia/Bahrain.py -lib/pytz/zoneinfo/Asia/Baku.py -lib/pytz/zoneinfo/Asia/Bangkok.py -lib/pytz/zoneinfo/Asia/Beirut.py -lib/pytz/zoneinfo/Asia/Bishkek.py -lib/pytz/zoneinfo/Asia/Brunei.py -lib/pytz/zoneinfo/Asia/Calcutta.py -lib/pytz/zoneinfo/Asia/Choibalsan.py -lib/pytz/zoneinfo/Asia/Chongqing.py -lib/pytz/zoneinfo/Asia/Chungking.py -lib/pytz/zoneinfo/Asia/Colombo.py -lib/pytz/zoneinfo/Asia/Dacca.py -lib/pytz/zoneinfo/Asia/Damascus.py -lib/pytz/zoneinfo/Asia/Dhaka.py -lib/pytz/zoneinfo/Asia/Dili.py -lib/pytz/zoneinfo/Asia/Dubai.py -lib/pytz/zoneinfo/Asia/Dushanbe.py -lib/pytz/zoneinfo/Asia/Gaza.py -lib/pytz/zoneinfo/Asia/Harbin.py -lib/pytz/zoneinfo/Asia/Hong_Kong.py -lib/pytz/zoneinfo/Asia/Hovd.py -lib/pytz/zoneinfo/Asia/Irkutsk.py -lib/pytz/zoneinfo/Asia/Istanbul.py -lib/pytz/zoneinfo/Asia/Jakarta.py -lib/pytz/zoneinfo/Asia/Jayapura.py -lib/pytz/zoneinfo/Asia/Jerusalem.py -lib/pytz/zoneinfo/Asia/Kabul.py -lib/pytz/zoneinfo/Asia/Kamchatka.py -lib/pytz/zoneinfo/Asia/Karachi.py -lib/pytz/zoneinfo/Asia/Kashgar.py -lib/pytz/zoneinfo/Asia/Katmandu.py -lib/pytz/zoneinfo/Asia/Krasnoyarsk.py -lib/pytz/zoneinfo/Asia/Kuala_Lumpur.py -lib/pytz/zoneinfo/Asia/Kuching.py -lib/pytz/zoneinfo/Asia/Kuwait.py -lib/pytz/zoneinfo/Asia/Macao.py -lib/pytz/zoneinfo/Asia/Macau.py -lib/pytz/zoneinfo/Asia/Magadan.py -lib/pytz/zoneinfo/Asia/Makassar.py -lib/pytz/zoneinfo/Asia/Manila.py -lib/pytz/zoneinfo/Asia/Muscat.py -lib/pytz/zoneinfo/Asia/Nicosia.py -lib/pytz/zoneinfo/Asia/Novosibirsk.py -lib/pytz/zoneinfo/Asia/Omsk.py -lib/pytz/zoneinfo/Asia/Oral.py -lib/pytz/zoneinfo/Asia/Phnom_Penh.py -lib/pytz/zoneinfo/Asia/Pontianak.py -lib/pytz/zoneinfo/Asia/Pyongyang.py -lib/pytz/zoneinfo/Asia/Qatar.py -lib/pytz/zoneinfo/Asia/Qyzylorda.py -lib/pytz/zoneinfo/Asia/Rangoon.py -lib/pytz/zoneinfo/Asia/Riyadh.py -lib/pytz/zoneinfo/Asia/Saigon.py -lib/pytz/zoneinfo/Asia/Sakhalin.py -lib/pytz/zoneinfo/Asia/Samarkand.py -lib/pytz/zoneinfo/Asia/Seoul.py -lib/pytz/zoneinfo/Asia/Shanghai.py -lib/pytz/zoneinfo/Asia/Singapore.py -lib/pytz/zoneinfo/Asia/Taipei.py -lib/pytz/zoneinfo/Asia/Tashkent.py -lib/pytz/zoneinfo/Asia/Tbilisi.py -lib/pytz/zoneinfo/Asia/Tehran.py -lib/pytz/zoneinfo/Asia/Tel_Aviv.py -lib/pytz/zoneinfo/Asia/Thimbu.py -lib/pytz/zoneinfo/Asia/Thimphu.py -lib/pytz/zoneinfo/Asia/Tokyo.py -lib/pytz/zoneinfo/Asia/Ujung_Pandang.py -lib/pytz/zoneinfo/Asia/Ulaanbaatar.py -lib/pytz/zoneinfo/Asia/Ulan_Bator.py -lib/pytz/zoneinfo/Asia/Urumqi.py -lib/pytz/zoneinfo/Asia/Vientiane.py -lib/pytz/zoneinfo/Asia/Vladivostok.py -lib/pytz/zoneinfo/Asia/Yakutsk.py -lib/pytz/zoneinfo/Asia/Yekaterinburg.py -lib/pytz/zoneinfo/Asia/Yerevan.py -lib/pytz/zoneinfo/Asia/__init__.py -lib/pytz/zoneinfo/Atlantic/Azores.py -lib/pytz/zoneinfo/Atlantic/Bermuda.py -lib/pytz/zoneinfo/Atlantic/Canary.py -lib/pytz/zoneinfo/Atlantic/Cape_Verde.py -lib/pytz/zoneinfo/Atlantic/Faeroe.py -lib/pytz/zoneinfo/Atlantic/Jan_Mayen.py -lib/pytz/zoneinfo/Atlantic/Madeira.py -lib/pytz/zoneinfo/Atlantic/Reykjavik.py -lib/pytz/zoneinfo/Atlantic/South_Georgia.py -lib/pytz/zoneinfo/Atlantic/St_Helena.py -lib/pytz/zoneinfo/Atlantic/Stanley.py -lib/pytz/zoneinfo/Atlantic/__init__.py -lib/pytz/zoneinfo/Australia/ACT.py -lib/pytz/zoneinfo/Australia/Adelaide.py -lib/pytz/zoneinfo/Australia/Brisbane.py -lib/pytz/zoneinfo/Australia/Broken_Hill.py -lib/pytz/zoneinfo/Australia/Canberra.py -lib/pytz/zoneinfo/Australia/Darwin.py -lib/pytz/zoneinfo/Australia/Hobart.py -lib/pytz/zoneinfo/Australia/LHI.py -lib/pytz/zoneinfo/Australia/Lindeman.py -lib/pytz/zoneinfo/Australia/Lord_Howe.py -lib/pytz/zoneinfo/Australia/Melbourne.py -lib/pytz/zoneinfo/Australia/NSW.py -lib/pytz/zoneinfo/Australia/North.py -lib/pytz/zoneinfo/Australia/Perth.py -lib/pytz/zoneinfo/Australia/Queensland.py -lib/pytz/zoneinfo/Australia/South.py -lib/pytz/zoneinfo/Australia/Sydney.py -lib/pytz/zoneinfo/Australia/Tasmania.py -lib/pytz/zoneinfo/Australia/Victoria.py -lib/pytz/zoneinfo/Australia/West.py -lib/pytz/zoneinfo/Australia/Yancowinna.py -lib/pytz/zoneinfo/Australia/__init__.py -lib/pytz/zoneinfo/Brazil/Acre.py -lib/pytz/zoneinfo/Brazil/DeNoronha.py -lib/pytz/zoneinfo/Brazil/East.py -lib/pytz/zoneinfo/Brazil/West.py -lib/pytz/zoneinfo/Brazil/__init__.py -lib/pytz/zoneinfo/Canada/Atlantic.py -lib/pytz/zoneinfo/Canada/Central.py -lib/pytz/zoneinfo/Canada/East_minus_Saskatchewan.py -lib/pytz/zoneinfo/Canada/Eastern.py -lib/pytz/zoneinfo/Canada/Mountain.py -lib/pytz/zoneinfo/Canada/Newfoundland.py -lib/pytz/zoneinfo/Canada/Pacific.py -lib/pytz/zoneinfo/Canada/Saskatchewan.py -lib/pytz/zoneinfo/Canada/Yukon.py -lib/pytz/zoneinfo/Canada/__init__.py -lib/pytz/zoneinfo/Chile/Continental.py -lib/pytz/zoneinfo/Chile/EasterIsland.py -lib/pytz/zoneinfo/Chile/__init__.py -lib/pytz/zoneinfo/Etc/GMT.py -lib/pytz/zoneinfo/Etc/GMT0.py -lib/pytz/zoneinfo/Etc/GMT_minus_0.py -lib/pytz/zoneinfo/Etc/GMT_minus_1.py -lib/pytz/zoneinfo/Etc/GMT_minus_10.py -lib/pytz/zoneinfo/Etc/GMT_minus_11.py -lib/pytz/zoneinfo/Etc/GMT_minus_12.py -lib/pytz/zoneinfo/Etc/GMT_minus_13.py -lib/pytz/zoneinfo/Etc/GMT_minus_14.py -lib/pytz/zoneinfo/Etc/GMT_minus_2.py -lib/pytz/zoneinfo/Etc/GMT_minus_3.py -lib/pytz/zoneinfo/Etc/GMT_minus_4.py -lib/pytz/zoneinfo/Etc/GMT_minus_5.py -lib/pytz/zoneinfo/Etc/GMT_minus_6.py -lib/pytz/zoneinfo/Etc/GMT_minus_7.py -lib/pytz/zoneinfo/Etc/GMT_minus_8.py -lib/pytz/zoneinfo/Etc/GMT_minus_9.py -lib/pytz/zoneinfo/Etc/GMT_plus_0.py -lib/pytz/zoneinfo/Etc/GMT_plus_1.py -lib/pytz/zoneinfo/Etc/GMT_plus_10.py -lib/pytz/zoneinfo/Etc/GMT_plus_11.py -lib/pytz/zoneinfo/Etc/GMT_plus_12.py -lib/pytz/zoneinfo/Etc/GMT_plus_2.py -lib/pytz/zoneinfo/Etc/GMT_plus_3.py -lib/pytz/zoneinfo/Etc/GMT_plus_4.py -lib/pytz/zoneinfo/Etc/GMT_plus_5.py -lib/pytz/zoneinfo/Etc/GMT_plus_6.py -lib/pytz/zoneinfo/Etc/GMT_plus_7.py -lib/pytz/zoneinfo/Etc/GMT_plus_8.py -lib/pytz/zoneinfo/Etc/GMT_plus_9.py -lib/pytz/zoneinfo/Etc/Greenwich.py -lib/pytz/zoneinfo/Etc/UCT.py -lib/pytz/zoneinfo/Etc/UTC.py -lib/pytz/zoneinfo/Etc/Universal.py -lib/pytz/zoneinfo/Etc/Zulu.py -lib/pytz/zoneinfo/Etc/__init__.py -lib/pytz/zoneinfo/Europe/Amsterdam.py -lib/pytz/zoneinfo/Europe/Andorra.py -lib/pytz/zoneinfo/Europe/Athens.py -lib/pytz/zoneinfo/Europe/Belfast.py -lib/pytz/zoneinfo/Europe/Belgrade.py -lib/pytz/zoneinfo/Europe/Berlin.py -lib/pytz/zoneinfo/Europe/Bratislava.py -lib/pytz/zoneinfo/Europe/Brussels.py -lib/pytz/zoneinfo/Europe/Bucharest.py -lib/pytz/zoneinfo/Europe/Budapest.py -lib/pytz/zoneinfo/Europe/Chisinau.py -lib/pytz/zoneinfo/Europe/Copenhagen.py -lib/pytz/zoneinfo/Europe/Dublin.py -lib/pytz/zoneinfo/Europe/Gibraltar.py -lib/pytz/zoneinfo/Europe/Helsinki.py -lib/pytz/zoneinfo/Europe/Istanbul.py -lib/pytz/zoneinfo/Europe/Kaliningrad.py -lib/pytz/zoneinfo/Europe/Kiev.py -lib/pytz/zoneinfo/Europe/Lisbon.py -lib/pytz/zoneinfo/Europe/Ljubljana.py -lib/pytz/zoneinfo/Europe/London.py -lib/pytz/zoneinfo/Europe/Luxembourg.py -lib/pytz/zoneinfo/Europe/Madrid.py -lib/pytz/zoneinfo/Europe/Malta.py -lib/pytz/zoneinfo/Europe/Mariehamn.py -lib/pytz/zoneinfo/Europe/Minsk.py -lib/pytz/zoneinfo/Europe/Monaco.py -lib/pytz/zoneinfo/Europe/Moscow.py -lib/pytz/zoneinfo/Europe/Nicosia.py -lib/pytz/zoneinfo/Europe/Oslo.py -lib/pytz/zoneinfo/Europe/Paris.py -lib/pytz/zoneinfo/Europe/Prague.py -lib/pytz/zoneinfo/Europe/Riga.py -lib/pytz/zoneinfo/Europe/Rome.py -lib/pytz/zoneinfo/Europe/Samara.py -lib/pytz/zoneinfo/Europe/San_Marino.py -lib/pytz/zoneinfo/Europe/Sarajevo.py -lib/pytz/zoneinfo/Europe/Simferopol.py -lib/pytz/zoneinfo/Europe/Skopje.py -lib/pytz/zoneinfo/Europe/Sofia.py -lib/pytz/zoneinfo/Europe/Stockholm.py -lib/pytz/zoneinfo/Europe/Tallinn.py -lib/pytz/zoneinfo/Europe/Tirane.py -lib/pytz/zoneinfo/Europe/Tiraspol.py -lib/pytz/zoneinfo/Europe/Uzhgorod.py -lib/pytz/zoneinfo/Europe/Vaduz.py -lib/pytz/zoneinfo/Europe/Vatican.py -lib/pytz/zoneinfo/Europe/Vienna.py -lib/pytz/zoneinfo/Europe/Vilnius.py -lib/pytz/zoneinfo/Europe/Warsaw.py -lib/pytz/zoneinfo/Europe/Zagreb.py -lib/pytz/zoneinfo/Europe/Zaporozhye.py -lib/pytz/zoneinfo/Europe/Zurich.py -lib/pytz/zoneinfo/Europe/__init__.py -lib/pytz/zoneinfo/Indian/Antananarivo.py -lib/pytz/zoneinfo/Indian/Chagos.py -lib/pytz/zoneinfo/Indian/Christmas.py -lib/pytz/zoneinfo/Indian/Cocos.py -lib/pytz/zoneinfo/Indian/Comoro.py -lib/pytz/zoneinfo/Indian/Kerguelen.py -lib/pytz/zoneinfo/Indian/Mahe.py -lib/pytz/zoneinfo/Indian/Maldives.py -lib/pytz/zoneinfo/Indian/Mauritius.py -lib/pytz/zoneinfo/Indian/Mayotte.py -lib/pytz/zoneinfo/Indian/Reunion.py -lib/pytz/zoneinfo/Indian/__init__.py -lib/pytz/zoneinfo/Mexico/BajaNorte.py -lib/pytz/zoneinfo/Mexico/BajaSur.py -lib/pytz/zoneinfo/Mexico/General.py -lib/pytz/zoneinfo/Mexico/__init__.py -lib/pytz/zoneinfo/Pacific/Apia.py -lib/pytz/zoneinfo/Pacific/Auckland.py -lib/pytz/zoneinfo/Pacific/Chatham.py -lib/pytz/zoneinfo/Pacific/Easter.py -lib/pytz/zoneinfo/Pacific/Efate.py -lib/pytz/zoneinfo/Pacific/Enderbury.py -lib/pytz/zoneinfo/Pacific/Fakaofo.py -lib/pytz/zoneinfo/Pacific/Fiji.py -lib/pytz/zoneinfo/Pacific/Funafuti.py -lib/pytz/zoneinfo/Pacific/Galapagos.py -lib/pytz/zoneinfo/Pacific/Gambier.py -lib/pytz/zoneinfo/Pacific/Guadalcanal.py -lib/pytz/zoneinfo/Pacific/Guam.py -lib/pytz/zoneinfo/Pacific/Honolulu.py -lib/pytz/zoneinfo/Pacific/Johnston.py -lib/pytz/zoneinfo/Pacific/Kiritimati.py -lib/pytz/zoneinfo/Pacific/Kosrae.py -lib/pytz/zoneinfo/Pacific/Kwajalein.py -lib/pytz/zoneinfo/Pacific/Majuro.py -lib/pytz/zoneinfo/Pacific/Marquesas.py -lib/pytz/zoneinfo/Pacific/Midway.py -lib/pytz/zoneinfo/Pacific/Nauru.py -lib/pytz/zoneinfo/Pacific/Niue.py -lib/pytz/zoneinfo/Pacific/Norfolk.py -lib/pytz/zoneinfo/Pacific/Noumea.py -lib/pytz/zoneinfo/Pacific/Pago_Pago.py -lib/pytz/zoneinfo/Pacific/Palau.py -lib/pytz/zoneinfo/Pacific/Pitcairn.py -lib/pytz/zoneinfo/Pacific/Ponape.py -lib/pytz/zoneinfo/Pacific/Port_Moresby.py -lib/pytz/zoneinfo/Pacific/Rarotonga.py -lib/pytz/zoneinfo/Pacific/Saipan.py -lib/pytz/zoneinfo/Pacific/Samoa.py -lib/pytz/zoneinfo/Pacific/Tahiti.py -lib/pytz/zoneinfo/Pacific/Tarawa.py -lib/pytz/zoneinfo/Pacific/Tongatapu.py -lib/pytz/zoneinfo/Pacific/Truk.py -lib/pytz/zoneinfo/Pacific/Wake.py -lib/pytz/zoneinfo/Pacific/Wallis.py -lib/pytz/zoneinfo/Pacific/Yap.py -lib/pytz/zoneinfo/Pacific/__init__.py -lib/pytz/zoneinfo/SystemV/AST4.py -lib/pytz/zoneinfo/SystemV/AST4ADT.py -lib/pytz/zoneinfo/SystemV/CST6.py -lib/pytz/zoneinfo/SystemV/CST6CDT.py -lib/pytz/zoneinfo/SystemV/EST5.py -lib/pytz/zoneinfo/SystemV/EST5EDT.py -lib/pytz/zoneinfo/SystemV/HST10.py -lib/pytz/zoneinfo/SystemV/MST7.py -lib/pytz/zoneinfo/SystemV/MST7MDT.py -lib/pytz/zoneinfo/SystemV/PST8.py -lib/pytz/zoneinfo/SystemV/PST8PDT.py -lib/pytz/zoneinfo/SystemV/YST9.py -lib/pytz/zoneinfo/SystemV/YST9YDT.py -lib/pytz/zoneinfo/SystemV/__init__.py -lib/pytz/zoneinfo/US/Alaska.py -lib/pytz/zoneinfo/US/Aleutian.py -lib/pytz/zoneinfo/US/Arizona.py -lib/pytz/zoneinfo/US/Central.py -lib/pytz/zoneinfo/US/East_minus_Indiana.py -lib/pytz/zoneinfo/US/Eastern.py -lib/pytz/zoneinfo/US/Hawaii.py -lib/pytz/zoneinfo/US/Indiana_minus_Starke.py -lib/pytz/zoneinfo/US/Michigan.py -lib/pytz/zoneinfo/US/Mountain.py -lib/pytz/zoneinfo/US/Pacific.py -lib/pytz/zoneinfo/US/Pacific_minus_New.py -lib/pytz/zoneinfo/US/Samoa.py -lib/pytz/zoneinfo/US/__init__.py -lib/subprocess/__init__.py -lib/subprocess/subprocess.py -license/DATEUTIL_LICENSE.txt -license/LICENSE -license/LICENSE_BAKOMA -license/LICENSE_COLORBREWER -license/LICENSE_PAINT -license/LICENSE_PIL -license/LICENSE_YORICK -license/LICENSE_enthought.txt -license/PYTZ_LICENSE.txt -src/MPL_isnan.h -src/_backend_agg.cpp -src/_backend_agg.h -src/_backend_gdk.c -src/_gtkagg.cpp -src/_image.cpp -src/_image.h -src/_isnan.c -src/_na_backend_agg.cpp -src/_na_backend_gdk.c -src/_na_cntr.c -src/_na_image.cpp -src/_na_nxutils.c -src/_na_transforms.cpp -src/_nc_backend_agg.cpp -src/_nc_backend_gdk.c -src/_nc_cntr.c -src/_nc_image.cpp -src/_nc_nxutils.c -src/_nc_transforms.cpp -src/_ns_backend_agg.cpp -src/_ns_backend_gdk.c -src/_ns_cntr.c -src/_ns_image.cpp -src/_ns_nxutils.c -src/_ns_transforms.cpp -src/_subprocess.c -src/_tkagg.cpp -src/_transforms.cpp -src/_transforms.h -src/_windowing.cpp -src/_wxagg.cpp -src/agg.cxx -src/cntr.c -src/ft2font.cpp -src/ft2font.h -src/mplutils.cpp -src/mplutils.h -src/numerix.h -src/nxutils.c -src/swig_runtime.h -swig/agg.i -swig/agg_basics.i -swig/agg_buffer.h -swig/agg_conv_curve.i -swig/agg_conv_stroke.i -swig/agg_conv_transform.i -swig/agg_path_storage.i -swig/agg_rasterizer_scanline_aa.i -swig/agg_renderer_base.i -swig/agg_renderer_scanline.i -swig/agg_scanline_bin.i -swig/agg_span_image_filter.i -swig/agg_trans_affine.i -swig/agg_typedefs.h -swig/agg_typemaps.i This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-11 17:57:48
|
Revision: 3831 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3831&view=rev Author: mdboom Date: 2007-09-11 10:57:47 -0700 (Tue, 11 Sep 2007) Log Message: ----------- Merged revisions 3824-3830 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r3825 | pkienzle | 2007-09-10 14:45:32 -0400 (Mon, 10 Sep 2007) | 1 line Windows needs binary open flag for font files ........ r3827 | jouni | 2007-09-10 16:31:01 -0400 (Mon, 10 Sep 2007) | 2 lines Better bounding boxes for pdf usetex, including descents. ........ r3828 | jouni | 2007-09-10 16:55:29 -0400 (Mon, 10 Sep 2007) | 2 lines Bugfixes in pdf usetex ........ r3829 | mdboom | 2007-09-11 08:46:27 -0400 (Tue, 11 Sep 2007) | 3 lines Fix bug in PDF clip routine that resulted in the cryptic error message "There are too many arguments" in Adobe Acrobat. ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/dviread.py branches/transforms/ttconv/pprdrv_tt.cpp Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-3823 + /trunk/matplotlib:1-3830 Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-11 17:56:13 UTC (rev 3830) +++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-09-11 17:57:47 UTC (rev 3831) @@ -519,12 +519,13 @@ ul_position, ul_thickness = font.get_ps_font_info() if fontinfo.encodingfile is not None: - differencesArray = [ Name(ch) for ch in - dviread.Encoding(fontinfo.encodingfile) ] + enc = dviread.Encoding(fontinfo.encodingfile) + widths = [ afmdata.get_width_from_char_name(ch) + for ch in enc ] + differencesArray = [ Name(ch) for ch in enc ] differencesArray = [ 0 ] + differencesArray firstchar = 0 lastchar = len(differencesArray) - 2 - widths = [ 100 for x in range(firstchar,lastchar+1) ] # XXX TODO else: widths = [ None for i in range(256) ] for ch in range(256): @@ -1434,7 +1435,7 @@ fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) dvi = dviread.Dvi(dvifile, 72) - text, boxes = iter(dvi).next() + page = iter(dvi).next() dvi.close() if angle == 0: # avoid rounding errors in common case @@ -1448,7 +1449,7 @@ # Gather font information and do some setup for combining # characters into strings. oldfontnum, seq = None, [] - for x1, y1, fontnum, glyph, width in text: + for x1, y1, fontnum, glyph, width in page.text: if fontnum != oldfontnum: texname, fontsize = dvi.fontinfo(fontnum) fontinfo = self.tex_font_mapping(texname) @@ -1462,8 +1463,8 @@ seq += [('end',)] # Find consecutive text strings with constant x coordinate and - # combine into one string (if needed kern would be less than - # 0.1 points) or several strings interspersed with kerns. + # combine into a sequence of strings and kerns, or just one + # string (if any kerns would be less than 0.1 points). i, curx = 0, 0 while i < len(seq)-1: elt, next = seq[i:i+2] @@ -1503,7 +1504,7 @@ boxgc = self.new_gc() boxgc.copy_properties(gc) boxgc.set_linewidth(0) - for x1, y1, h, w in boxes: + for x1, y1, h, w in page.boxes: (x1, y1), (x2, y2), (x3, y3), (x4, y4) = \ mytrans(x1, y1), mytrans(x1+w, y1), \ mytrans(x1+w, y1+h), mytrans(x1, y1+h) @@ -1653,14 +1654,9 @@ fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) dvi = dviread.Dvi(dvifile, 72) - text, boxes = iter(dvi).next() - # TODO: better bounding box -- this is not quite right: - l = min(p[0] for p in text+boxes) - r = max(p[0] for p in text+boxes) + fontsize - b = min(p[1] for p in text+boxes) - t = max(p[1] for p in text+boxes) + fontsize - # (not to even mention finding the baseline) - return r-l, t-b, t-b + page = iter(dvi).next() + dvi.close() + return page.width, page.height, page.descent if ismath: w, h, d, glyphs, rects, used_characters = \ self.mathtext_parser.parse(s, 72, prop) @@ -1837,7 +1833,7 @@ cmds.extend(self.pop()) # Unless we hit the right one, set the clip polygon if (self._cliprect, self._clippath) != (cliprect, clippath): - cmds.append(self.push()) + cmds.extend(self.push()) if self._cliprect != cliprect: cmds.extend([t for t in cliprect] + [Op.rectangle, Op.clip, Op.endpath]) Modified: branches/transforms/lib/matplotlib/dviread.py =================================================================== --- branches/transforms/lib/matplotlib/dviread.py 2007-09-11 17:56:13 UTC (rev 3830) +++ branches/transforms/lib/matplotlib/dviread.py 2007-09-11 17:57:47 UTC (rev 3831) @@ -6,19 +6,21 @@ Interface: dvi = Dvi(filename, 72) - for text, boxes in dvi: # iterate over pages - text, boxes = dvi.output(72) - for x,y,font,glyph,width in text: + for page in dvi: # iterate over pages + w, h, d = page.width, page.height, page.descent + for x,y,font,glyph,width in page.text: fontname, pointsize = dvi.fontinfo(font) ... - for x,y,height,width in boxes: + for x,y,height,width in page.boxes: ... """ -# TODO: support for TeX virtual fonts (*.vf) which are a dvi-like format +# TODO: support TeX virtual fonts (*.vf) which are a sort of +# subroutine collections for dvi files import matplotlib import matplotlib.cbook as mpl_cbook +import numpy as npy import os import struct @@ -74,21 +76,34 @@ def _output(self): """ Output the text and boxes belonging to the most recent page. - text, boxes = dvi._output() + page = dvi._output() """ - t0 = self.text[0] - minx, miny, maxx, maxy = t0[0], t0[1], t0[0], t0[1] + minx, miny, maxx, maxy = npy.inf, npy.inf, -npy.inf, -npy.inf + maxy_pure = -npy.inf for elt in self.text + self.boxes: - x,y = elt[:2] - if x < minx: minx = x - if y < miny: miny = y - if x > maxx: maxx = x - if y > maxy: maxy = y + if len(elt) == 4: # box + x,y,h,w = elt + e = 0 # zero depth + else: # glyph + x,y,f,g,w = elt + font = self.fonts[f] + h = (font.scale * font.tfm.height[g]) >> 20 + e = (font.scale * font.tfm.depth[g]) >> 20 + minx = min(minx, x) + miny = min(miny, y - h) + maxx = max(maxx, x + w) + maxy = max(maxy, y + e) + maxy_pure = max(maxy_pure, y) + d = self.dpi / (72.27 * 2**16) # from TeX's "scaled points" to dpi units text = [ ((x-minx)*d, (maxy-y)*d, f, g, w*d) for (x,y,f,g,w) in self.text ] boxes = [ ((x-minx)*d, (maxy-y)*d, h*d, w*d) for (x,y,h,w) in self.boxes ] - return text, boxes + return mpl_cbook.Bunch(text=text, boxes=boxes, + width=(maxx-minx)*d, + height=(maxy_pure-miny)*d, + descent=(maxy-maxy_pure)*d) + def fontinfo(self, f): """ texname, pointsize = dvi.fontinfo(fontnum) @@ -361,6 +376,7 @@ width[i]: width of character #i, needs to be scaled by the factor specified in the dvi file (this is a dict because indexing may not start from 0) + height[i], depth[i]: height and depth of character #i """ def __init__(self, filename): @@ -368,22 +384,29 @@ try: header1 = file.read(24) - lh, bc, ec, nw = \ - struct.unpack('!4H', header1[2:10]) + lh, bc, ec, nw, nh, nd = \ + struct.unpack('!6H', header1[2:14]) header2 = file.read(4*lh) self.checksum, self.design_size = \ struct.unpack('!2I', header2[:8]) # there is also encoding information etc. char_info = file.read(4*(ec-bc+1)) widths = file.read(4*nw) + heights = file.read(4*nh) + depths = file.read(4*nd) finally: file.close() - widths = struct.unpack('!%dI' % nw, widths) - self.width = {} + self.width, self.height, self.depth = {}, {}, {} + widths, heights, depths = \ + [ struct.unpack('!%dI' % n, x) + for n,x in [(nw, widths), (nh, heights), (nd, depths)] ] for i in range(ec-bc): self.width[bc+i] = widths[ord(char_info[4*i])] + self.height[bc+i] = heights[ord(char_info[4*i+1]) >> 4] + self.depth[bc+i] = depths[ord(char_info[4*i+1]) & 0xf] + class PsfontsMap(object): """ A psfonts.map formatted file, mapping TeX fonts to PS fonts. Modified: branches/transforms/ttconv/pprdrv_tt.cpp =================================================================== --- branches/transforms/ttconv/pprdrv_tt.cpp 2007-09-11 17:56:13 UTC (rev 3830) +++ branches/transforms/ttconv/pprdrv_tt.cpp 2007-09-11 17:57:47 UTC (rev 3831) @@ -1088,7 +1088,7 @@ font.filename=filename; /* Open the font file */ - if( (font.file = fopen(filename,"r")) == (FILE*)NULL ) + if( (font.file = fopen(filename,"rb")) == (FILE*)NULL ) throw TTException("Failed to open TrueType font"); /* Allocate space for the unvarying part of the offset table. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-11 17:56:14
|
Revision: 3830 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3830&view=rev Author: mdboom Date: 2007-09-11 10:56:13 -0700 (Tue, 11 Sep 2007) Log Message: ----------- Just marking a milestone -- about to totally rip things up again. Modified Paths: -------------- branches/transforms/lib/matplotlib/affine.py branches/transforms/lib/matplotlib/artist.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/backends/backend_tkagg.py branches/transforms/lib/matplotlib/bbox.py branches/transforms/lib/matplotlib/figure.py branches/transforms/lib/matplotlib/lines.py branches/transforms/lib/matplotlib/patches.py branches/transforms/lib/matplotlib/text.py branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/lib/matplotlib/affine.py =================================================================== --- branches/transforms/lib/matplotlib/affine.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/affine.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -58,10 +58,8 @@ self.mtx = matrix def __repr__(self): - return repr(self.mtx) - - def __str__(self): - return str(self.mtx) + return "Affine2D(%s)" % repr(self.mtx) + __str__ = __repr__ #@staticmethod def from_values(a, b, c, d, e, f): @@ -156,8 +154,8 @@ class BlendedAffine2D(Affine2D): def __init__(self, x_transform, y_transform): - assert isinstance(x_transform, Affine2D) - assert isinstance(y_transform, Affine2D) +# assert isinstance(x_transform, Affine2D) +# assert isinstance(y_transform, Affine2D) assert x_transform.is_separable() assert y_transform.is_separable() x_mtx = x_transform.mtx Modified: branches/transforms/lib/matplotlib/artist.py =================================================================== --- branches/transforms/lib/matplotlib/artist.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/artist.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -138,6 +138,7 @@ ACCEPTS: a matplotlib.transform transformation instance """ + print "set_transform", t self._transform = t self._transformSet = True self.pchanged() Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/axes.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -10,9 +10,9 @@ from matplotlib import artist as martist from matplotlib import affine as maffine -from matplotlib import bbox as mbbox from matplotlib import agg from matplotlib import axis as maxis +from matplotlib import bbox as mbbox from matplotlib import cbook from matplotlib import collections as mcoll from matplotlib import colors as mcolors @@ -33,9 +33,9 @@ iterable = cbook.iterable is_string_like = cbook.is_string_like +Wrapper = cbook.Wrapper - def delete_masked_points(*args): """ Find all masked points in a set of arguments, and return @@ -437,7 +437,6 @@ 1 : 'log', } - def __str__(self): return "Axes(%g,%g;%gx%g)"%(self._position[0].get(),self._position[1].get(), self._position[2].get(),self._position[3].get()) @@ -535,7 +534,6 @@ if self.yaxis is not None: self._ycid = self.yaxis.callbacks.connect('units finalize', self.relim) - def get_window_extent(self, *args, **kwargs): 'get the axes bounding box in display space; args and kwargs are empty' return self.bbox @@ -655,16 +653,16 @@ bottom = 0.0 top = 1.0 - - self.viewLim = Bbox.from_lbrt(left, bottom, right, top) - self.dataLim = Bbox.unit() - + self.dataLim = Bbox.unit() + self.transData = maffine.get_bbox_transform( self.viewLim, self.bbox) self.transAxes = maffine.get_bbox_transform( - Bbox.unit(), self.bbox) + self.dataLim, self.bbox) + print "_set_lim_and_transforms", self.viewLim, self.transData, self.dataLim, self.transAxes, self.bbox + # MGDTODO # if self._sharex: # self.transData.set_funcx(self._sharex.transData.get_funcx()) @@ -677,7 +675,8 @@ if original: return self._originalPosition[:] else: - return [val.get() for val in self._position] + return self._position[:] + # return [val.get() for val in self._position] def set_position(self, pos, which='both'): """ @@ -699,10 +698,13 @@ # # Change values within self._position--don't replace it. # for num,val in zip(pos, self._position): # val.set(num) + print "set_position", self._position, pos self._position = pos + # MGDTODO: side-effects if which in ('both', 'original'): self._originalPosition = pos - + + def _set_artist_props(self, a): 'set the boilerplate props for artists added to axes' a.set_figure(self.figure) @@ -1181,7 +1183,10 @@ #print type(x), type(y) # MGDTODO ## self.dataLim.update_numerix(x, y, -1) - pass + print "update_datalim_numerix", self.dataLim, + self.dataLim = mbbox.Bbox.from_data(x, y) + print self.dataLim + # MGDTODO side-effects def _get_verts_in_data_coords(self, trans, xys): if trans == self.transData: @@ -1190,8 +1195,8 @@ # display and then back to data to get it in data units #xys = trans.seq_xy_tups(xys) #return [ self.transData.inverse_xy_tup(xy) for xy in xys] - xys = trans.numerix_xy(npy.asarray(xys)) - return self.transData.inverse_numerix_xy(xys) + xys = trans(npy.asarray(xys)) + return self.transData.inverted()(xys) def _process_unit_info(self, xdata=None, ydata=None, kwargs=None): 'look for unit kwargs and update the axis instances as necessary' @@ -1242,7 +1247,8 @@ axis direction reversal that has already been done. """ # if image data only just use the datalim - + print "autoscale_view" + if not self._autoscaleon: return if (tight or (len(self.images)>0 and len(self.lines)==0 and @@ -1278,7 +1284,7 @@ if not self.get_visible(): return renderer.open_group('axes') self.apply_aspect() - # MGDTODO + # MGDTODO -- this is where we can finalize all of the transforms # self.transData.freeze() # eval the lazy objects # self.transAxes.freeze() if self.axison and self._frameon: self.axesPatch.draw(renderer) @@ -1544,9 +1550,12 @@ # raise ValueError('Cannot set nonpositive limits with log transform') xmin, xmax = mbbox.nonsingular(xmin, xmax, increasing=False) - self.viewLim.intervalx().set_bounds(xmin, xmax) - if emit: self.callbacks.process('xlim_changed', self) + # MGDTODO: This is fairly cumbersome + # MGDTODO: side-effects on x-bounds should propagate + self.viewLim = mbbox.Bbox.from_lbrt(xmin, self.viewLim.ymin(), xmax, self.viewLim.ymax()) + print 'set_xlim', self.viewLim + return xmin, xmax def get_xscale(self): @@ -1649,7 +1658,7 @@ ACCEPTS: len(2) sequence of floats """ - + print "set_ylim", ymin, ymax, emit if ymax is None and iterable(ymin): ymin,ymax = ymin @@ -1669,9 +1678,11 @@ # raise ValueError('Cannot set nonpositive limits with log transform') ymin, ymax = mbbox.nonsingular(ymin, ymax, increasing=False) - self.viewLim.intervaly().set_bounds(ymin, ymax) + # MGDTODO: side-effects on y-bounds should propagate + self.viewLim = mbbox.Bbox.from_lbrt(self.viewLim.xmin(), ymin, self.viewLim.xmax(), ymax) if emit: self.callbacks.process('ylim_changed', self) - + print "set_ylim", self.viewLim + return ymin, ymax def get_yscale(self): @@ -2158,7 +2169,7 @@ %(Annotation)s """ a = mtext.Annotation(*args, **kwargs) - a.set_transform(maffine.Affine2D.identity()) + a.set_transform(maffine.Affine2D()) self._set_artist_props(a) if kwargs.has_key('clip_on'): a.set_clip_box(self.bbox) self.texts.append(a) @@ -2197,7 +2208,7 @@ %(Line2D)s """ - trans = maffine.blend_xy_sep_transform( self.transAxes, self.transData) + trans = maffine.blend_xy_sep_transform(self.transAxes, self.transData) l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, **kwargs) return l Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -752,7 +752,7 @@ else: # Just found one hit self.inaxes = axes_list[0] - try: xdata, ydata = self.inaxes.transData.inverse_xy_tup((x, y)) + try: xdata, ydata = self.inaxes.transData.inverted()([[x, y]])[0] except ValueError: self.xdata = None self.ydata = None Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -113,11 +113,12 @@ debug=False) if __debug__: verbose.report('RendererAgg.__init__ _RendererAgg done', 'debug-annoying') - self.draw_polygon = self._renderer.draw_polygon + # self.draw_polygon = self._renderer.draw_polygon self.draw_rectangle = self._renderer.draw_rectangle self.draw_path = self._renderer.draw_path + # MGDTODO -- remove these lines # self.draw_lines = self._renderer.draw_lines - self.draw_markers = self._renderer.draw_markers + # self.draw_markers = self._renderer.draw_markers self.draw_image = self._renderer.draw_image self.draw_line_collection = self._renderer.draw_line_collection self.draw_quad_mesh = self._renderer.draw_quad_mesh @@ -161,8 +162,13 @@ def draw_lines(self, gc, x, y, transform): return self._renderer.draw_lines(gc, x, y, transform.to_values()) - + def draw_markers(self, gc, path, color, x, y, transform): + return self._renderer.draw_markers(gc, path, color, x, y, transform.to_values()) + + def draw_polygon(self, *args): + return self._renderer.draw_polygon(*args) + def draw_point(self, gc, x, y): """ Draw a single point at x,y @@ -325,8 +331,10 @@ """ if __debug__: verbose.report('RendererAgg.points_to_pixels', 'debug-annoying') - return points*self.dpi.get()/72.0 - + # MGDTODO + # return points*self.dpi.get()/72.0 + return points*self.dpi/72.0 + def tostring_rgb(self): if __debug__: verbose.report('RendererAgg.tostring_rgb', 'debug-annoying') Modified: branches/transforms/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/backends/backend_tkagg.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -175,7 +175,8 @@ self._resize_callback(event) # compute desired figure size in inches - dpival = self.figure.dpi.get() + # dpival = self.figure.dpi.get() MGDTODO + dpival = self.figure.dpi winch = width/dpival hinch = height/dpival self.figure.set_size_inches(winch, hinch) Modified: branches/transforms/lib/matplotlib/bbox.py =================================================================== --- branches/transforms/lib/matplotlib/bbox.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/bbox.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -21,9 +21,6 @@ def get_bounds(self): return self._bounds - def set_bounds(self, lower, upper): - self._bounds = lower, upper - def span(self): bounds = self._bounds return bounds[1] - bounds[0] @@ -47,8 +44,23 @@ return Bbox([[left, bottom], [right, top]]) from_lbrt = staticmethod(from_lbrt) + #@staticmethod + def from_data(x, y): + return Bbox([[x.min(), y.min()], [x.max(), y.max()]]) + from_data = staticmethod(from_data) + def copy(self): return Bbox(self._points.copy()) + + def __repr__(self): + return 'Bbox(%s)' % repr(self._points) + __str__ = __repr__ + + def __cmp__(self, other): + # MGDTODO: Totally suboptimal + if isinstance(other, Bbox): + return (self._points == other._points).all() + return -1 # MGDTODO: Probably a more efficient ways to do this... def xmin(self): @@ -79,6 +91,7 @@ return (self.xmin(), self.ymin(), self.xmax() - self.xmin(), self.ymax() - self.ymin()) + # MGDTODO: This is an inefficient way to do this def intervalx(self): return Interval(self._points[0]) @@ -92,10 +105,11 @@ deltah = (sh * height - height) / 2.0 a = N.array([[-deltaw, -deltah], [deltaw, deltah]]) return Bbox(self._points + a) - -def lbwh_to_bbox(left, bottom, width, height): - return Bbox([[left, bottom], [left + width, bottom + height]]) - + + def contains(self, x, y): + return (x >= self.xmin() and x <= self.xmax() and + y >= self.ymin() and y <= self.ymax()) + def bbox_union(bboxes): """ Return the Bbox that bounds all bboxes Modified: branches/transforms/lib/matplotlib/figure.py =================================================================== --- branches/transforms/lib/matplotlib/figure.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/figure.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -105,8 +105,9 @@ class Figure(Artist): def __str__(self): - return "Figure(%gx%g)"%(self.figwidth.get(),self.figheight.get()) - + return "Figure(%gx%g)"%(self.figwidth, self.figheight) + # return "Figure(%gx%g)"%(self.figwidth.get(),self.figheight.get()) + def __init__(self, figsize = None, # defaults to rc figure.figsize dpi = None, # defaults to rc figure.dpi @@ -129,10 +130,9 @@ if edgecolor is None: edgecolor = rcParams['figure.edgecolor'] self.dpi = dpi - self.figsize = figsize - self.bbox = Bbox.from_lbwh(0, 0, - figsize[0] * dpi, - figsize[1] * dpi) + self.figwidth = figsize[0] * dpi + self.figheight = figsize[1] * dpi + self.bbox = Bbox.from_lbwh(0, 0, self.figwidth, self.figheight) self.frameon = frameon @@ -324,11 +324,16 @@ w,h = args[0] else: w,h = args - self.figwidth.set(w) - self.figheight.set(h) + + self.figwidth = w + self.figheight = h + # self.figwidth.set(w) MGDTODO + # self.figheight.set(h) + if forward: - dpival = self.dpi.get() + # dpival = self.dpi.get() + dpival = self.dpi canvasw = w*dpival canvash = h*dpival manager = getattr(self.canvas, 'manager', None) @@ -336,7 +341,8 @@ manager.resize(int(canvasw), int(canvash)) def get_size_inches(self): - return self.figwidth.get(), self.figheight.get() + return self.figwidth, self.figheight + # return self.figwidth.get(), self.figheight.get() MGDTODO def get_edgecolor(self): 'Get the edge color of the Figure rectangle' @@ -348,7 +354,8 @@ def get_figwidth(self): 'Return the figwidth as a float' - return self.figwidth.get() + return self.figwidth + # return self.figwidth.get() MGDTODO def get_figheight(self): 'Return the figheight as a float' @@ -356,7 +363,8 @@ def get_dpi(self): 'Return the dpi as a float' - return self.dpi.get() + return self.dpi + # return self.dpi.get() MGDTODO def get_frameon(self): 'get the boolean indicating frameon' @@ -384,7 +392,8 @@ ACCEPTS: float """ - self.dpi.set(val) + # self.dpi.set(val) MGDTODO + self.dpi = val def set_figwidth(self, val): """ @@ -392,15 +401,17 @@ ACCEPTS: float """ - self.figwidth.set(val) - + # self.figwidth.set(val) MGDTODO + self.figwidth = val + def set_figheight(self, val): """ Set the height of the figure in inches ACCEPTS: float """ - self.figheight.set(val) + # MGDTODO (set()) + self.figheight = val def set_frameon(self, b): """ Modified: branches/transforms/lib/matplotlib/lines.py =================================================================== --- branches/transforms/lib/matplotlib/lines.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/lines.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -18,7 +18,7 @@ from cbook import iterable, is_string_like, is_numlike from colors import colorConverter -from bbox import lbwh_to_bbox +from bbox import Bbox from matplotlib import rcParams # special-purpose marker identifiers: @@ -368,6 +368,7 @@ a = npy.vstack((x, y)).swapaxes(0, 1) #### x, y = self.get_transform()(a) + print "get_window_extent", self.get_transform() #x, y = self.get_transform().seq_x_y(x, y) @@ -384,10 +385,11 @@ bottom -= ms/2 width += ms height += ms - return lbwh_to_bbox(left, bottom, width, height) + return Bbox.from_lbwh(left, bottom, width, height) def set_axes(self, ax): + print "set_axes" Artist.set_axes(self, ax) if ax.xaxis is not None: self._xcid = ax.xaxis.callbacks.connect('units', self.recache) Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/patches.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -212,7 +212,7 @@ tverts = self.get_transform()(verts) # MGDTODO: This result is an Nx2 numpy array, which could be passed - # directly to renderer.draw_polygon. However, it currently expects + # directly to renderer.draw_polygon since it currently expects # a list of tuples so we're converting it to that now. tverts = [tuple(x) for x in tverts] Modified: branches/transforms/lib/matplotlib/text.py =================================================================== --- branches/transforms/lib/matplotlib/text.py 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/lib/matplotlib/text.py 2007-09-11 17:56:13 UTC (rev 3830) @@ -15,7 +15,7 @@ from cbook import enumerate, is_string_like, maxdict, is_numlike from font_manager import FontProperties from patches import bbox_artist, YAArrow -from bbox import lbwh_to_bbox, bbox_union +from bbox import Bbox, bbox_union from lines import Line2D import matplotlib.nxutils as nxutils @@ -40,8 +40,6 @@ angle = float(rotation) return angle%360 -_unit_box = lbwh_to_bbox(0,0,1,1) - # these are not available for the object inspector until after the # class is build so we define an initial set here for the init # function and they will be overridden after object defn @@ -264,7 +262,7 @@ ymin += offsety ymax += offsety - bbox = lbwh_to_bbox(xmin, ymin, width, height) + bbox = Bbox.from_lbwh(xmin, ymin, width, height) # now rotate the positions around the first x,y position @@ -423,10 +421,10 @@ def get_window_extent(self, renderer=None): #return _unit_box - if not self.get_visible(): return _unit_box + if not self.get_visible(): return Bbox.unit() if self._text == '': tx, ty = self._get_xy_display() - return lbwh_to_bbox(tx,ty,0,0) + return Bbox.from_lbwh(tx,ty,0,0) if renderer is not None: self._renderer = renderer Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-09-11 12:46:27 UTC (rev 3829) +++ branches/transforms/src/_backend_agg.cpp 2007-09-11 17:56:13 UTC (rev 3830) @@ -56,7 +56,7 @@ throw Py::ValueError("Transformation matrix must be given as a 6-element list."); } - agg::trans_affine xytrans = agg::trans_affine + return agg::trans_affine (Py::Float(seq[0]), Py::Float(seq[1]), Py::Float(seq[2]), @@ -1935,18 +1935,8 @@ if (ya==NULL) throw Py::TypeError("RendererAgg::_draw_markers_cache expected numerix array"); - Transformation* mpltransform = static_cast<Transformation*>(args[5].ptr()); + agg::trans_affine xytrans = py_sequence_to_agg_transformation_matrix(args[5]); - double a, b, c, d, tx, ty; - try { - mpltransform->affine_params_api(&a, &b, &c, &d, &tx, &ty); - } - catch(...) { - throw Py::ValueError("Domain error on affine_params_api in RendererAgg::_draw_markers_cache"); - } - - agg::trans_affine xytrans = agg::trans_affine(a,b,c,d,tx,ty); - size_t Nx = xa->dimensions[0]; size_t Ny = ya->dimensions[0]; @@ -2006,15 +1996,16 @@ for (size_t i=0; i<Nx; i++) { thisx = *(double *)(xa->data + i*xa->strides[0]); thisy = *(double *)(ya->data + i*ya->strides[0]); + + // MGDTODO +// if (mpltransform->need_nonlinear_api()) +// try { +// mpltransform->nonlinear_only_api(&thisx, &thisy); +// } +// catch(...) { +// continue; +// } - if (mpltransform->need_nonlinear_api()) - try { - mpltransform->nonlinear_only_api(&thisx, &thisy); - } - catch(...) { - continue; - } - xytrans.transform(&thisx, &thisy); thisy = heightd - thisy; //flipy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-11 12:46:32
|
Revision: 3829 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3829&view=rev Author: mdboom Date: 2007-09-11 05:46:27 -0700 (Tue, 11 Sep 2007) Log Message: ----------- Fix bug in PDF clip routine that resulted in the cryptic error message "There are too many arguments" in Adobe Acrobat. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 20:55:29 UTC (rev 3828) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-11 12:46:27 UTC (rev 3829) @@ -1833,7 +1833,7 @@ cmds.extend(self.pop()) # Unless we hit the right one, set the clip polygon if (self._cliprect, self._clippath) != (cliprect, clippath): - cmds.append(self.push()) + cmds.extend(self.push()) if self._cliprect != cliprect: cmds.extend([t for t in cliprect] + [Op.rectangle, Op.clip, Op.endpath]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2007-09-10 20:55:33
|
Revision: 3828 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3828&view=rev Author: jouni Date: 2007-09-10 13:55:29 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Bugfixes in pdf usetex Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 20:31:01 UTC (rev 3827) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 20:55:29 UTC (rev 3828) @@ -519,12 +519,13 @@ ul_position, ul_thickness = font.get_ps_font_info() if fontinfo.encodingfile is not None: - differencesArray = [ Name(ch) for ch in - dviread.Encoding(fontinfo.encodingfile) ] + enc = dviread.Encoding(fontinfo.encodingfile) + widths = [ afmdata.get_width_from_char_name(ch) + for ch in enc ] + differencesArray = [ Name(ch) for ch in enc ] differencesArray = [ 0 ] + differencesArray firstchar = 0 lastchar = len(differencesArray) - 2 - widths = [ 100 for x in range(firstchar,lastchar+1) ] # XXX TODO else: widths = [ None for i in range(256) ] for ch in range(256): @@ -1427,7 +1428,7 @@ # Pop off the global transformation self.file.output(Op.grestore) - def draw_tex(self, gc, x, y, s, prop, angle): + def _draw_tex(self, gc, x, y, s, prop, angle): # Rename to draw_tex to enable texmanager = self.get_texmanager() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2007-09-10 20:31:04
|
Revision: 3827 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3827&view=rev Author: jouni Date: 2007-09-10 13:31:01 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Better bounding boxes for pdf usetex, including descents. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py trunk/matplotlib/lib/matplotlib/dviread.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 19:25:21 UTC (rev 3826) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-10 20:31:01 UTC (rev 3827) @@ -1427,14 +1427,14 @@ # Pop off the global transformation self.file.output(Op.grestore) - def _draw_tex(self, gc, x, y, s, prop, angle): + def draw_tex(self, gc, x, y, s, prop, angle): # Rename to draw_tex to enable texmanager = self.get_texmanager() fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) dvi = dviread.Dvi(dvifile, 72) - text, boxes = iter(dvi).next() + page = iter(dvi).next() dvi.close() if angle == 0: # avoid rounding errors in common case @@ -1448,7 +1448,7 @@ # Gather font information and do some setup for combining # characters into strings. oldfontnum, seq = None, [] - for x1, y1, fontnum, glyph, width in text: + for x1, y1, fontnum, glyph, width in page.text: if fontnum != oldfontnum: texname, fontsize = dvi.fontinfo(fontnum) fontinfo = self.tex_font_mapping(texname) @@ -1462,8 +1462,8 @@ seq += [('end',)] # Find consecutive text strings with constant x coordinate and - # combine into one string (if needed kern would be less than - # 0.1 points) or several strings interspersed with kerns. + # combine into a sequence of strings and kerns, or just one + # string (if any kerns would be less than 0.1 points). i, curx = 0, 0 while i < len(seq)-1: elt, next = seq[i:i+2] @@ -1503,7 +1503,7 @@ boxgc = self.new_gc() boxgc.copy_properties(gc) boxgc.set_linewidth(0) - for x1, y1, h, w in boxes: + for x1, y1, h, w in page.boxes: (x1, y1), (x2, y2), (x3, y3), (x4, y4) = \ mytrans(x1, y1), mytrans(x1+w, y1), \ mytrans(x1+w, y1+h), mytrans(x1, y1+h) @@ -1653,14 +1653,9 @@ fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) dvi = dviread.Dvi(dvifile, 72) - text, boxes = iter(dvi).next() - # TODO: better bounding box -- this is not quite right: - l = min(p[0] for p in text+boxes) - r = max(p[0] for p in text+boxes) + fontsize - b = min(p[1] for p in text+boxes) - t = max(p[1] for p in text+boxes) + fontsize - # (not to even mention finding the baseline) - return r-l, t-b, t-b + page = iter(dvi).next() + dvi.close() + return page.width, page.height, page.descent if ismath: w, h, d, glyphs, rects, used_characters = \ self.mathtext_parser.parse(s, 72, prop) Modified: trunk/matplotlib/lib/matplotlib/dviread.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-10 19:25:21 UTC (rev 3826) +++ trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-10 20:31:01 UTC (rev 3827) @@ -6,19 +6,21 @@ Interface: dvi = Dvi(filename, 72) - for text, boxes in dvi: # iterate over pages - text, boxes = dvi.output(72) - for x,y,font,glyph,width in text: + for page in dvi: # iterate over pages + w, h, d = page.width, page.height, page.descent + for x,y,font,glyph,width in page.text: fontname, pointsize = dvi.fontinfo(font) ... - for x,y,height,width in boxes: + for x,y,height,width in page.boxes: ... """ -# TODO: support for TeX virtual fonts (*.vf) which are a dvi-like format +# TODO: support TeX virtual fonts (*.vf) which are a sort of +# subroutine collections for dvi files import matplotlib import matplotlib.cbook as mpl_cbook +import numpy as npy import os import struct @@ -74,21 +76,34 @@ def _output(self): """ Output the text and boxes belonging to the most recent page. - text, boxes = dvi._output() + page = dvi._output() """ - t0 = self.text[0] - minx, miny, maxx, maxy = t0[0], t0[1], t0[0], t0[1] + minx, miny, maxx, maxy = npy.inf, npy.inf, -npy.inf, -npy.inf + maxy_pure = -npy.inf for elt in self.text + self.boxes: - x,y = elt[:2] - if x < minx: minx = x - if y < miny: miny = y - if x > maxx: maxx = x - if y > maxy: maxy = y + if len(elt) == 4: # box + x,y,h,w = elt + e = 0 # zero depth + else: # glyph + x,y,f,g,w = elt + font = self.fonts[f] + h = (font.scale * font.tfm.height[g]) >> 20 + e = (font.scale * font.tfm.depth[g]) >> 20 + minx = min(minx, x) + miny = min(miny, y - h) + maxx = max(maxx, x + w) + maxy = max(maxy, y + e) + maxy_pure = max(maxy_pure, y) + d = self.dpi / (72.27 * 2**16) # from TeX's "scaled points" to dpi units text = [ ((x-minx)*d, (maxy-y)*d, f, g, w*d) for (x,y,f,g,w) in self.text ] boxes = [ ((x-minx)*d, (maxy-y)*d, h*d, w*d) for (x,y,h,w) in self.boxes ] - return text, boxes + return mpl_cbook.Bunch(text=text, boxes=boxes, + width=(maxx-minx)*d, + height=(maxy_pure-miny)*d, + descent=(maxy-maxy_pure)*d) + def fontinfo(self, f): """ texname, pointsize = dvi.fontinfo(fontnum) @@ -361,6 +376,7 @@ width[i]: width of character #i, needs to be scaled by the factor specified in the dvi file (this is a dict because indexing may not start from 0) + height[i], depth[i]: height and depth of character #i """ def __init__(self, filename): @@ -368,22 +384,29 @@ try: header1 = file.read(24) - lh, bc, ec, nw = \ - struct.unpack('!4H', header1[2:10]) + lh, bc, ec, nw, nh, nd = \ + struct.unpack('!6H', header1[2:14]) header2 = file.read(4*lh) self.checksum, self.design_size = \ struct.unpack('!2I', header2[:8]) # there is also encoding information etc. char_info = file.read(4*(ec-bc+1)) widths = file.read(4*nw) + heights = file.read(4*nh) + depths = file.read(4*nd) finally: file.close() - widths = struct.unpack('!%dI' % nw, widths) - self.width = {} + self.width, self.height, self.depth = {}, {}, {} + widths, heights, depths = \ + [ struct.unpack('!%dI' % n, x) + for n,x in [(nw, widths), (nh, heights), (nd, depths)] ] for i in range(ec-bc): self.width[bc+i] = widths[ord(char_info[4*i])] + self.height[bc+i] = heights[ord(char_info[4*i+1]) >> 4] + self.depth[bc+i] = depths[ord(char_info[4*i+1]) & 0xf] + class PsfontsMap(object): """ A psfonts.map formatted file, mapping TeX fonts to PS fonts. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-10 19:25:26
|
Revision: 3826 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3826&view=rev Author: mdboom Date: 2007-09-10 12:25:21 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Running mathtext_demo.py without transforms.py/cpp. Totally broken, though. Not surprising... ;) Modified Paths: -------------- branches/transforms/lib/matplotlib/affine.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/bbox.py branches/transforms/lib/matplotlib/figure.py branches/transforms/lib/matplotlib/finance.py branches/transforms/lib/matplotlib/legend.py branches/transforms/lib/matplotlib/lines.py branches/transforms/lib/matplotlib/patches.py branches/transforms/lib/matplotlib/text.py branches/transforms/lib/matplotlib/ticker.py branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/lib/matplotlib/affine.py =================================================================== --- branches/transforms/lib/matplotlib/affine.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/affine.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -67,7 +67,10 @@ def from_values(a, b, c, d, e, f): return Affine2D(Affine2D.matrix_from_values(a, b, c, d, e, f)) from_values = staticmethod(from_values) - + + def to_values(self): + return tuple(self.mtx[:2].swapaxes(0, 1).flatten()) + #@staticmethod def matrix_from_values(a, b, c, d, e, f): affine = N.zeros((3,3), N.float_) @@ -92,11 +95,12 @@ # This is nicer for now, however, since we can just keep a # regular affine matrix around + # MGDTODO: Trap cases where this isn't an array and fix there + points = N.array(points, N.float_) new_points = points.swapaxes(0, 1) new_points = N.vstack((new_points, N.ones((1, points.shape[0])))) result = N.dot(self.mtx, new_points)[:2] - result.swapaxes(0, 1) - return result + return result.swapaxes(0, 1) #@staticmethod def _concat(a, b): @@ -198,10 +202,14 @@ print transform.inverted() from bbox import Bbox + print "BBOX" boxin = Bbox([[10, 10], [320, 240]]) boxout = Bbox([[25, 25], [640, 400]]) - trans = bbox_transform(boxin, boxout) + print boxin._points, boxin.xmin(), boxin.ymin(), boxin.xmax(), boxin.ymax() + print boxout._points, boxout.xmin(), boxout.ymin(), boxout.xmax(), boxout.ymax() + trans = get_bbox_transform(boxin, boxout) print trans print trans(N.array([[10, 10], [320, 240]])) + print trans([[10, 10]]) __all__ = ['Transform', 'Affine2D'] Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/axes.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -618,10 +618,10 @@ martist.Artist.set_figure(self, fig) l, b, w, h = self._position - xmin = fig.bbox.ll().x() - xmax = fig.bbox.ur().x() - ymin = fig.bbox.ll().y() - ymax = fig.bbox.ur().y() + xmin = fig.bbox.xmin() + xmax = fig.bbox.xmax() + ymin = fig.bbox.ymin() + ymax = fig.bbox.ymax() figw = xmax-xmin figh = ymax-ymin self.left = l*figw @@ -695,9 +695,11 @@ ACCEPTS: len(4) sequence of floats """ if which in ('both', 'active'): - # Change values within self._position--don't replace it. - for num,val in zip(pos, self._position): - val.set(num) + # MGDTODO +# # Change values within self._position--don't replace it. +# for num,val in zip(pos, self._position): +# val.set(num) + self._position = pos if which in ('both', 'original'): self._originalPosition = pos @@ -714,7 +716,8 @@ self.xaxis.cla() self.yaxis.cla() - self.dataLim.ignore(1) + # MGDTODO + # self.dataLim.ignore(1) self.callbacks = cbook.CallbackRegistry(('xlim_changed', 'ylim_changed')) if self._sharex is not None: @@ -1176,7 +1179,9 @@ # Otherwise, it will compute the bounds of it's current data # and the data in xydata #print type(x), type(y) - self.dataLim.update_numerix(x, y, -1) + # MGDTODO + ## self.dataLim.update_numerix(x, y, -1) + pass def _get_verts_in_data_coords(self, trans, xys): if trans == self.transData: @@ -1273,8 +1278,9 @@ if not self.get_visible(): return renderer.open_group('axes') self.apply_aspect() - self.transData.freeze() # eval the lazy objects - self.transAxes.freeze() + # MGDTODO + # self.transData.freeze() # eval the lazy objects + # self.transAxes.freeze() if self.axison and self._frameon: self.axesPatch.draw(renderer) artists = [] @@ -1330,8 +1336,9 @@ for zorder, i, a in dsu: a.draw(renderer) - self.transData.thaw() # release the lazy objects - self.transAxes.thaw() # release the lazy objects + # MGDTODO + # self.transData.thaw() # release the lazy objects + # self.transAxes.thaw() # release the lazy objects renderer.close_group('axes') self._cachedRenderer = renderer Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/axis.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -261,7 +261,7 @@ horizontalalignment='center', ) - trans = blend_xy_sep_transformation( + trans = blend_xy_sep_transform( self.axes.transData, self.axes.transAxes) # offset the text upward with a post transformation trans = trans + Affine2D().translated(0, self._padPixels) @@ -1037,7 +1037,8 @@ bbox = bbox_union(bboxes) bottom = bbox.ymin() - self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi.get()/72.0)) + self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi/72.0)) +# self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi.get()/72.0)) MGDTODO else: if not len(bboxes2): @@ -1060,8 +1061,9 @@ else: bbox = bbox_union(bboxes) bottom = bbox.ymin() - self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) - + self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi/72.0)) +# self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) MGDTODO + def set_ticks_position(self, position): """ Set the ticks position (top, bottom, both or default) @@ -1227,8 +1229,9 @@ bbox = bbox_union(bboxes) left = bbox.xmin() - self.label.set_position( (left-self.LABELPAD*self.figure.dpi.get()/72.0, y)) - + self.label.set_position( (left-self.LABELPAD*self.figure.dpi/72.0, y)) + # self.label.set_position( (left-self.LABELPAD*self.figure.dpi.get()/72.0, y)) MGDTODO + else: if not len(bboxes2): right = self.axes.bbox.xmax() @@ -1246,8 +1249,9 @@ """ x,y = self.offsetText.get_position() top = self.axes.bbox.ymax() - self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) - + self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi/72.0)) +# self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) MGDTODO + def set_offset_position(self, position): assert position == 'left' or position == 'right' Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -1178,11 +1178,13 @@ if dpi is None: dpi = rcParams['savefig.dpi'] - origDPI = self.figure.dpi.get() + origDPI = self.figure.dpi origfacecolor = self.figure.get_facecolor() origedgecolor = self.figure.get_edgecolor() - self.figure.dpi.set(dpi) + # MGDTODO + # self.figure.dpi.set(dpi) + self.figure.dpi = dpi self.figure.set_facecolor(facecolor) self.figure.set_edgecolor(edgecolor) @@ -1195,7 +1197,9 @@ orientation=orientation, **kwargs) finally: - self.figure.dpi.set(origDPI) + # MGDTODO + # self.figure.dpi.set(origDPI) + self.figure.dpi = origDPI self.figure.set_facecolor(origfacecolor) self.figure.set_edgecolor(origedgecolor) self.figure.set_canvas(self) Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -106,14 +106,17 @@ self.height = height if __debug__: verbose.report('RendererAgg.__init__ width=%s, \ height=%s'%(width, height), 'debug-annoying') - self._renderer = _RendererAgg(int(width), int(height), dpi.get(), - debug=False) + # MGDTODO +# self._renderer = _RendererAgg(int(width), int(height), dpi.get(), +# debug=False) + self._renderer = _RendererAgg(int(width), int(height), dpi, + debug=False) if __debug__: verbose.report('RendererAgg.__init__ _RendererAgg done', 'debug-annoying') self.draw_polygon = self._renderer.draw_polygon self.draw_rectangle = self._renderer.draw_rectangle self.draw_path = self._renderer.draw_path - self.draw_lines = self._renderer.draw_lines + # self.draw_lines = self._renderer.draw_lines self.draw_markers = self._renderer.draw_markers self.draw_image = self._renderer.draw_image self.draw_line_collection = self._renderer.draw_line_collection @@ -156,6 +159,9 @@ y = npy.array([y1,y2], float) self._renderer.draw_lines(gc, x, y) + def draw_lines(self, gc, x, y, transform): + return self._renderer.draw_lines(gc, x, y, transform.to_values()) + def draw_point(self, gc, x, y): """ @@ -173,7 +179,9 @@ if __debug__: verbose.report('RendererAgg.draw_mathtext', 'debug-annoying') ox, oy, width, height, descent, font_image, used_characters = \ - self.mathtext_parser.parse(s, self.dpi.get(), prop) + self.mathtext_parser.parse(s, self.dpi, prop) +# ox, oy, width, height, descent, font_image, used_characters = \ +# self.mathtext_parser.parse(s, self.dpi.get(), prop) MGDTODO x = int(x) + ox y = int(y) - oy @@ -228,7 +236,9 @@ if ismath: ox, oy, width, height, descent, fonts, used_characters = \ - self.mathtext_parser.parse(s, self.dpi.get(), prop) + self.mathtext_parser.parse(s, self.dpi, prop) +# ox, oy, width, height, descent, fonts, used_characters = \ +# self.mathtext_parser.parse(s, self.dpi.get(), prop) MGDTODO return width, height, descent font = self._get_agg_font(prop) font.set_text(s, 0.0, flags=LOAD_DEFAULT) # the width and height of unrotated string @@ -302,7 +312,8 @@ font.clear() size = prop.get_size_in_points() - font.set_size(size, self.dpi.get()) + font.set_size(size, self.dpi) + # font.set_size(size, self.dpi.get()) MGDTODO return font @@ -380,7 +391,9 @@ def get_renderer(self): l,b,w,h = self.figure.bbox.get_bounds() - key = w, h, self.figure.dpi.get() + # MGDTODO + # key = w, h, self.figure.dpi.get() + key = w, h, self.figure.dpi try: self._lastKey, self.renderer except AttributeError: need_new_renderer = True else: need_new_renderer = (self._lastKey != key) Modified: branches/transforms/lib/matplotlib/bbox.py =================================================================== --- branches/transforms/lib/matplotlib/bbox.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/bbox.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -6,9 +6,31 @@ import numpy as N +class Interval: + def __init__(self, bounds): + self._bounds = N.array(bounds, N.float_) + + def contains(self, value): + bounds = self._bounds + return value >= bounds[0] and value <= bounds[1] + + def contains_open(self, value): + bounds = self._bounds + return value > bounds[0] and value < bounds[1] + + def get_bounds(self): + return self._bounds + + def set_bounds(self, lower, upper): + self._bounds = lower, upper + + def span(self): + bounds = self._bounds + return bounds[1] - bounds[0] + class Bbox: def __init__(self, points): - self._points = N.array(points) + self._points = N.array(points, N.float_) #@staticmethod def unit(): @@ -23,7 +45,10 @@ #@staticmethod def from_lbrt(left, bottom, right, top): return Bbox([[left, bottom], [right, top]]) - from_lbwh = staticmethod(from_lbwh) + from_lbrt = staticmethod(from_lbrt) + + def copy(self): + return Bbox(self._points.copy()) # MGDTODO: Probably a more efficient ways to do this... def xmin(self): @@ -45,15 +70,29 @@ return self.ymax() - self.ymin() def transform(self, transform): - return Bbox(transform(points)) + return Bbox(transform(self._points)) def inverse_transform(self, transform): - return Bbox(transform.inverted()(points)) + return Bbox(transform.inverted()(self._points)) def get_bounds(self): return (self.xmin(), self.ymin(), self.xmax() - self.xmin(), self.ymax() - self.ymin()) - + + def intervalx(self): + return Interval(self._points[0]) + + def intervaly(self): + return Interval(self._points[1]) + + def scaled(self, sw, sh): + width = self.width() + height = self.height() + deltaw = (sw * width - width) / 2.0 + deltah = (sh * height - height) / 2.0 + a = N.array([[-deltaw, -deltah], [deltaw, deltah]]) + return Bbox(self._points + a) + def lbwh_to_bbox(left, bottom, width, height): return Bbox([[left, bottom], [left + width, bottom + height]]) @@ -67,18 +106,18 @@ return bboxes[0] bbox = bboxes[0] - xmin = bbox.xmin - ymin = bbox.ymin - xmax = bbox.xmax - ymax = bbox.ymax + xmin = bbox.xmin() + ymin = bbox.ymin() + xmax = bbox.xmax() + ymax = bbox.ymax() for bbox in bboxes[1:]: - xmin = min(xmin, bbox.xmin) - ymin = min(ymin, bbox.ymin) - xmax = max(xmax, bbox.xmax) - ymax = max(ymax, bbox.ymax) + xmin = min(xmin, bbox.xmin()) + ymin = min(ymin, bbox.ymin()) + xmax = max(xmax, bbox.xmax()) + ymax = max(ymax, bbox.ymax()) - return Bbox(xmin, ymin, xmax, ymax) + return Bbox.from_lbrt(xmin, ymin, xmax, ymax) # MGDTODO: There's probably a better place for this def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): Modified: branches/transforms/lib/matplotlib/figure.py =================================================================== --- branches/transforms/lib/matplotlib/figure.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/figure.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -129,9 +129,10 @@ if edgecolor is None: edgecolor = rcParams['figure.edgecolor'] self.dpi = dpi + self.figsize = figsize self.bbox = Bbox.from_lbwh(0, 0, - self.figsize[0] * dpi, - self.figsize[1] * dpi) + figsize[0] * dpi, + figsize[1] * dpi) self.frameon = frameon @@ -581,7 +582,8 @@ #print 'figure draw' if not self.get_visible(): return renderer.open_group('figure') - self.transFigure.freeze() # eval the lazy objects + # MGDTODO + # self.transFigure.freeze() # eval the lazy objects if self.frameon: self.figurePatch.draw(renderer) @@ -615,7 +617,8 @@ for legend in self.legends: legend.draw(renderer) - self.transFigure.thaw() # release the lazy objects + # MGDTODO + # self.transFigure.thaw() # release the lazy objects renderer.close_group('figure') self._cachedRenderer = renderer Modified: branches/transforms/lib/matplotlib/finance.py =================================================================== --- branches/transforms/lib/matplotlib/finance.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/finance.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -22,8 +22,7 @@ from matplotlib.colors import colorConverter from lines import Line2D, TICKLEFT, TICKRIGHT from patches import Rectangle -from matplotlib.transforms import scale_transform, Value, zero, one, \ - scale_sep_transform, blend_xy_sep_transform +from matplotlib.affine import Affine2D @@ -335,9 +334,9 @@ offsetsClose = [ (i, close) for i, close in zip(xrange(len(closes)), closes) if close != -1 ] - scale = ax.figure.dpi * Value(1/72.0) + scale = ax.figure.dpi * (1.0/72.0) - tickTransform = scale_transform( scale, zero()) + tickTransform = Affine2D().scaled(scale, 0.0) r,g,b = colorConverter.to_rgb(colorup) colorup = r,g,b,1 @@ -424,10 +423,10 @@ offsetsBars = [ (i, open) for i,open in zip(xrange(len(opens)), opens) if open != -1 ] - sx = ax.figure.dpi * Value(1/72.0) # scale for points + sx = ax.figure.dpi * (1.0/72.0) # scale for points sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - barTransform = scale_sep_transform(sx,sy) + barTransform = Affine2D().scaled(sx,sy) @@ -512,10 +511,10 @@ bars = [ ( (left, 0), (left, v), (right, v), (right, 0)) for v in volumes if v != -1 ] - sx = ax.figure.dpi * Value(1/72.0) # scale for points + sx = ax.figure.dpi * (1.0/72.0) # scale for points sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - barTransform = scale_sep_transform(sx,sy) + barTransform = Affine2D().scaled(sx,sy) offsetsBars = [ (i, 0) for i,v in enumerate(volumes) if v != -1 ] @@ -602,10 +601,10 @@ bars = [ ( (left, 0), (left, volume), (right, volume), (right, 0)) for d, open, close, high, low, volume in quotes] - sx = ax.figure.dpi * Value(1/72.0) # scale for points + sx = ax.figure.dpi * (1.0/72.0) # scale for points sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - barTransform = scale_sep_transform(sx,sy) + barTransform = Affine2D().scaled(sx,sy) dates = [d for d, open, close, high, low, volume in quotes] offsetsBars = [(d, 0) for d in dates] @@ -662,10 +661,10 @@ bars = [ ( (left, 0), (left, v), (right, v), (right, 0)) for v in vals if v != -1 ] - sx = ax.figure.dpi * Value(1/72.0) # scale for points + sx = ax.figure.dpi * (1.0/72.0) # scale for points sy = (ax.bbox.ur().y() - ax.bbox.ll().y()) / (ax.viewLim.ur().y() - ax.viewLim.ll().y()) - barTransform = scale_sep_transform(sx,sy) + barTransform = Affine2D().scaled(sx,sy) offsetsBars = [ (i, 0) for i,v in enumerate(vals) if v != -1 ] Modified: branches/transforms/lib/matplotlib/legend.py =================================================================== --- branches/transforms/lib/matplotlib/legend.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/legend.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -224,7 +224,7 @@ a.set_transform(self.get_transform()) def _approx_text_height(self): - return self.fontsize/72.0*self.figure.dpi.get()/self.parent.bbox.height() + return self.fontsize/72.0*self.figure.dpi/self.parent.bbox.height() def draw(self, renderer): @@ -531,7 +531,7 @@ if not len(self.legendHandles) and not len(self.texts): return def get_tbounds(text): #get text bounds in axes coords bbox = text.get_window_extent(renderer) - bboxa = inverse_transform_bbox(self.get_transform(), bbox) + bboxa = bbox.inverse_transform(self.get_transform()) return bboxa.get_bounds() hpos = [] @@ -559,9 +559,11 @@ handle.set_height(h/2) # Set the data for the legend patch - bbox = self._get_handle_text_bbox(renderer).deepcopy() + # MGDTODO: This copy may no longer be needed now that Bboxes are + # essentially immutable + bbox = self._get_handle_text_bbox(renderer).copy() - bbox.scale(1 + self.pad, 1 + self.pad) + bbox = bbox.scaled(1 + self.pad, 1 + self.pad) l,b,w,h = bbox.get_bounds() self.legendPatch.set_bounds(l,b,w,h) Modified: branches/transforms/lib/matplotlib/lines.py =================================================================== --- branches/transforms/lib/matplotlib/lines.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/lines.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -362,8 +362,13 @@ else: x, y = self._get_plottable() - - x, y = self.get_transform().numerix_x_y(x, y) + # MGDTODO: Put this in a single Nx2 array, rather than these + # separate ones + #### Conversion code + a = npy.vstack((x, y)).swapaxes(0, 1) + #### + x, y = self.get_transform()(a) + #x, y = self.get_transform().seq_x_y(x, y) left = min(x) @@ -373,7 +378,8 @@ # correct for marker size, if any if self._marker is not None: - ms = self._markersize/72.0*self.figure.dpi.get() + ms = self._markersize/72.0*self.figure.dpi + # ms = self._markersize/72.0*self.figure.dpi.get() MGDTODO left -= ms/2 bottom -= ms/2 width += ms Modified: branches/transforms/lib/matplotlib/patches.py =================================================================== --- branches/transforms/lib/matplotlib/patches.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/patches.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -209,8 +209,13 @@ gc.set_hatch(self._hatch ) verts = self.get_verts() - tverts = self.get_transform().seq_xy_tups(verts) + tverts = self.get_transform()(verts) + # MGDTODO: This result is an Nx2 numpy array, which could be passed + # directly to renderer.draw_polygon. However, it currently expects + # a list of tuples so we're converting it to that now. + tverts = [tuple(x) for x in tverts] + renderer.draw_polygon(gc, rgbFace, tverts) Modified: branches/transforms/lib/matplotlib/text.py =================================================================== --- branches/transforms/lib/matplotlib/text.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/text.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -151,7 +151,7 @@ def _get_xy_display(self): 'get the (possibly unit converted) transformed x,y in display coords' x, y = self.get_position() - return self.get_transform().xy_tup((x,y)) + return self.get_transform()([[x,y]])[0] def _get_multialignment(self): if self._multialignment is not None: return self._multialignment @@ -275,7 +275,8 @@ ty = [float(v[1][0])+offsety for v in xys] # now inverse transform back to data coords - xys = [self.get_transform().inverse_xy_tup( xy ) for xy in zip(tx, ty)] + inverse_transform = self.get_transform().inverted() + xys = inverse_transform(zip(tx, ty)) xs, ys = zip(*xys) @@ -328,7 +329,7 @@ return for line, wh, x, y in info: - x, y = trans.xy_tup((x, y)) + x, y = trans([[x, y]])[0] if renderer.flipy(): canvasw, canvash = renderer.get_canvas_width_height() @@ -405,7 +406,7 @@ return (x, y, self._text, self._color, self._verticalalignment, self._horizontalalignment, hash(self._fontproperties), self._rotation, - self.get_transform().as_vec6_val(), + self.get_transform().to_values(), ) def get_text(self): Modified: branches/transforms/lib/matplotlib/ticker.py =================================================================== --- branches/transforms/lib/matplotlib/ticker.py 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/lib/matplotlib/ticker.py 2007-09-10 19:25:21 UTC (rev 3826) @@ -115,12 +115,11 @@ import matplotlib as mpl from matplotlib import verbose, rcParams from matplotlib import cbook -from matplotlib import transforms as mtrans +from matplotlib import bbox as mbbox - class TickHelper: viewInterval = None @@ -149,8 +148,8 @@ cases where the Intervals do not need to be updated automatically. ''' - self.dataInterval = mtrans.Interval(mtrans.Value(vmin), mtrans.Value(vmax)) - self.viewInterval = mtrans.Interval(mtrans.Value(vmin), mtrans.Value(vmax)) + self.dataInterval = mbbox.Interval([vmin, vmax]) + self.viewInterval = mbbox.Interval([vmin, vmax]) class Formatter(TickHelper): """ @@ -572,7 +571,7 @@ def autoscale(self): 'autoscale the view limits' self.verify_intervals() - return mtrans.nonsingular(*self.dataInterval.get_bounds()) + return mbbox.nonsingular(*self.dataInterval.get_bounds()) def pan(self, numsteps): 'Pan numticks (can be positive or negative)' @@ -714,7 +713,7 @@ vmin = math.floor(scale*vmin)/scale vmax = math.ceil(scale*vmax)/scale - return mtrans.nonsingular(vmin, vmax) + return mbbox.nonsingular(vmin, vmax) def closeto(x,y): @@ -798,7 +797,7 @@ vmin -=1 vmax +=1 - return mtrans.nonsingular(vmin, vmax) + return mbbox.nonsingular(vmin, vmax) def scale_range(vmin, vmax, n = 1, threshold=100): dv = abs(vmax - vmin) @@ -866,13 +865,13 @@ def __call__(self): self.verify_intervals() vmin, vmax = self.viewInterval.get_bounds() - vmin, vmax = mtrans.nonsingular(vmin, vmax, expander = 0.05) + vmin, vmax = mbbox.nonsingular(vmin, vmax, expander = 0.05) return self.bin_boundaries(vmin, vmax) def autoscale(self): self.verify_intervals() dmin, dmax = self.dataInterval.get_bounds() - dmin, dmax = mtrans.nonsingular(dmin, dmax, expander = 0.05) + dmin, dmax = mbbox.nonsingular(dmin, dmax, expander = 0.05) return npy.take(self.bin_boundaries(dmin, dmax), [0,-1]) @@ -973,7 +972,7 @@ if vmin==vmax: vmin = decade_down(vmin,self._base) vmax = decade_up(vmax,self._base) - return mtrans.nonsingular(vmin, vmax) + return mbbox.nonsingular(vmin, vmax) class AutoLocator(MaxNLocator): def __init__(self): Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-09-10 18:45:32 UTC (rev 3825) +++ branches/transforms/src/_backend_agg.cpp 2007-09-10 19:25:21 UTC (rev 3826) @@ -44,6 +44,27 @@ #define M_PI_2 1.57079632679489661923 #endif +agg::trans_affine py_sequence_to_agg_transformation_matrix(const Py::Object& obj) { + Py::SeqBase<Py::Float> seq; + try { + seq = obj; + } catch(...) { + throw Py::ValueError("Transformation matrix must be given as a 6-element list."); + } + + if (seq.size() != 6) { + throw Py::ValueError("Transformation matrix must be given as a 6-element list."); + } + + agg::trans_affine xytrans = agg::trans_affine + (Py::Float(seq[0]), + Py::Float(seq[1]), + Py::Float(seq[2]), + Py::Float(seq[3]), + Py::Float(seq[4]), + Py::Float(seq[5])); +} + GCAgg::GCAgg(const Py::Object &gc, double dpi, bool snapto) : dpi(dpi), snapto(snapto), isaa(true), linewidth(1.0), alpha(1.0), cliprect(NULL), clippath(NULL), @@ -646,7 +667,8 @@ Py::SeqBase<Py::Object> linewidths = args[4]; Py::SeqBase<Py::Object> linestyle = args[5]; Py::SeqBase<Py::Object> antialiaseds = args[6]; - + + // MGDTODO: Verify we don't need this offset stuff anymore bool usingOffsets = args[7].ptr()!=Py_None; Py::SeqBase<Py::Object> offsets; Transformation* transOffset=NULL; @@ -1534,24 +1556,14 @@ //path_t transpath(path, xytrans); _process_alpha_mask(gc); - Transformation* mpltransform = static_cast<Transformation*>(args[3].ptr()); + agg::trans_affine xytrans = py_sequence_to_agg_transformation_matrix(args[3]); - double a, b, c, d, tx, ty; - try { - mpltransform->affine_params_api(&a, &b, &c, &d, &tx, &ty); - } - catch(...) { - throw Py::ValueError("Domain error on affine_params_api in RendererAgg::draw_lines"); - } - - agg::trans_affine xytrans = agg::trans_affine(a,b,c,d,tx,ty); - - agg::path_storage path; + // MGDTODO + bool needNonlinear = false; + // mpltransform->need_nonlinear_api(); - bool needNonlinear = mpltransform->need_nonlinear_api(); - double thisx(0.0), thisy(0.0); double origdx(0.0), origdy(0.0), origdNorm2(0); bool moveto = true; @@ -1584,7 +1596,8 @@ if (needNonlinear) try { - mpltransform->nonlinear_only_api(&thisx, &thisy); + // MGDTODO + // mpltransform->nonlinear_only_api(&thisx, &thisy); } catch (...) { moveto = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pki...@us...> - 2007-09-10 18:45:33
|
Revision: 3825 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3825&view=rev Author: pkienzle Date: 2007-09-10 11:45:32 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Windows needs binary open flag for font files Modified Paths: -------------- trunk/matplotlib/ttconv/pprdrv_tt.cpp Modified: trunk/matplotlib/ttconv/pprdrv_tt.cpp =================================================================== --- trunk/matplotlib/ttconv/pprdrv_tt.cpp 2007-09-10 17:45:15 UTC (rev 3824) +++ trunk/matplotlib/ttconv/pprdrv_tt.cpp 2007-09-10 18:45:32 UTC (rev 3825) @@ -1088,7 +1088,7 @@ font.filename=filename; /* Open the font file */ - if( (font.file = fopen(filename,"r")) == (FILE*)NULL ) + if( (font.file = fopen(filename,"rb")) == (FILE*)NULL ) throw TTException("Failed to open TrueType font"); /* Allocate space for the unvarying part of the offset table. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-10 17:45:18
|
Revision: 3824 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3824&view=rev Author: mdboom Date: 2007-09-10 10:45:15 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Merged revisions 3813-3823 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r3814 | jouni | 2007-09-07 15:45:48 -0400 (Fri, 07 Sep 2007) | 3 lines In backend_pdf usetex, gather consecutive characters with same x coordinate and same font into strings. ........ r3815 | mdboom | 2007-09-07 16:28:01 -0400 (Fri, 07 Sep 2007) | 3 lines Support characters composed of multiple characters. Only one supported at the moment is AA (angstrom). ........ r3816 | jouni | 2007-09-07 16:43:20 -0400 (Fri, 07 Sep 2007) | 2 lines Return widths of glyphs to caller ........ r3817 | efiring | 2007-09-08 19:53:06 -0400 (Sat, 08 Sep 2007) | 2 lines Delete gd and paint backends. ........ r3818 | efiring | 2007-09-08 20:41:17 -0400 (Sat, 08 Sep 2007) | 2 lines Removed matplotlibrc; it is generated by setup.py. ........ r3819 | efiring | 2007-09-09 18:41:36 -0400 (Sun, 09 Sep 2007) | 2 lines Factored plotting part of pylab.py into pyplot.py ........ r3820 | efiring | 2007-09-09 21:42:39 -0400 (Sun, 09 Sep 2007) | 2 lines Numpification and cleanup of examples ........ r3821 | efiring | 2007-09-10 02:55:10 -0400 (Mon, 10 Sep 2007) | 2 lines Removed obsolete and broken methods from Axes and PolarAxes ........ Modified Paths: -------------- branches/transforms/API_CHANGES branches/transforms/CHANGELOG branches/transforms/boilerplate.py branches/transforms/examples/animation_blit.py branches/transforms/examples/animation_blit_fltk.py branches/transforms/examples/animation_blit_qt.py branches/transforms/examples/animation_blit_qt4.py branches/transforms/examples/animation_blit_tk.py branches/transforms/examples/animation_blit_wx.py branches/transforms/examples/backend_driver.py branches/transforms/examples/clippedline.py branches/transforms/examples/collections_demo.py branches/transforms/examples/color_by_yvalue.py branches/transforms/examples/contourf_demo.py branches/transforms/examples/data_helper.py branches/transforms/examples/dynamic_demo_wx.py branches/transforms/examples/dynamic_image_wxagg.py branches/transforms/examples/dynamic_image_wxagg2.py branches/transforms/examples/embedding_in_gtk.py branches/transforms/examples/embedding_in_gtk2.py branches/transforms/examples/embedding_in_gtk3.py branches/transforms/examples/embedding_in_qt.py branches/transforms/examples/embedding_in_qt4.py branches/transforms/examples/embedding_in_tk.py branches/transforms/examples/embedding_in_tk2.py branches/transforms/examples/embedding_in_wx.py branches/transforms/examples/embedding_in_wx2.py branches/transforms/examples/embedding_in_wx3.py branches/transforms/examples/embedding_in_wx4.py branches/transforms/examples/gtk_spreadsheet.py branches/transforms/examples/histogram_demo_canvasagg.py branches/transforms/examples/image_masked.py branches/transforms/examples/mathtext_wx.py branches/transforms/examples/mpl_with_glade.py branches/transforms/examples/multi_image.py branches/transforms/examples/pcolor_nonuniform.py branches/transforms/examples/polar_bar.py branches/transforms/examples/polar_demo.py branches/transforms/examples/polar_legend.py branches/transforms/examples/poly_editor.py branches/transforms/examples/printing_in_wx.py branches/transforms/examples/pythonic_matplotlib.py branches/transforms/examples/rc_traits.py branches/transforms/examples/scatter_masked.py branches/transforms/examples/strip_chart_demo.py branches/transforms/examples/tex_demo.py branches/transforms/examples/tex_unicode_demo.py branches/transforms/examples/vline_demo.py branches/transforms/examples/webapp_demo.py branches/transforms/examples/wxcursor_demo.py branches/transforms/lib/matplotlib/__init__.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/backends/__init__.py branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/config/mplconfig.py branches/transforms/lib/matplotlib/config/rcsetup.py branches/transforms/lib/matplotlib/dviread.py branches/transforms/lib/matplotlib/mathtext.py branches/transforms/lib/matplotlib/mlab.py branches/transforms/lib/matplotlib/mpl-data/matplotlib.conf branches/transforms/lib/matplotlib/pylab.py branches/transforms/setupext.py Added Paths: ----------- branches/transforms/lib/matplotlib/pyplot.py Removed Paths: ------------- branches/transforms/examples/anim_tk.py branches/transforms/examples/gdtest.py branches/transforms/examples/image_demo_na.py branches/transforms/lib/matplotlib/backends/backend_gd.py branches/transforms/lib/matplotlib/backends/backend_paint.py branches/transforms/lib/matplotlib/mpl-data/matplotlibrc Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-3812 + /trunk/matplotlib:1-3823 Modified: branches/transforms/API_CHANGES =================================================================== --- branches/transforms/API_CHANGES 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/API_CHANGES 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,3 +1,5 @@ + The gd and paint backends have been deleted. + The errorbar method and function now accept additional kwargs so that upper and lower limits can be indicated by capping the bar with a caret instead of a straight line segment. Modified: branches/transforms/CHANGELOG =================================================================== --- branches/transforms/CHANGELOG 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/CHANGELOG 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,3 +1,16 @@ +2007-09-09 Split out the plotting part of pylab and put it in + pyplot.py; removed numerix from the remaining pylab.py, + which imports everything from pyplot.py. The intention + is that apart from cleanups, the result of importing + from pylab is nearly unchanged, but there is the + new alternative of importing from pyplot to get + the state-engine graphics without all the numeric + functions. + Numpified examples; deleted two that were obsolete; + modified some to use pyplot. - EF + +2007-09-08 Eliminated gd and paint backends - EF + 2007-09-06 .bmp file format is now longer an alias for .raw 2007-09-07 Added clip path support to pdf backend. - JKS @@ -6,17 +19,17 @@ Now it doesn't crash Preview.app. - JKS 2007-09-06 Refactored image saving code so that all GUI backends can - save most image types. See FILETYPES for a matrix of - backends and their supported file types. - Backend canvases should no longer write their own print_figure() - method -- instead they should write a print_xxx method for - each filetype they can output and add an entry to their - class-scoped filetypes dictionary. - MGD + save most image types. See FILETYPES for a matrix of + backends and their supported file types. + Backend canvases should no longer write their own print_figure() + method -- instead they should write a print_xxx method for + each filetype they can output and add an entry to their + class-scoped filetypes dictionary. - MGD 2007-09-05 Fixed Qt version reporting in setupext.py - DSD 2007-09-04 Embedding Type 1 fonts in PDF, and thus usetex support - via dviread, sort of works. To test, enable it by + via dviread, sort of works. To test, enable it by renaming _draw_tex to draw_tex. - JKS 2007-09-03 Added ability of errorbar show limits via caret or Modified: branches/transforms/boilerplate.py =================================================================== --- branches/transforms/boilerplate.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/boilerplate.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -29,7 +29,7 @@ return ret if Axes.%(func)s.__doc__ is not None: %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + \"\"\" -Addition kwargs: hold = [True|False] overrides default hold state\"\"\" +Additional kwargs: hold = [True|False] overrides default hold state\"\"\" """ _fmtmisc = """\ @@ -74,6 +74,8 @@ 'plot', 'plot_date', 'psd', + 'quiver', + 'quiverkey', 'scatter', 'semilogx', 'semilogy', @@ -82,8 +84,6 @@ 'stem', 'step', 'vlines', - 'quiver', - 'quiverkey', 'xcorr', ) @@ -104,7 +104,6 @@ 'pcolormesh' : 'gci._current = ret', 'imshow' : 'gci._current = ret', 'spy' : 'gci._current = ret', - 'quiver2' : 'gci._current = ret', 'quiver' : 'gci._current = ret', 'specgram' : 'gci._current = ret[-1]', @@ -129,11 +128,13 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def %(name)s(): - 'set the default colormap to %(name)s and apply to current image if any. See help(colormaps) for more information' + ''' + set the default colormap to %(name)s and apply to current image if any. + See help(colormaps) for more information + ''' rc('image', cmap='%(name)s') im = gci() - if im is not None: im.set_cmap(cm.%(name)s) draw_if_interactive() Deleted: branches/transforms/examples/anim_tk.py =================================================================== --- branches/transforms/examples/anim_tk.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/anim_tk.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,49 +0,0 @@ -# deprecated - this example is no longer needed. Follow the model of -# anim.py to use interaction = True to avoid all the cruft of timers, -# callbacks and the likes used here - -#!/usr/bin/env python2.3 - -import matplotlib -matplotlib.use('TkAgg') -import pylab - -#import Tkinter as Tk -import matplotlib.numerix as numerix -fig = pylab.figure(1) -ind = numerix.arange(60) - - - -x_tmp=[] -for i in range(100): - x_tmp.append(numerix.sin((ind+i)*numerix.pi/15.0)) - -X=numerix.array(x_tmp) - - -lines = pylab.plot(X[:,0],'o') - -manager = pylab.get_current_fig_manager() - -def updatefig(*args): - updatefig.count += 1 - lines[0].set_ydata(X[:,updatefig.count%60]) - manager.canvas.draw() - return updatefig.count -updatefig.count=-1 - -def run(*args): - print 'called run' - - import time - tstart = time.time() - while 1: - cnt = updatefig() - if cnt==100: break - print 'elapsed', 100.0/(time.time() - tstart) - -import Tkinter as Tk -manager.window.after(10, run) -manager.show() -Tk.mainloop() Modified: branches/transforms/examples/animation_blit.py =================================================================== --- branches/transforms/examples/animation_blit.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -10,7 +10,7 @@ import matplotlib matplotlib.use('GTKAgg') -import matplotlib.numerix as nx +import numpy as npy import pylab as p @@ -21,8 +21,8 @@ p.grid() # to ensure proper background restore # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) # for profiling tstart = time.time() @@ -34,7 +34,7 @@ # restore the clean slate background canvas.restore_region(update_line.background) # update the data - line.set_ydata(nx.sin(x+update_line.cnt/10.0)) + line.set_ydata(npy.sin(x+update_line.cnt/10.0)) # just draw the animated artist try: ax.draw_artist(line) Modified: branches/transforms/examples/animation_blit_fltk.py =================================================================== --- branches/transforms/examples/animation_blit_fltk.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit_fltk.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -3,7 +3,7 @@ import matplotlib matplotlib.use('FltkAgg') import pylab as p -import matplotlib.numerix as nx +import numpy as nx import time Modified: branches/transforms/examples/animation_blit_qt.py =================================================================== --- branches/transforms/examples/animation_blit_qt.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit_qt.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -15,7 +15,7 @@ ITERS = 1000 import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time class BlitQT(QObject): @@ -27,8 +27,8 @@ self.cnt = 0 # create the initial line - self.x = nx.arange(0,2*nx.pi,0.01) - self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2) + self.x = npy.arange(0,2*npy.pi,0.01) + self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2) self.background = None @@ -39,7 +39,7 @@ # restore the clean slate background self.canvas.restore_region(self.background) # update the data - self.line.set_ydata(nx.sin(self.x+self.cnt/10.0)) + self.line.set_ydata(npy.sin(self.x+self.cnt/10.0)) # just draw the animated artist self.ax.draw_artist(self.line) # just redraw the axes rectangle Modified: branches/transforms/examples/animation_blit_qt4.py =================================================================== --- branches/transforms/examples/animation_blit_qt4.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit_qt4.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -10,7 +10,7 @@ ITERS = 1000 import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time class BlitQT(QtCore.QObject): @@ -22,8 +22,8 @@ self.cnt = 0 # create the initial line - self.x = nx.arange(0,2*nx.pi,0.01) - self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2) + self.x = npy.arange(0,2*npy.pi,0.01) + self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2) self.background = None @@ -34,7 +34,7 @@ # restore the clean slate background self.canvas.restore_region(self.background) # update the data - self.line.set_ydata(nx.sin(self.x+self.cnt/10.0)) + self.line.set_ydata(npy.sin(self.x+self.cnt/10.0)) # just draw the animated artist self.ax.draw_artist(self.line) # just redraw the axes rectangle Modified: branches/transforms/examples/animation_blit_tk.py =================================================================== --- branches/transforms/examples/animation_blit_tk.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit_tk.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -6,7 +6,7 @@ import sys import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time ax = p.subplot(111) @@ -14,8 +14,8 @@ # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) def run(*args): background = canvas.copy_from_bbox(ax.bbox) @@ -26,7 +26,7 @@ # restore the clean slate background canvas.restore_region(background) # update the data - line.set_ydata(nx.sin(x+run.cnt/10.0)) + line.set_ydata(npy.sin(x+run.cnt/10.0)) # just draw the animated artist ax.draw_artist(line) # just redraw the axes rectangle Modified: branches/transforms/examples/animation_blit_wx.py =================================================================== --- branches/transforms/examples/animation_blit_wx.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/animation_blit_wx.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -12,7 +12,7 @@ import wx import sys import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time @@ -30,8 +30,8 @@ p.grid() # to ensure proper background restore # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) # for profiling tstart = time.time() @@ -46,7 +46,7 @@ # restore the clean slate background canvas.restore_region(update_line.background) # update the data - line.set_ydata(nx.sin(x+update_line.cnt/10.0)) + line.set_ydata(npy.sin(x+update_line.cnt/10.0)) # just draw the animated artist ax.draw_artist(line) # just redraw the axes rectangle Modified: branches/transforms/examples/backend_driver.py =================================================================== --- branches/transforms/examples/backend_driver.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/backend_driver.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -42,7 +42,6 @@ 'histogram_demo.py', 'image_demo.py', 'image_demo2.py', - 'image_demo_na.py', 'image_masked.py', 'image_origin.py', 'invert_axes.py', @@ -158,7 +157,7 @@ if __name__ == '__main__': times = {} - default_backends = ['Agg', 'PS', 'SVG', 'Template'] + default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template'] if sys.platform == 'win32': python = r'c:\Python24\python.exe' else: Modified: branches/transforms/examples/clippedline.py =================================================================== --- branches/transforms/examples/clippedline.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/clippedline.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -4,7 +4,7 @@ """ from matplotlib.lines import Line2D -import matplotlib.numerix as nx +import numpy as npy from pylab import figure, show class ClippedLine(Line2D): @@ -19,13 +19,13 @@ def set_data(self, *args, **kwargs): Line2D.set_data(self, *args, **kwargs) - self.xorig = nx.array(self._x) - self.yorig = nx.array(self._y) + self.xorig = npy.array(self._x) + self.yorig = npy.array(self._y) def draw(self, renderer): xlim = self.ax.get_xlim() - ind0, ind1 = nx.searchsorted(self.xorig, xlim) + ind0, ind1 = npy.searchsorted(self.xorig, xlim) self._x = self.xorig[ind0:ind1] self._y = self.yorig[ind0:ind1] N = len(self._x) @@ -43,8 +43,8 @@ fig = figure() ax = fig.add_subplot(111, autoscale_on=False) -t = nx.arange(0.0, 100.0, 0.01) -s = nx.sin(2*nx.pi*t) +t = npy.arange(0.0, 100.0, 0.01) +s = npy.sin(2*npy.pi*t) line = ClippedLine(ax, t, s, color='g', ls='-', lw=2) ax.add_line(line) ax.set_xlim(10,30) Modified: branches/transforms/examples/collections_demo.py =================================================================== --- branches/transforms/examples/collections_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/collections_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -17,10 +17,10 @@ ''' -import pylab as P +import matplotlib.pyplot as P from matplotlib import collections, axes, transforms from matplotlib.colors import colorConverter -import matplotlib.numerix as N +import numpy as N nverts = 50 npts = 100 @@ -33,8 +33,8 @@ spiral = zip(xx,yy) # Make some offsets -xo = P.randn(npts) -yo = P.randn(npts) +xo = N.random.randn(npts) +yo = N.random.randn(npts) xyo = zip(xo, yo) # Make a list of colors cycling through the rgbcmyk series. @@ -90,7 +90,7 @@ a = fig.add_subplot(2,2,3) col = collections.RegularPolyCollection(fig.dpi, 7, - sizes = P.fabs(xx)*10, offsets=xyo, + sizes = N.fabs(xx)*10, offsets=xyo, transOffset=a.transData) a.add_collection(col, autolim=True) trans = transforms.scale_transform(fig.dpi/transforms.Value(72.), @@ -111,12 +111,12 @@ ncurves = 20 offs = (0.1, 0.0) -yy = P.linspace(0, 2*N.pi, nverts) -ym = P.amax(yy) +yy = N.linspace(0, 2*N.pi, nverts) +ym = N.amax(yy) xx = (0.2 + (ym-yy)/ym)**2 * N.cos(yy-0.4) * 0.5 segs = [] for i in range(ncurves): - xxx = xx + 0.02*P.randn(nverts) + xxx = xx + 0.02*N.random.randn(nverts) curve = zip(xxx, yy*100) segs.append(curve) Modified: branches/transforms/examples/color_by_yvalue.py =================================================================== --- branches/transforms/examples/color_by_yvalue.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/color_by_yvalue.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,7 +1,7 @@ # use masked arrays to plot a line with different colors by y-value -import matplotlib.numerix.ma as ma -from matplotlib.numerix import logical_or -from pylab import plot, show, arange, sin, pi +import matplotlib.numerix.npyma as ma +from numpy import logical_or, arange, sin, pi +from matplotlib.pyplot import plot, show t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) Modified: branches/transforms/examples/contourf_demo.py =================================================================== --- branches/transforms/examples/contourf_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/contourf_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,6 +1,6 @@ #!/usr/bin/env python from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma origin = 'lower' #origin = 'upper' Modified: branches/transforms/examples/data_helper.py =================================================================== --- branches/transforms/examples/data_helper.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/data_helper.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,7 +1,8 @@ #!/usr/bin/env python # Some functions to load a return data for the plot demos -from matplotlib.numerix import fromstring, argsort, take, array, resize +from numpy import fromstring, argsort, take, array, resize + def get_two_stock_data(): """ load stock time and price data for two stocks The return values Modified: branches/transforms/examples/dynamic_demo_wx.py =================================================================== --- branches/transforms/examples/dynamic_demo_wx.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/dynamic_demo_wx.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -63,7 +63,7 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot -import matplotlib.numerix as numpy +import numpy from wx import * Modified: branches/transforms/examples/dynamic_image_wxagg.py =================================================================== --- branches/transforms/examples/dynamic_image_wxagg.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/dynamic_image_wxagg.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -12,26 +12,13 @@ import matplotlib matplotlib.use('WXAgg') -# jdh: you need to control Numeric vs numarray with numerix, otherwise -# matplotlib may be using numeric under the hood and while you are -# using numarray and this isn't efficient. Also, if you use -# numerix=numarray, it is important to compile matplotlib for numarray -# by setting NUMERIX = 'numarray' in setup.py before building from matplotlib import rcParams -##rcParams['numerix'] = 'numarray' - - -# jdh: you can import cm directly, you don't need to go via -# pylab import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg -# jdh: you don't need a figure manager in the GUI - this class was -# designed for the pylab interface - from matplotlib.figure import Figure -import matplotlib.numerix as numerix +import numpy as npy import wx @@ -75,12 +62,12 @@ # jdh you can add a subplot directly from the fig rather than # the fig manager a = self.fig.add_subplot(111) - self.x = numerix.arange(120.0)*2*numerix.pi/120.0 + self.x = npy.arange(120.0)*2*npy.pi/120.0 self.x.resize((100,120)) - self.y = numerix.arange(100.0)*2*numerix.pi/100.0 + self.y = npy.arange(100.0)*2*npy.pi/100.0 self.y.resize((120,100)) - self.y = numerix.transpose(self.y) - z = numerix.sin(self.x) + numerix.cos(self.y) + self.y = npy.transpose(self.y) + z = npy.sin(self.x) + npy.cos(self.y) self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest') def GetToolBar(self): @@ -89,9 +76,9 @@ return self.toolbar def onTimer(self, evt): - self.x += numerix.pi/15 - self.y += numerix.pi/20 - z = numerix.sin(self.x) + numerix.cos(self.y) + self.x += npy.pi/15 + self.y += npy.pi/20 + z = npy.sin(self.x) + npy.cos(self.y) self.im.set_array(z) self.canvas.draw() #self.canvas.gui_repaint() # jdh wxagg_draw calls this already Modified: branches/transforms/examples/dynamic_image_wxagg2.py =================================================================== --- branches/transforms/examples/dynamic_image_wxagg2.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/dynamic_image_wxagg2.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -12,24 +12,14 @@ import matplotlib matplotlib.use('WXAgg') -# jdh: you need to control Numeric vs numarray with numerix, otherwise -# matplotlib may be using numeric under the hood and while you are -# using numarray and this isn't efficient. Also, if you use -# numerix=numarray, it is important to compile matplotlib for numarray -# by setting NUMERIX = 'numarray' in setup.py before building from matplotlib import rcParams import numpy as npy -# jdh: you can import cm directly, you don't need to go via -# pylab import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.backends.backend_wx import NavigationToolbar2Wx -# jdh: you don't need a figure manager in the GUI - this class was -# designed for the pylab interface - from matplotlib.figure import Figure from wx import * Modified: branches/transforms/examples/embedding_in_gtk.py =================================================================== --- branches/transforms/examples/embedding_in_gtk.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_gtk.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -8,7 +8,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: branches/transforms/examples/embedding_in_gtk2.py =================================================================== --- branches/transforms/examples/embedding_in_gtk2.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_gtk2.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -7,7 +7,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: branches/transforms/examples/embedding_in_gtk3.py =================================================================== --- branches/transforms/examples/embedding_in_gtk3.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_gtk3.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -7,7 +7,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo #from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: branches/transforms/examples/embedding_in_qt.py =================================================================== --- branches/transforms/examples/embedding_in_qt.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_qt.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -11,7 +11,7 @@ import sys, os, random from qt import * -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure Modified: branches/transforms/examples/embedding_in_qt4.py =================================================================== --- branches/transforms/examples/embedding_in_qt4.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_qt4.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -12,7 +12,7 @@ import sys, os, random from PyQt4 import QtGui, QtCore -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure Modified: branches/transforms/examples/embedding_in_tk.py =================================================================== --- branches/transforms/examples/embedding_in_tk.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_tk.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -2,7 +2,7 @@ import matplotlib matplotlib.use('TkAgg') -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.axes import Subplot from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure Modified: branches/transforms/examples/embedding_in_tk2.py =================================================================== --- branches/transforms/examples/embedding_in_tk2.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_tk2.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -2,7 +2,7 @@ import matplotlib matplotlib.use('TkAgg') -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.axes import Subplot from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure Modified: branches/transforms/examples/embedding_in_wx.py =================================================================== --- branches/transforms/examples/embedding_in_wx.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_wx.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -44,7 +44,7 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot -import matplotlib.numerix as numpy +import numpy from wx import * Modified: branches/transforms/examples/embedding_in_wx2.py =================================================================== --- branches/transforms/examples/embedding_in_wx2.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_wx2.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -4,7 +4,7 @@ toolbar - comment out the setA_toolbar line for no toolbar """ -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import matplotlib Modified: branches/transforms/examples/embedding_in_wx3.py =================================================================== --- branches/transforms/examples/embedding_in_wx3.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_wx3.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -25,8 +25,6 @@ from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg from matplotlib.figure import Figure import numpy as npy -import matplotlib.numerix.mlab as mlab -from matplotlib.mlab import meshgrid from wx import * from wx.xrc import * @@ -61,11 +59,11 @@ x = npy.arange(120.0)*2*npy.pi/60.0 y = npy.arange(100.0)*2*npy.pi/50.0 - self.x, self.y = meshgrid(x, y) + self.x, self.y = npy.meshgrid(x, y) z = npy.sin(self.x) + npy.cos(self.y) self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest') - zmax = mlab.max(mlab.max(z))-ERR_TOL + zmax = npy.amax(z) - ERR_TOL ymax_i, xmax_i = npy.nonzero(z >= zmax) if self.im.origin == 'upper': ymax_i = z.shape[0]-ymax_i @@ -84,7 +82,7 @@ z = npy.sin(self.x) + npy.cos(self.y) self.im.set_array(z) - zmax = mlab.max(mlab.max(z))-ERR_TOL + zmax = npy.amax(z) - ERR_TOL ymax_i, xmax_i = npy.nonzero(z >= zmax) if self.im.origin == 'upper': ymax_i = z.shape[0]-ymax_i Modified: branches/transforms/examples/embedding_in_wx4.py =================================================================== --- branches/transforms/examples/embedding_in_wx4.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/embedding_in_wx4.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -4,7 +4,7 @@ toolbar """ -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import matplotlib @@ -19,7 +19,7 @@ from matplotlib.backends.backend_wx import _load_bitmap from matplotlib.figure import Figure -from matplotlib.numerix.mlab import rand +from numpy.random import rand from wx import * Deleted: branches/transforms/examples/gdtest.py =================================================================== --- branches/transforms/examples/gdtest.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/gdtest.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,34 +0,0 @@ -#!/usr/bin/env python -import matplotlib -matplotlib.use('GD') -from pylab import * - -def f(t): - s1 = cos(2*pi*t) - e1 = exp(-t) - return multiply(s1,e1) - -t1 = arange(0.0, 5.0, .1) -t2 = arange(0.0, 5.0, 0.02) -t3 = arange(0.0, 2.0, 0.01) - - -if 1: - subplot(211) - l = plot(t1, f(t1), 'k-^') - setp(l, 'markerfacecolor', 'r') - xlim(0,5) - title('A tale of 2 subplots', fontsize=12) - ylabel('Signal 1', fontsize=10) - - subplot(212) - l = plot(t1, f(t1), 'k->') - xlim(0,5) - ylabel('Signal 2', fontsize=10) - xlabel('time (s)', fontsize=10, fontname='Courier') - -ax = gca() - - -#savefig('gdtest', dpi=150) -show() Modified: branches/transforms/examples/gtk_spreadsheet.py =================================================================== --- branches/transforms/examples/gtk_spreadsheet.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/gtk_spreadsheet.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -14,15 +14,13 @@ matplotlib.use('GTKAgg') # or 'GTK' from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas -#from matplotlib.numerix import rand -from matplotlib.numerix.random_array import random +from numpy.random import random from matplotlib.figure import Figure class DataManager(gtk.Window): numRows, numCols = 20,10 - #data = rand(numRows, numCols) data = random((numRows, numCols)) def __init__(self): Modified: branches/transforms/examples/histogram_demo_canvasagg.py =================================================================== --- branches/transforms/examples/histogram_demo_canvasagg.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/histogram_demo_canvasagg.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -13,7 +13,8 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot from matplotlib.mlab import normpdf -from matplotlib.numerix.mlab import randn +from numpy.random import randn +import numpy fig = Figure(figsize=(5,4), dpi=100) ax = fig.add_subplot(111) @@ -42,14 +43,14 @@ s = canvas.tostring_rgb() # save this and convert to bitmap as needed -# get the figure dimensions for creating bitmaps or numeric arrays, +# get the figure dimensions for creating bitmaps or numpy arrays, # etc. l,b,w,h = fig.bbox.get_bounds() w, h = int(w), int(h) if 0: - # convert to a Numeric array - X = fromstring(s, UInt8) + # convert to a numpy array + X = numpy.fromstring(s, numpy.uint8) X.shape = h, w, 3 if 0: Deleted: branches/transforms/examples/image_demo_na.py =================================================================== --- branches/transforms/examples/image_demo_na.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/image_demo_na.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,40 +0,0 @@ -#!/usr/bin/env python -from matplotlib import rcParams -rcParams['numerix'] = 'numarray' - -from pylab import * - - -def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0, - mux=0.0, muy=0.0, sigmaxy=0.0): - """ - Bivariate gaussan distribution for equal shape X, Y - - http://mathworld.wolfram.com/BivariateNormalDistribution.html - """ - Xmu = X-mux - Ymu = Y-muy - - rho = sigmaxy/(sigmax*sigmay) - z = (1.0/sigmax**2)*Xmu**2 + (1.0/sigmay)*Ymu**2 - (2*rho/(sigmax*sigmay))*Xmu*Ymu - return 1.0/(2*pi*sigmax*sigmay*(1-rho**2)) * exp( -1/(2*(1-rho**2))*z) - - -delta = 0.025 -x = arange(-3.0, 3.0, delta) -y = arange(-3.0, 3.0, delta) -X,Y = meshgrid(x, y) -Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) -Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) - -# difference of Gaussians -im = imshow(Z2-Z1) - -# set the interpolation method: 'nearest', 'bilinear', 'bicubic' and much more -im.set_interpolation('bilinear') - - -axis('off') -#savefig('test') -show() - Modified: branches/transforms/examples/image_masked.py =================================================================== --- branches/transforms/examples/image_masked.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/image_masked.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -4,7 +4,7 @@ ''' from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma import matplotlib.colors as colors delta = 0.025 Modified: branches/transforms/examples/mathtext_wx.py =================================================================== --- branches/transforms/examples/mathtext_wx.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/mathtext_wx.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -5,7 +5,7 @@ import matplotlib matplotlib.use("WxAgg") -from matplotlib.numerix import arange, sin, pi, cos, log +from numpy import arange, sin, pi, cos, log from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure @@ -42,14 +42,14 @@ self.figure = Figure() self.axes = self.figure.add_subplot(111) self.change_plot(0) - + self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.add_buttonbar() self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.add_toolbar() # comment this out for no toolbar - + menuBar = wx.MenuBar() # File Menu @@ -104,21 +104,21 @@ def OnChangePlot(self, event): self.change_plot(event.GetId() - 1000) - + def change_plot(self, plot_number): t = arange(1.0,3.0,0.01) s = functions[plot_number][1](t) self.axes.clear() self.axes.plot(t, s) self.Refresh() - + class MyApp(wx.App): def OnInit(self): frame = CanvasFrame(None, "wxPython mathtext demo app") self.SetTopWindow(frame) frame.Show(True) return True - + app = MyApp() app.MainLoop() Modified: branches/transforms/examples/mpl_with_glade.py =================================================================== --- branches/transforms/examples/mpl_with_glade.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/mpl_with_glade.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -8,7 +8,7 @@ from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar from matplotlib.widgets import SpanSelector -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import gtk import gtk.glade Modified: branches/transforms/examples/multi_image.py =================================================================== --- branches/transforms/examples/multi_image.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/multi_image.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -5,19 +5,20 @@ It also illustrates colorbar tick labelling with a multiplier. ''' -import pylab +from matplotlib.pyplot import figure, show, sci from matplotlib import cm, colors from matplotlib.font_manager import FontProperties -from matplotlib.numerix.mlab import amin, amax +from numpy import amin, amax, ravel +from numpy.random import rand Nr = 3 Nc = 2 -fig = pylab.gcf() +fig = figure() cmap = cm.cool figtitle = 'Multiple images' -t = pylab.gcf().text(0.5, 0.95, figtitle, +t = fig.text(0.5, 0.95, figtitle, horizontalalignment='center', fontproperties=FontProperties(size=16)) @@ -37,8 +38,8 @@ a.set_xticklabels([]) # Make some fake data with a range that varies # somewhat from one plot to the next. - data =((1+i+j)/10.0)*pylab.rand(10,20)*1e-6 - dd = pylab.ravel(data) + data =((1+i+j)/10.0)*rand(10,20)*1e-6 + dd = ravel(data) # Manually find the min and max of all colors for # use in setting the color scale. vmin = min(vmin, amin(dd)) @@ -60,12 +61,13 @@ # We need the following only if we want to run this # script interactively and be able to change the colormap. -pylab.sci(images[0]) -pylab.show() +sci(images[0]) +show() + Modified: branches/transforms/examples/pcolor_nonuniform.py =================================================================== --- branches/transforms/examples/pcolor_nonuniform.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/pcolor_nonuniform.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,11 +1,11 @@ -from pylab import figure, show -import matplotlib.numerix as nx +from matplotlib.pyplot import figure, show +import numpy as npy from matplotlib.image import NonUniformImage -x = nx.arange(-4, 4, 0.005) -y = nx.arange(-4, 4, 0.005) +x = npy.arange(-4, 4, 0.005) +y = npy.arange(-4, 4, 0.005) print 'Size %d points' % (len(x) * len(y)) -z = nx.sqrt(x[nx.NewAxis,:]**2 + y[:,nx.NewAxis]**2) +z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2) fig = figure() ax = fig.add_subplot(111) Modified: branches/transforms/examples/polar_bar.py =================================================================== --- branches/transforms/examples/polar_bar.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/polar_bar.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,9 +1,8 @@ #!/usr/bin/env python -import matplotlib.numerix as nx -from matplotlib.mlab import linspace +import numpy as npy import matplotlib.cm as cm -from pylab import figure, show, rc +from matplotlib.pyplot import figure, show, rc # force square figure and square axes looks better for polar, IMO @@ -11,9 +10,9 @@ ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True) N = 20 -theta = nx.arange(0.0, 2*nx.pi, 2*nx.pi/N) -radii = 10*nx.mlab.rand(N) -width = nx.pi/4*nx.mlab.rand(N) +theta = npy.arange(0.0, 2*npy.pi, 2*npy.pi/N) +radii = 10*npy.random.rand(N) +width = npy.pi/4*npy.random.rand(N) bars = ax.bar(theta, radii, width=width, bottom=0.1) for r,bar in zip(radii, bars): bar.set_facecolor( cm.jet(r/10.)) Modified: branches/transforms/examples/polar_demo.py =================================================================== --- branches/transforms/examples/polar_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/polar_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -39,8 +39,8 @@ # See the pylab rgrids and thetagrids functions for # information on how to customize the grid locations and labels -import matplotlib.numerix as nx -from pylab import figure, show, rc +import numpy as npy +from matplotlib.pyplot import figure, show, rc # radar green, solid grid lines rc('grid', color='#316931', linewidth=1, linestyle='-') @@ -51,8 +51,8 @@ fig = figure(figsize=(8,8)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') -r = nx.arange(0, 3.0, 0.01) -theta = 2*nx.pi*r +r = npy.arange(0, 3.0, 0.01) +theta = 2*npy.pi*r ax.plot(theta, r, color='#ee8d18', lw=3) ax.set_rmax(2.0) Modified: branches/transforms/examples/polar_legend.py =================================================================== --- branches/transforms/examples/polar_legend.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/polar_legend.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,7 +1,7 @@ #!/usr/bin/env python -import matplotlib.numerix as nx -from pylab import figure, show, rc +import numpy as npy +from matplotlib.pyplot import figure, show, rc # radar green, solid grid lines rc('grid', color='#316931', linewidth=1, linestyle='-') @@ -12,8 +12,8 @@ fig = figure(figsize=(8,8)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') -r = nx.arange(0, 3.0, 0.01) -theta = 2*nx.pi*r +r = npy.arange(0, 3.0, 0.01) +theta = 2*npy.pi*r ax.plot(theta, r, color='#ee8d18', lw=3, label='a line') ax.plot(0.5*theta, r, color='blue', ls='--', lw=3, label='another line') ax.legend() Modified: branches/transforms/examples/poly_editor.py =================================================================== --- branches/transforms/examples/poly_editor.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/poly_editor.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -5,8 +5,7 @@ """ from matplotlib.artist import Artist from matplotlib.patches import Polygon, CirclePolygon -from matplotlib.numerix import sqrt, nonzero, equal, asarray, dot, Float -from matplotlib.numerix.mlab import amin +from numpy import sqrt, nonzero, equal, asarray, dot, amin from matplotlib.mlab import dist_point_to_segment Modified: branches/transforms/examples/printing_in_wx.py =================================================================== --- branches/transforms/examples/printing_in_wx.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/printing_in_wx.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -39,7 +39,7 @@ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from matplotlib.figure import Figure -import matplotlib.numerix as numpy +import numpy class PlotFrame(wx.Frame): help_msg=""" Menus for Modified: branches/transforms/examples/pythonic_matplotlib.py =================================================================== --- branches/transforms/examples/pythonic_matplotlib.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/pythonic_matplotlib.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -54,7 +54,7 @@ from pylab import figure, close, axes, subplot, show -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi t = arange(0.0, 1.0, 0.01) Modified: branches/transforms/examples/rc_traits.py =================================================================== --- branches/transforms/examples/rc_traits.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/rc_traits.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -128,8 +128,8 @@ antialiased = flexible_true_trait timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more -backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GD', 'GDK', 'GTK', 'Agg', - 'GTKCairo', 'Paint', 'PS', 'SVG', 'Template', 'TkAgg', +backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GDK', 'GTK', 'Agg', + 'GTKCairo', 'PS', 'SVG', 'Template', 'TkAgg', 'WX') class RC(traits.HasTraits): Modified: branches/transforms/examples/scatter_masked.py =================================================================== --- branches/transforms/examples/scatter_masked.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/scatter_masked.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,6 +1,6 @@ #!/usr/bin/env python from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma N = 100 r0 = 0.6 Modified: branches/transforms/examples/strip_chart_demo.py =================================================================== --- branches/transforms/examples/strip_chart_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/strip_chart_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -12,7 +12,7 @@ import gobject, gtk import matplotlib matplotlib.use('GTKAgg') -import matplotlib.numerix as nx +import numpy as npy from matplotlib.lines import Line2D @@ -36,9 +36,9 @@ def emitter(self, p=0.01): 'return a random value with probability p, else 0' - v = nx.mlab.rand(1) + v = npy.random.rand(1) if v>p: return 0. - else: return nx.mlab.rand(1) + else: return npy.random.rand(1) def update(self, *args): if self.background is None: return True Modified: branches/transforms/examples/tex_demo.py =================================================================== --- branches/transforms/examples/tex_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/tex_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -11,8 +11,8 @@ """ from matplotlib import rc -from matplotlib.numerix import arange, cos, pi -from pylab import figure, axes, plot, xlabel, ylabel, title, \ +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ grid, savefig, show Modified: branches/transforms/examples/tex_unicode_demo.py =================================================================== --- branches/transforms/examples/tex_unicode_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/tex_unicode_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -7,8 +7,8 @@ from matplotlib import rcParams rcParams['text.usetex']=True rcParams['text.latex.unicode']=True -from matplotlib.numerix import arange, cos, pi -from pylab import figure, axes, plot, xlabel, ylabel, title, \ +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ grid, savefig, show figure(1) Modified: branches/transforms/examples/vline_demo.py =================================================================== --- branches/transforms/examples/vline_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/vline_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,17 +1,17 @@ #!/usr/bin/env python -from pylab import * -from matplotlib.numerix import sin, exp, multiply, absolute, pi -from matplotlib.numerix.random_array import normal +from matplotlib.pyplot import * +from numpy import sin, exp, absolute, pi, arange +from numpy.random import normal def f(t): s1 = sin(2*pi*t) e1 = exp(-t) - return absolute(multiply(s1,e1))+.05 + return absolute((s1*e1))+.05 t = arange(0.0, 5.0, 0.1) s = f(t) -nse = multiply(normal(0.0, 0.3, t.shape), s) +nse = normal(0.0, 0.3, t.shape) * s plot(t, s+nse, 'b^') vlines(t, [0], s) Modified: branches/transforms/examples/webapp_demo.py =================================================================== --- branches/transforms/examples/webapp_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/webapp_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -21,7 +21,7 @@ from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure from matplotlib.cbook import iterable -import matplotlib.numerix as nx +import numpy as npy def make_fig(): """ @@ -40,9 +40,9 @@ line, = ax.plot([1,2,3], 'ro--', markersize=12, markerfacecolor='g') # make a translucent scatter collection - x = nx.mlab.rand(100) - y = nx.mlab.rand(100) - area = nx.pi*(10 * nx.mlab.rand(100))**2 # 0 to 10 point radiuses + x = npy.random.rand(100) + y = npy.random.rand(100) + area = npy.pi*(10 * npy.random.rand(100))**2 # 0 to 10 point radiuses c = ax.scatter(x,y,area) c.set_alpha(0.5) Modified: branches/transforms/examples/wxcursor_demo.py =================================================================== --- branches/transforms/examples/wxcursor_demo.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/examples/wxcursor_demo.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -6,7 +6,7 @@ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import wx Modified: branches/transforms/lib/matplotlib/__init__.py =================================================================== --- branches/transforms/lib/matplotlib/__init__.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/lib/matplotlib/__init__.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -530,16 +530,16 @@ class RcParams(dict): - + """A dictionary object including validation - + validating functions are defined and associated with rc parameters in rcsetup.py """ - + validate = dict([ (key, converter) for key, (default, converter) in \ defaultParams.iteritems() ]) - + def __setitem__(self, key, val): try: if key in _deprecated_map.keys(): @@ -620,7 +620,7 @@ ret['datapath'] = get_data_path() verbose.report('loaded rc file %s'%fname) - + return ret Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/lib/matplotlib/axes.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1867,31 +1867,6 @@ c =mcolors.colorConverter.to_rgba(c) self._cursorProps = lw, c - - def panx(self, numsteps): - 'Pan the x axis numsteps (plus pan right, minus pan left)' - self.xaxis.pan(numsteps) - xmin, xmax = self.viewLim.intervalx().get_bounds() - self._send_xlim_event() - - def pany(self, numsteps): - 'Pan the x axis numsteps (plus pan up, minus pan down)' - self.yaxis.pan(numsteps) - self._send_ylim_event() - - def zoomx(self, numsteps): - 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)' - self.xaxis.zoom(numsteps) - xmin, xmax = self.viewLim.intervalx().get_bounds() - self._send_xlim_event() - - def zoomy(self, numsteps): - 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)' - self.yaxis.zoom(numsteps) - self._send_ylim_event() - - - def connect(self, s, func): """ Register observers to be notified when certain events occur. Register @@ -1913,6 +1888,7 @@ def disconnect(self, cid): 'disconnect from the Axes event.' raise DeprecationWarning('use the callbacks CallbackRegistry instance instead') + def get_children(self): 'return a list of child artists' children = [] @@ -5683,38 +5659,14 @@ 'ylabel not implemented' raise NotImplementedError('ylabel not defined for polar axes (yet)') + def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs): + 'xlim not implemented' + raise NotImplementedError('xlim not meaningful for polar axes') - def set_xlim(self, xmin=None, xmax=None, emit=True): - """ - set the xlimits - ACCEPTS: len(2) sequence of floats - """ - if xmax is None and iterable(xmin): - xmin,xmax = xmin + def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): + 'ylim not implemented' + raise NotImplementedError('ylim not meaningful for polar axes') - old_xmin,old_xmax = self.get_xlim() - if xmin is None: xmin = old_xmin - if xmax is None: xmax = old_xmax - - self.viewLim.intervalx().set_bounds(xmin, xmax) - if emit: self._send_xlim_event() - - - def set_ylim(self, ymin=None, ymax=None, emit=True): - """ - set the ylimits - ACCEPTS: len(2) sequence of floats - """ - if ymax is None and iterable(ymin): - ymin,ymax = ymin - - old_ymin,old_ymax = self.get_ylim() - if ymin is None: ymin = old_ymin - if ymax is None: ymax = old_ymax - - self.viewLim.intervaly().set_bounds(ymin, ymax) - if emit: self._send_ylim_event() - def get_xscale(self): 'return the xaxis scale string' return 'polar' @@ -5765,10 +5717,9 @@ """ # this is some discarded code I was using to find the minimum positive # data point for some log scaling fixes. I realized there was a -# cleaner way to do it, but am ke -eping this around as an example for +# cleaner way to do it, but am keeping this around as an example for # how to get the data out of the axes. Might want to make something -# like this a method one day, or better yet make get_verts and Artist +# like this a method one day, or better yet make get_verts an Artist # method minx, maxx = self.get_xlim() Modified: branches/transforms/lib/matplotlib/backends/__init__.py =================================================================== --- branches/transforms/lib/matplotlib/backends/__init__.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/lib/matplotlib/backends/__init__.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -7,7 +7,7 @@ interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg', 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg', 'Aqt'] -non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GD', 'GDK', 'Paint', +non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GDK', 'Pdf', 'PS', 'SVG', 'Template'] all_backends = interactive_bk + non_interactive_bk Deleted: branches/transforms/lib/matplotlib/backends/backend_gd.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_gd.py 2007-09-10 17:40:47 UTC (rev 3823) +++ branches/transforms/lib/matplotlib/backends/backend_gd.py 2007-09-10 17:45:15 UTC (rev 3824) @@ -1,374 +0,0 @@ -""" -A gd backend http://newcenturycomputers.net/projects/gdmodule.html -""" - - -from __future__ import division -import sys, os, math, warnings - -import numpy as npy - -try: - import gd -except ImportError: - print >>sys.stderr, 'You must first install the gd module http://newcenturycomputers.net/projects/gdmodule.html' - sys.exit() - -from matplotlib.backend_bases import RendererBase, \ - GraphicsContextBase, FigureManagerBase, FigureCanvasBase -from matplotlib import verbose -from matplotlib._pylab_helpers import Gcf -from matplotlib.cbook import enumerate, pieces, is_string_like -from matplotlib.colors import colorConverter -from matplotlib.figure import Figure -from matplotlib.transforms import Bbox -from matplotlib.font_manager import findfont -# support old font names -if (os.environ.has_key('GDFONTPATH') and not - os.environ.has_key('TTFPATH')): - os.environ['TTFPATH'] = os.environ['GDFONTPATH'] - - - - -PIXELS_PER_INCH = 96 # constant GD uses for screen DPI - - -def round(x): - return int(math.floor(x+0.5)) - - -class RendererGD(RendererBase): - """ - The renderer handles all the drawing primitives using a graphics - context instance that controls the colors/styles - """ - - - # todo: can gd support cap and join styles? - def __init__(self, im, dpi): - "Initialize the renderer with a gd image instance" - self.im = im - self._cached = {} # a map from get_color args to colors - - self.width, self.height = im.size() - self.dpi = dpi - - - def get_canvas_width_height(... [truncated message content] |
From: <md...@us...> - 2007-09-10 17:40:51
|
Revision: 3823 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3823&view=rev Author: mdboom Date: 2007-09-10 10:40:47 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Adding new files that will eventually replace transforms.py/cpp Added Paths: ----------- branches/transforms/lib/matplotlib/affine.py branches/transforms/lib/matplotlib/bbox.py Added: branches/transforms/lib/matplotlib/affine.py =================================================================== --- branches/transforms/lib/matplotlib/affine.py (rev 0) +++ branches/transforms/lib/matplotlib/affine.py 2007-09-10 17:40:47 UTC (rev 3823) @@ -0,0 +1,207 @@ +""" +A set of classes to handle transformations. + +2007 Michael Droettboom +""" + +import numpy as N +from numpy.linalg import inv + +class Transform(object): + def __call__(self, points): + raise NotImplementedError() + + def __add__(self, other): + if isinstance(other, Transform): + return CompositeTransform(self, other) + raise TypeError("Can not add Transform to object of type '%s'" % type(other)) + + def __radd__(self, other): + if isinstance(other, Transform): + return CompositeTransform(other, self) + raise TypeError("Can not add Transform to object of type '%s'" % type(other)) + + def has_inverse(self): + raise NotImplementedError() + + def inverted(self): + raise NotImplementedError() + + def is_separable(self): + return False + +class CompositeTransform(Transform): + def __init__(self, a, b): + assert a.output_dims == b.input_dims + self.a = a + self.b = b + + def __call__(self, points): + return self.b(self.a(points)) + +class Affine2D(Transform): + input_dims = 2 + output_dims = 2 + + def __init__(self, matrix = None): + """ + Initialize an Affine transform from a 3x3 numpy float array. + + a c e + b d f + 0 0 1 + """ + if matrix is None: + matrix = N.identity(3) + else: + assert matrix.shape == (3, 3) + self.mtx = matrix + + def __repr__(self): + return repr(self.mtx) + + def __str__(self): + return str(self.mtx) + + #@staticmethod + def from_values(a, b, c, d, e, f): + return Affine2D(Affine2D.matrix_from_values(a, b, c, d, e, f)) + from_values = staticmethod(from_values) + + #@staticmethod + def matrix_from_values(a, b, c, d, e, f): + affine = N.zeros((3,3), N.float_) + affine[0,] = a, c, e + affine[1,] = b, d, f + affine[2,2] = 1 + return affine + matrix_from_values = staticmethod(matrix_from_values) + + def __call__(self, points): + """ + Applies the transformation to a set of 2D points and + returns the result. + + points must be a numpy array of shape (N, 2), where N is the + number of points. + """ + # MGDTODO: This involves a copy. We may need to do something like + # http://neuroimaging.scipy.org/svn/ni/ni/trunk/neuroimaging/core/reference/mapping.py + # to separate the matrix out into the translation and scale components + # and apply each separately (which is still sub-optimal) + + # This is nicer for now, however, since we can just keep a + # regular affine matrix around + new_points = points.swapaxes(0, 1) + new_points = N.vstack((new_points, N.ones((1, points.shape[0])))) + result = N.dot(self.mtx, new_points)[:2] + result.swapaxes(0, 1) + return result + + #@staticmethod + def _concat(a, b): + return N.dot(b, a) + _concat = staticmethod(_concat) + + def concat(a, b): + return Affine2D(Affine2D._concat(a.mtx, b.mtx)) + concat = staticmethod(concat) + + #@staticmethod + def identity(): + return Affine2D(N.identity(3)) + identity = staticmethod(identity) + + def __add__(self, other): + if isinstance(other, Affine2D): + return Affine2D.concat(self, other) + return Transform.__add__(self, other) + + def __radd__(self, other): + if isinstance(other, Affine2D): + return Affine2D.concat(other, self) + return Transform.__radd__(self, other) + + def rotated(self, theta): + a = N.cos(theta) + b = N.sin(theta) + rotate_mtx = self.matrix_from_values(a, b, -b, a, 0, 0) + return Affine2D(self._concat(self.mtx, rotate_mtx)) + + def rotated_deg(self, degrees): + return self.rotated(degrees*N.pi/180.) + + def translated(self, tx, ty): + translate_mtx = self.matrix_from_values(1., 0., 0., 1., tx, ty) + return Affine2D(self._concat(self.mtx, translate_mtx)) + + def scaled(self, sx, sy=None): + if sy is None: + sy = sx + scale_mtx = self.matrix_from_values(sx, 0., 0., sy, 0., 0.) + return Affine2D(self._concat(self.mtx, scale_mtx)) + + def inverted(self): + # MGDTODO: We may want to optimize by storing the inverse + # of the transform with every transform + return Affine2D(inv(self.mtx)) + + def is_separable(self): + mtx = self.mtx + return mtx[0, 1] == 0.0 and mtx[1, 0] == 0.0 + +class BlendedAffine2D(Affine2D): + def __init__(self, x_transform, y_transform): + assert isinstance(x_transform, Affine2D) + assert isinstance(y_transform, Affine2D) + assert x_transform.is_separable() + assert y_transform.is_separable() + x_mtx = x_transform.mtx + y_mtx = y_transform.mtx + self.mtx = self.matrix_from_values( + x_mtx[0,0], 0.0, 0.0, y_mtx[1,1], x_mtx[0,2], y_mtx[1,2]) + +# This is a placeholder since eventually we may need to handle the +# more general case of two transforms that aren't affines +BlendedTransform = BlendedAffine2D + +def blend_xy_sep_transform(x_transform, y_transform): + return BlendedAffine2D(x_transform, y_transform) + +def get_bbox_transform(boxin, boxout): + x_scale = boxout.width() / boxin.width() + y_scale = boxout.height() / boxin.height() + + # MGDTODO: Optimize + return Affine2D() \ + .translated(-boxin.xmin(), -boxin.ymin()) \ + .scaled(x_scale, y_scale) \ + .translated(boxout.xmin(), boxout.ymin()) + +if __name__ == '__main__': + print Affine2D.from_values(1., 0, 0, 1, 0, 0) + + print "translated", Affine2D.identity().translated(5, 4) + print "rotated", Affine2D.identity().rotated_deg(30) + print "scaled", Affine2D.identity().scaled(5, 4) + + transform = Affine2D.identity().rotated_deg(30).translated(5, 4) + + points = N.array([[1, 2], [3, 4], [5, 6]]) + + print inv(transform.mtx) + + print transform(points) + + transform = Affine2D.identity().scaled(5., 1.).translated(10, 0) + print transform + print transform.inverted() + + from bbox import Bbox + boxin = Bbox([[10, 10], [320, 240]]) + boxout = Bbox([[25, 25], [640, 400]]) + trans = bbox_transform(boxin, boxout) + print trans + print trans(N.array([[10, 10], [320, 240]])) + +__all__ = ['Transform', 'Affine2D'] Added: branches/transforms/lib/matplotlib/bbox.py =================================================================== --- branches/transforms/lib/matplotlib/bbox.py (rev 0) +++ branches/transforms/lib/matplotlib/bbox.py 2007-09-10 17:40:47 UTC (rev 3823) @@ -0,0 +1,108 @@ +""" +A convenience class for handling bounding boxes + +2007 Michael Droettboom +""" + +import numpy as N + +class Bbox: + def __init__(self, points): + self._points = N.array(points) + + #@staticmethod + def unit(): + return Bbox([[0,0], [1,1]]) + unit = staticmethod(unit) + + #@staticmethod + def from_lbwh(left, bottom, width, height): + return Bbox([[left, bottom], [left + width, bottom + height]]) + from_lbwh = staticmethod(from_lbwh) + + #@staticmethod + def from_lbrt(left, bottom, right, top): + return Bbox([[left, bottom], [right, top]]) + from_lbwh = staticmethod(from_lbwh) + + # MGDTODO: Probably a more efficient ways to do this... + def xmin(self): + return self._points[0,0] + + def ymin(self): + return self._points[0,1] + + def xmax(self): + return self._points[1,0] + + def ymax(self): + return self._points[1,1] + + def width(self): + return self.xmax() - self.xmin() + + def height(self): + return self.ymax() - self.ymin() + + def transform(self, transform): + return Bbox(transform(points)) + + def inverse_transform(self, transform): + return Bbox(transform.inverted()(points)) + + def get_bounds(self): + return (self.xmin(), self.ymin(), + self.xmax() - self.xmin(), self.ymax() - self.ymin()) + +def lbwh_to_bbox(left, bottom, width, height): + return Bbox([[left, bottom], [left + width, bottom + height]]) + +def bbox_union(bboxes): + """ + Return the Bbox that bounds all bboxes + """ + assert(len(bboxes)) + + if len(bboxes) == 1: + return bboxes[0] + + bbox = bboxes[0] + xmin = bbox.xmin + ymin = bbox.ymin + xmax = bbox.xmax + ymax = bbox.ymax + + for bbox in bboxes[1:]: + xmin = min(xmin, bbox.xmin) + ymin = min(ymin, bbox.ymin) + xmax = max(xmax, bbox.xmax) + ymax = max(ymax, bbox.ymax) + + return Bbox(xmin, ymin, xmax, ymax) + +# MGDTODO: There's probably a better place for this +def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): + ''' + Ensure the endpoints of a range are not too close together. + + "too close" means the interval is smaller than 'tiny' times + the maximum absolute value. + + If they are too close, each will be moved by the 'expander'. + If 'increasing' is True and vmin > vmax, they will be swapped, + regardless of whether they are too close. + ''' + swapped = False + if vmax < vmin: + vmin, vmax = vmax, vmin + swapped = True + if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny: + if vmin==0.0: + vmin = -expander + vmax = expander + else: + vmin -= expander*abs(vmin) + vmax += expander*abs(vmax) + if swapped and not increasing: + vmin, vmax = vmax, vmin + return vmin, vmax This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-10 17:39:47
|
Revision: 3822 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3822&view=rev Author: mdboom Date: 2007-09-10 10:39:37 -0700 (Mon, 10 Sep 2007) Log Message: ----------- Baby steps and horrible breakage on transforms branch. Modified Paths: -------------- branches/transforms/lib/matplotlib/artist.py branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/figure.py branches/transforms/lib/matplotlib/legend.py branches/transforms/lib/matplotlib/lines.py branches/transforms/lib/matplotlib/pylab.py branches/transforms/lib/matplotlib/table.py branches/transforms/lib/matplotlib/text.py branches/transforms/lib/matplotlib/transforms.py branches/transforms/lib/matplotlib/widgets.py Modified: branches/transforms/lib/matplotlib/artist.py =================================================================== --- branches/transforms/lib/matplotlib/artist.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/artist.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -1,7 +1,7 @@ from __future__ import division import sys, re from cbook import iterable, flatten -from transforms import identity_transform +from affine import Affine2D import matplotlib.units as units ## Note, matplotlib artists use the doc strings for set and get @@ -145,7 +145,7 @@ def get_transform(self): 'return the Transformation instance used by this artist' if self._transform is None: - self._transform = identity_transform() + self._transform = Affine2D() return self._transform def hitlist(self,event): Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/axes.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -9,6 +9,8 @@ rcParams = matplotlib.rcParams from matplotlib import artist as martist +from matplotlib import affine as maffine +from matplotlib import bbox as mbbox from matplotlib import agg from matplotlib import axis as maxis from matplotlib import cbook @@ -23,11 +25,11 @@ from matplotlib import mlab from matplotlib import cm from matplotlib import patches as mpatches +from matplotlib import pbox as mpbox from matplotlib import quiver as mquiver from matplotlib import table as mtable from matplotlib import text as mtext from matplotlib import ticker as mticker -from matplotlib import transforms as mtrans iterable = cbook.iterable is_string_like = cbook.is_string_like @@ -413,14 +415,7 @@ yield seg remaining=remaining[2:] -ValueType=type(mtrans.zero()) -def makeValue(v): - if type(v) == ValueType: - return v - else: - return mtrans.Value(v) - class Axes(martist.Artist): """ The Axes contains most of the figure elements: Axis, Tick, Line2D, @@ -434,10 +429,15 @@ """ - scaled = {mtrans.IDENTITY : 'linear', - mtrans.LOG10 : 'log', + # MGDTODO +# scaled = {mtrans.IDENTITY : 'linear', +# mtrans.LOG10 : 'log', +# } + scaled = {0 : 'linear', + 1 : 'log', } + def __str__(self): return "Axes(%g,%g;%gx%g)"%(self._position[0].get(),self._position[1].get(), self._position[2].get(),self._position[3].get()) @@ -485,7 +485,7 @@ """ martist.Artist.__init__(self) - self._position = map(makeValue, rect) + self._position = rect self._originalPosition = rect self.set_axes(self) self.set_aspect('auto') @@ -629,12 +629,9 @@ self.right = (l+w)*figw self.top = (b+h)*figh - - Bbox = mtrans.Bbox - Point = mtrans.Point - self.bbox = Bbox( - Point(self.left, self.bottom), - Point(self.right, self.top ), + self.bbox = mbbox.Bbox.from_lbrt( + self.left, self.bottom, + self.right, self.top, ) #these will be updated later as data is added self._set_lim_and_transforms() @@ -644,40 +641,36 @@ set the dataLim and viewLim BBox attributes and the transData and transAxes Transformation attributes """ - - - one = mtrans.one - zero = mtrans.zero - Point = mtrans.Point - Bbox = mtrans.Bbox + Bbox = mbbox.Bbox if self._sharex is not None: - left=self._sharex.viewLim.ll().x() - right=self._sharex.viewLim.ur().x() + left = self._sharex.viewLim.xmin() + right = self._sharex.viewLim.xmax() else: - left=zero() - right=one() + left = 0.0 + right = 1.0 if self._sharey is not None: - bottom=self._sharey.viewLim.ll().y() - top=self._sharey.viewLim.ur().y() + bottom = self._sharey.viewLim.ymin() + top = self._sharey.viewLim.ymax() else: - bottom=zero() - top=one() + bottom = 0.0 + top = 1.0 - self.viewLim = Bbox(Point(left, bottom), Point(right, top)) - self.dataLim = mtrans.unit_bbox() + self.viewLim = Bbox.from_lbrt(left, bottom, right, top) + self.dataLim = Bbox.unit() - self.transData = mtrans.get_bbox_transform( + self.transData = maffine.get_bbox_transform( self.viewLim, self.bbox) - self.transAxes = mtrans.get_bbox_transform( - mtrans.unit_bbox(), self.bbox) + self.transAxes = maffine.get_bbox_transform( + Bbox.unit(), self.bbox) - if self._sharex: - self.transData.set_funcx(self._sharex.transData.get_funcx()) + # MGDTODO +# if self._sharex: +# self.transData.set_funcx(self._sharex.transData.get_funcx()) - if self._sharey: - self.transData.set_funcy(self._sharey.transData.get_funcy()) +# if self._sharey: +# self.transData.set_funcy(self._sharey.transData.get_funcy()) def get_position(self, original=False): 'Return the axes rectangle left, bottom, width, height' @@ -861,7 +854,7 @@ """ ACCEPTS: ['C', 'SW', 'S', 'SE', 'E', 'NE', 'N', 'NW', 'W'] """ - if anchor in mtrans.PBox.coefs.keys() or len(anchor) == 2: + if anchor in mpbox.PBox.coefs.keys() or len(anchor) == 2: self._anchor = anchor else: raise ValueError('argument must be among %s' % @@ -901,7 +894,7 @@ if data_ratio is None: data_ratio = ysize/xsize box_aspect = A * data_ratio - pb = mtrans.PBox(self._originalPosition) + pb = mpbox.PBox(self._originalPosition) pb1 = pb.shrink_to_aspect(box_aspect, fig_aspect) self.set_position(pb1.anchor(self._anchor), 'active') return @@ -1538,11 +1531,12 @@ if xmin is None: xmin = old_xmin if xmax is None: xmax = old_xmax - if (self.transData.get_funcx().get_type()==mtrans.LOG10 - and min(xmin, xmax)<=0): - raise ValueError('Cannot set nonpositive limits with log transform') + # MGDTODO +# if (self.transData.get_funcx().get_type()==mtrans.LOG10 +# and min(xmin, xmax)<=0): +# raise ValueError('Cannot set nonpositive limits with log transform') - xmin, xmax = mtrans.nonsingular(xmin, xmax, increasing=False) + xmin, xmax = mbbox.nonsingular(xmin, xmax, increasing=False) self.viewLim.intervalx().set_bounds(xmin, xmax) if emit: self.callbacks.process('xlim_changed', self) @@ -1574,19 +1568,22 @@ #if subsx is None: subsx = range(2, basex) assert(value.lower() in ('log', 'linear', )) if value == 'log': - self.xaxis.set_major_locator(mticker.LogLocator(basex)) - self.xaxis.set_major_formatter(mticker.LogFormatterMathtext(basex)) - self.xaxis.set_minor_locator(mticker.LogLocator(basex,subsx)) - self.transData.get_funcx().set_type(mtrans.LOG10) - minx, maxx = self.get_xlim() - if min(minx, maxx)<=0: - self.autoscale_view() + # MGDTODO +# self.xaxis.set_major_locator(mticker.LogLocator(basex)) +# self.xaxis.set_major_formatter(mticker.LogFormatterMathtext(basex)) +# self.xaxis.set_minor_locator(mticker.LogLocator(basex,subsx)) +# self.transData.get_funcx().set_type(mtrans.LOG10) +# minx, maxx = self.get_xlim() +# if min(minx, maxx)<=0: +# self.autoscale_view() + pass elif value == 'linear': self.xaxis.set_major_locator(mticker.AutoLocator()) self.xaxis.set_major_formatter(mticker.ScalarFormatter()) self.xaxis.set_minor_locator(mticker.NullLocator()) self.xaxis.set_minor_formatter(mticker.NullFormatter()) - self.transData.get_funcx().set_type( mtrans.IDENTITY ) + # self.transData.get_funcx().set_type( mtrans.IDENTITY ) + self.transData.get_funcx().set_type( 0 ) # MGDTODO def get_xticks(self): 'Return the x ticks as a list of locations' @@ -1659,11 +1656,12 @@ if ymin is None: ymin = old_ymin if ymax is None: ymax = old_ymax - if (self.transData.get_funcy().get_type()==mtrans.LOG10 - and min(ymin, ymax)<=0): - raise ValueError('Cannot set nonpositive limits with log transform') + # MGDTODO +# if (self.transData.get_funcy().get_type()==mtrans.LOG10 +# and min(ymin, ymax)<=0): +# raise ValueError('Cannot set nonpositive limits with log transform') - ymin, ymax = mtrans.nonsingular(ymin, ymax, increasing=False) + ymin, ymax = mbbox.nonsingular(ymin, ymax, increasing=False) self.viewLim.intervaly().set_bounds(ymin, ymax) if emit: self.callbacks.process('ylim_changed', self) @@ -1696,21 +1694,24 @@ assert(value.lower() in ('log', 'linear', )) if value == 'log': - self.yaxis.set_major_locator(mticker.LogLocator(basey)) - self.yaxis.set_major_formatter(mticker.LogFormatterMathtext(basey)) - self.yaxis.set_minor_locator(mticker.LogLocator(basey,subsy)) - self.transData.get_funcy().set_type(mtrans.LOG10) - miny, maxy = self.get_ylim() - if min(miny, maxy)<=0: - self.autoscale_view() - + # MGDTODO +# self.yaxis.set_major_locator(mticker.LogLocator(basey)) +# self.yaxis.set_major_formatter(mticker.LogFormatterMathtext(basey)) +# self.yaxis.set_minor_locator(mticker.LogLocator(basey,subsy)) +# self.transData.get_funcy().set_type(mtrans.LOG10) +# miny, maxy = self.get_ylim() +# if min(miny, maxy)<=0: +# self.autoscale_view() + pass + elif value == 'linear': self.yaxis.set_major_locator(mticker.AutoLocator()) self.yaxis.set_major_formatter(mticker.ScalarFormatter()) self.yaxis.set_minor_locator(mticker.NullLocator()) self.yaxis.set_minor_formatter(mticker.NullFormatter()) - self.transData.get_funcy().set_type( mtrans.IDENTITY ) - + # self.transData.get_funcy().set_type( mtrans.IDENTITY ) MGDTODO + self.transData.get_funcy().set_type( 0 ) + def get_yticks(self): 'Return the y ticks as a list of locations' return self.yaxis.get_ticklocs() @@ -1744,9 +1745,11 @@ def toggle_log_lineary(self): 'toggle between log and linear on the y axis' - funcy = self.transData.get_funcy().get_type() - if funcy==mtrans.LOG10: self.set_yscale('linear') - elif funcy==mtrans.IDENTITY: self.set_yscale('log') + # MGDTODO +# funcy = self.transData.get_funcy().get_type() +# if funcy==mtrans.LOG10: self.set_yscale('linear') +# elif funcy==mtrans.IDENTITY: self.set_yscale('log') + pass def xaxis_date(self, tz=None): """Sets up x-axis ticks and labels that treat the x data as dates. @@ -2172,7 +2175,7 @@ %(Annotation)s """ a = mtext.Annotation(*args, **kwargs) - a.set_transform(mtrans.identity_transform()) + a.set_transform(maffine.Affine2D.identity()) self._set_artist_props(a) if kwargs.has_key('clip_on'): a.set_clip_box(self.bbox) self.texts.append(a) @@ -2211,7 +2214,7 @@ %(Line2D)s """ - trans = mtrans.blend_xy_sep_transform( self.transAxes, self.transData) + trans = maffine.blend_xy_sep_transform( self.transAxes, self.transData) l, = self.plot([xmin,xmax], [y,y], transform=trans, scalex=False, **kwargs) return l @@ -2247,7 +2250,7 @@ %(Line2D)s """ - trans = mtrans.blend_xy_sep_transform( self.transData, self.transAxes ) + trans = maffine.blend_xy_sep_transform( self.transData, self.transAxes ) l, = self.plot([x,x], [ymin,ymax] , transform=trans, scaley=False, **kwargs) return l @@ -2286,7 +2289,7 @@ %(Polygon)s """ # convert y axis units - trans = mtrans.blend_xy_sep_transform( self.transAxes, self.transData) + trans = maffine.blend_xy_sep_transform( self.transAxes, self.transData) verts = (xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin) p = mpatches.Polygon(verts, **kwargs) p.set_transform(trans) @@ -2326,7 +2329,7 @@ %(Polygon)s """ # convert x axis units - trans = mtrans.blend_xy_sep_transform(self.transData, self.transAxes) + trans = maffine.blend_xy_sep_transform(self.transData, self.transAxes) verts = [(xmin, ymin), (xmin, ymax), (xmax, ymax), (xmax, ymin)] p = mpatches.Polygon(verts, **kwargs) p.set_transform(trans) @@ -4105,7 +4108,7 @@ offsets = zip(x,y), transOffset = self.transData, ) - collection.set_transform(mtrans.identity_transform()) + collection.set_transform(maffine.Affine2D()) collection.set_alpha(alpha) collection.update(kwargs) @@ -5299,21 +5302,22 @@ # the lim are theta, r - Bbox = mtrans.Bbox - Value = mtrans.Value - Point = mtrans.Point - self.dataLim = Bbox( Point( Value(5/4.*math.pi), Value(math.sqrt(2))), - Point( Value(1/4.*math.pi), Value(math.sqrt(2)))) - self.viewLim = Bbox( Point( Value(5/4.*math.pi), Value(math.sqrt(2))), - Point( Value(1/4.*math.pi), Value(math.sqrt(2)))) + # MGDTODO +# Bbox = mtrans.Bbox +# Value = mtrans.Value +# Point = mtrans.Point +# self.dataLim = Bbox( Point( Value(5/4.*math.pi), Value(math.sqrt(2))), +# Point( Value(1/4.*math.pi), Value(math.sqrt(2)))) +# self.viewLim = Bbox( Point( Value(5/4.*math.pi), Value(math.sqrt(2))), +# Point( Value(1/4.*math.pi), Value(math.sqrt(2)))) - self.transData = mtrans.NonseparableTransformation( - self.viewLim, self.bbox, - mtrans.FuncXY(mtrans.POLAR)) - self.transAxes = mtrans.get_bbox_transform( - mtrans.unit_bbox(), self.bbox) +# self.transData = mtrans.NonseparableTransformation( +# self.viewLim, self.bbox, +# mtrans.FuncXY(mtrans.POLAR)) +# self.transAxes = mtrans.get_bbox_transform( +# mtrans.unit_bbox(), self.bbox) + pass - def contains(self,mouseevent): """Test whether the mouse event occured in the axes. @@ -5380,6 +5384,7 @@ # we need to set a view and data interval from 0->rmax to make # the formatter and locator work correctly + # MGDTODO Value = mtrans.Value Interval = mtrans.Interval self.rintv = Interval(Value(0), Value(1)) Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/axis.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -15,8 +15,8 @@ from ticker import NullFormatter, FixedFormatter, ScalarFormatter, LogFormatter from ticker import NullLocator, FixedLocator, LinearLocator, LogLocator, AutoLocator -from transforms import Value, blend_xy_sep_transform,\ - translation_transform, bbox_all, identity_transform +from affine import Affine2D, blend_xy_sep_transform +from bbox import bbox_union from font_manager import FontProperties from text import Text, TextWithDash, _process_text_args from patches import bbox_artist @@ -81,16 +81,16 @@ if self._tickdir == 'in': self._xtickmarkers = (TICKUP, TICKDOWN) self._ytickmarkers = (TICKRIGHT, TICKLEFT) - self._pad = Value(pad) + self._pad = pad else: self._xtickmarkers = (TICKDOWN, TICKUP) self._ytickmarkers = (TICKLEFT, TICKRIGHT) - self._pad = Value(pad + size) + self._pad = pad + size self._loc = loc self._size = size - self._padPixels = self.figure.dpi*self._pad*Value(1/72.0) + self._padPixels = self.figure.dpi * self._pad * (1/72.0) self.tick1line = self._get_tick1line(loc) @@ -236,14 +236,11 @@ xaxis=True, ) - - trans = blend_xy_sep_transform( self.axes.transData, - self.axes.transAxes) + trans = blend_xy_sep_transform( + self.axes.transData, self.axes.transAxes) #offset the text downward with a post transformation - transOffset = translation_transform( - Value(0), Value(-1)*self._padPixels) - trans.set_offset( (0,0), transOffset) - t.set_transform( trans) + trans = trans + Affine2D().translated(0, -1 * self._padPixels) + t.set_transform(trans) self._set_artist_props(t) return t @@ -264,12 +261,10 @@ horizontalalignment='center', ) - trans = blend_xy_sep_transform( self.axes.transData, - self.axes.transAxes) + trans = blend_xy_sep_transformation( + self.axes.transData, self.axes.transAxes) # offset the text upward with a post transformation - transOffset = translation_transform( - Value(0), self._padPixels) - trans.set_offset( (0,0), transOffset) + trans = trans + Affine2D().translated(0, self._padPixels) t.set_transform( trans ) self._set_artist_props(t) return t @@ -284,8 +279,8 @@ marker = self._xtickmarkers[0], markersize=self._size, ) - l.set_transform( blend_xy_sep_transform( self.axes.transData, - self.axes.transAxes) ) + l.set_transform(blend_xy_sep_transform( + self.axes.transData, self.axes.transAxes) ) self._set_artist_props(l) return l @@ -300,8 +295,8 @@ markersize=self._size, ) - l.set_transform( blend_xy_sep_transform( self.axes.transData, - self.axes.transAxes) ) + l.set_transform(blend_xy_sep_transform( + self.axes.transData, self.axes.transAxes) ) self._set_artist_props(l) return l @@ -314,8 +309,9 @@ linewidth=rcParams['grid.linewidth'], antialiased=False, ) - l.set_transform( blend_xy_sep_transform( self.axes.transData, - self.axes.transAxes) ) + l.set_transform( + blend_xy_sep_transform( + self.axes.transData, self.axes.transAxes)) l.set_clip_box(self.axes.bbox) self._set_artist_props(l) @@ -363,13 +359,11 @@ dashdirection=0, xaxis=False, ) - trans = blend_xy_sep_transform( self.axes.transAxes, - self.axes.transData) + trans = blend_xy_sep_transform( + self.axes.transAxes, self.axes.transData) # offset the text leftward with a post transformation + trans = trans + Affine2D().translated(-1 * self._padPixels, 0) - transOffset = translation_transform( - Value(-1)*self._padPixels, Value(0)) - trans.set_offset( (0,0), transOffset) t.set_transform( trans ) #t.set_transform( self.axes.transData ) self._set_artist_props(t) @@ -388,13 +382,10 @@ xaxis=False, horizontalalignment='left', ) - trans = blend_xy_sep_transform( self.axes.transAxes, - self.axes.transData) + trans = blend_xy_sep_transform( + self.axes.transAxes, self.axes.transData) # offset the text rightward with a post transformation - - transOffset = translation_transform( - self._padPixels, Value(0)) - trans.set_offset( (0,0), transOffset) + trans = trans + Affine2D().translated(self._padPixels, 0) t.set_transform( trans ) self._set_artist_props(t) return t @@ -409,8 +400,9 @@ linestyle = 'None', markersize=self._size, ) - l.set_transform( blend_xy_sep_transform( self.axes.transAxes, - self.axes.transData) ) + l.set_transform( + blend_xy_sep_transform( + self.axes.transAxes, self.axes.transData)) self._set_artist_props(l) return l @@ -424,8 +416,9 @@ markersize=self._size, ) - l.set_transform( blend_xy_sep_transform( self.axes.transAxes, - self.axes.transData) ) + l.set_transform( + blend_xy_sep_transform( + self.axes.transAxes, self.axes.transData)) self._set_artist_props(l) return l @@ -439,8 +432,8 @@ antialiased=False, ) - l.set_transform( blend_xy_sep_transform( self.axes.transAxes, - self.axes.transData) ) + l.set_transform( blend_xy_sep_transform( + self.axes.transAxes, self.axes.transData) ) l.set_clip_box(self.axes.bbox) self._set_artist_props(l) @@ -989,8 +982,8 @@ verticalalignment='top', horizontalalignment='center', ) - label.set_transform( blend_xy_sep_transform( self.axes.transAxes, - identity_transform() )) + label.set_transform( blend_xy_sep_transform( + self.axes.transAxes, Affine2D() )) self._set_artist_props(label) self.label_position='bottom' @@ -1004,8 +997,8 @@ verticalalignment='top', horizontalalignment='right', ) - offsetText.set_transform( blend_xy_sep_transform( self.axes.transAxes, - identity_transform() )) + offsetText.set_transform( blend_xy_sep_transform( + self.axes.transAxes, Affine2D() )) self._set_artist_props(offsetText) self.offset_text_position='bottom' return offsetText @@ -1041,7 +1034,7 @@ bottom = self.axes.bbox.ymin() else: - bbox = bbox_all(bboxes) + bbox = bbox_union(bboxes) bottom = bbox.ymin() self.label.set_position( (x, bottom-self.LABELPAD*self.figure.dpi.get()/72.0)) @@ -1051,7 +1044,7 @@ top = self.axes.bbox.ymax() else: - bbox = bbox_all(bboxes2) + bbox = bbox_union(bboxes2) top = bbox.ymax() self.label.set_position( (x, top+self.LABELPAD*self.figure.dpi.get()/72.0)) @@ -1065,7 +1058,7 @@ if not len(bboxes): bottom = self.axes.bbox.ymin() else: - bbox = bbox_all(bboxes) + bbox = bbox_union(bboxes) bottom = bbox.ymin() self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi.get()/72.0)) @@ -1179,8 +1172,8 @@ horizontalalignment='right', rotation='vertical', ) - label.set_transform( blend_xy_sep_transform( identity_transform(), - self.axes.transAxes) ) + label.set_transform( blend_xy_sep_transform( + Affine2D(), self.axes.transAxes) ) self._set_artist_props(label) self.label_position='left' @@ -1194,8 +1187,8 @@ verticalalignment = 'bottom', horizontalalignment = 'left', ) - offsetText.set_transform(blend_xy_sep_transform(self.axes.transAxes, - identity_transform()) ) + offsetText.set_transform(blend_xy_sep_transform( + self.axes.transAxes, Affine2D()) ) self._set_artist_props(offsetText) self.offset_text_position='left' return offsetText @@ -1231,7 +1224,7 @@ left = self.axes.bbox.xmin() else: - bbox = bbox_all(bboxes) + bbox = bbox_union(bboxes) left = bbox.xmin() self.label.set_position( (left-self.LABELPAD*self.figure.dpi.get()/72.0, y)) @@ -1241,7 +1234,7 @@ right = self.axes.bbox.xmax() else: - bbox = bbox_all(bboxes2) + bbox = bbox_union(bboxes2) right = bbox.xmax() self.label.set_position( (right+self.LABELPAD*self.figure.dpi.get()/72.0, y)) Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -84,7 +84,7 @@ from matplotlib.font_manager import findfont from matplotlib.ft2font import FT2Font, LOAD_DEFAULT from matplotlib.mathtext import MathTextParser -from matplotlib.transforms import lbwh_to_bbox +from matplotlib.bbox import Bbox from _backend_agg import RendererAgg as _RendererAgg @@ -126,7 +126,7 @@ self.mathtext_parser = MathTextParser('Agg') self._fontd = {} - self.bbox = lbwh_to_bbox(0,0, self.width, self.height) + self.bbox = Bbox.from_lbwh(0,0, self.width, self.height) if __debug__: verbose.report('RendererAgg.__init__ done', 'debug-annoying') @@ -277,7 +277,7 @@ cliprect = gc.get_clip_rectangle() if cliprect is None: bbox = None - else: bbox = lbwh_to_bbox(*cliprect) + else: bbox = Bbox.from_lbwh(*cliprect) self.draw_image(x, self.height-y, im, bbox) def get_canvas_width_height(self): Modified: branches/transforms/lib/matplotlib/figure.py =================================================================== --- branches/transforms/lib/matplotlib/figure.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/figure.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -18,7 +18,8 @@ from text import Text, _process_text_args from legend import Legend -from transforms import Bbox, Value, Point, get_bbox_transform, unit_bbox +from affine import get_bbox_transform +from bbox import Bbox from ticker import FormatStrFormatter from cm import ScalarMappable from contour import ContourSet @@ -127,17 +128,14 @@ if facecolor is None: facecolor = rcParams['figure.facecolor'] if edgecolor is None: edgecolor = rcParams['figure.edgecolor'] - self.dpi = Value(dpi) - self.figwidth = Value(figsize[0]) - self.figheight = Value(figsize[1]) - self.ll = Point( Value(0), Value(0) ) - self.ur = Point( self.figwidth*self.dpi, - self.figheight*self.dpi ) - self.bbox = Bbox(self.ll, self.ur) - + self.dpi = dpi + self.bbox = Bbox.from_lbwh(0, 0, + self.figsize[0] * dpi, + self.figsize[1] * dpi) + self.frameon = frameon - self.transFigure = get_bbox_transform( unit_bbox(), self.bbox) + self.transFigure = get_bbox_transform( Bbox.unit(), self.bbox) Modified: branches/transforms/lib/matplotlib/legend.py =================================================================== --- branches/transforms/lib/matplotlib/legend.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/legend.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -34,12 +34,9 @@ from patches import Patch, Rectangle, RegularPolygon, Shadow, bbox_artist, draw_bbox from collections import LineCollection, RegularPolyCollection, PatchCollection from text import Text -from transforms import Bbox, Point, Value, get_bbox_transform, bbox_all,\ - unit_bbox, inverse_transform_bbox, lbwh_to_bbox +from affine import get_bbox_transform +from bbox import Bbox, bbox_union - - - def line_cuts_bbox(line, bbox): """ Return True if and only if line cuts bbox. """ minx, miny, width, height = bbox.get_bounds() @@ -168,7 +165,7 @@ else: raise TypeError("Legend needs either Axes or Figure as parent") self.parent = parent - self.set_transform( get_bbox_transform( unit_bbox(), parent.bbox) ) + self.set_transform( get_bbox_transform( Bbox.unit(), parent.bbox) ) if loc is None: loc = rcParams["legend.loc"] @@ -263,10 +260,10 @@ bboxesAll = bboxesText bboxesAll.extend(bboxesHandles) - bbox = bbox_all(bboxesAll) + bbox = bbox_union(bboxesAll) self.save = bbox - ibox = inverse_transform_bbox(self.get_transform(), bbox) + ibox = bbox.inverse_transform(self.get_transform()) self.ibox = ibox return ibox @@ -468,7 +465,7 @@ candidates = [] for l, b in consider: - legendBox = lbwh_to_bbox(l, b, width, height) + legendBox = Bbox.from_lbwh(l, b, width, height) badness = 0 badness = legendBox.count_contains(verts) ox, oy = l-tx, b-ty Modified: branches/transforms/lib/matplotlib/lines.py =================================================================== --- branches/transforms/lib/matplotlib/lines.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/lines.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -18,7 +18,7 @@ from cbook import iterable, is_string_like, is_numlike from colors import colorConverter -from transforms import lbwh_to_bbox, LOG10 +from bbox import lbwh_to_bbox from matplotlib import rcParams # special-purpose marker identifiers: @@ -378,7 +378,7 @@ bottom -= ms/2 width += ms height += ms - return lbwh_to_bbox( left, bottom, width, height) + return lbwh_to_bbox(left, bottom, width, height) def set_axes(self, ax): @@ -447,13 +447,15 @@ x, y = self._x, self._y - try: logx = self.get_transform().get_funcx().get_type()==LOG10 - except RuntimeError: logx = False # non-separable + # MGDTODO: Deal with the log scale here + +# try: logx = self.get_transform().get_funcx().get_type()==LOG10 +# except RuntimeError: logx = False # non-separable - try: logy = self.get_transform().get_funcy().get_type()==LOG10 - except RuntimeError: logy = False # non-separable +# try: logy = self.get_transform().get_funcy().get_type()==LOG10 +# except RuntimeError: logy = False # non-separable - if not logx and not logy: + if True: return x, y if self._logcache is not None: Modified: branches/transforms/lib/matplotlib/pylab.py =================================================================== --- branches/transforms/lib/matplotlib/pylab.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/pylab.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -234,7 +234,6 @@ from lines import Line2D from text import Text, Annotation from patches import Polygon, Rectangle, Circle, Arrow -from transforms import blend_xy_sep_transform from widgets import SubplotTool, Button, Slider, Widget import numerix as nx Modified: branches/transforms/lib/matplotlib/table.py =================================================================== --- branches/transforms/lib/matplotlib/table.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/table.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -29,12 +29,10 @@ from patches import Rectangle from cbook import enumerate, is_string_like, flatten from text import Text -from transforms import Bbox, inverse_transform_bbox, bbox_all, unit_bbox, \ - get_bbox_transform +from bbox import Bbox, bbox_union - class Cell(Rectangle): """ A cell is a Rectangle with some associated text. @@ -132,7 +130,7 @@ def get_text_bounds(self, renderer): """ Get text bounds in axes co-ordinates. """ bbox = self._text.get_window_extent(renderer) - bboxa = inverse_transform_bbox(self.get_transform(), bbox) + bbox.inverse_transform(self.get_transform()) return bboxa.get_bounds() def get_required_width(self, renderer): Modified: branches/transforms/lib/matplotlib/text.py =================================================================== --- branches/transforms/lib/matplotlib/text.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/text.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -15,7 +15,7 @@ from cbook import enumerate, is_string_like, maxdict, is_numlike from font_manager import FontProperties from patches import bbox_artist, YAArrow -from transforms import lbwh_to_bbox, bbox_all, identity_transform +from bbox import lbwh_to_bbox, bbox_union from lines import Line2D import matplotlib.nxutils as nxutils Modified: branches/transforms/lib/matplotlib/transforms.py =================================================================== --- branches/transforms/lib/matplotlib/transforms.py 2007-09-10 06:55:10 UTC (rev 3821) +++ branches/transforms/lib/matplotlib/transforms.py 2007-09-10 17:39:37 UTC (rev 3822) @@ -1,652 +1,652 @@ -""" -The transforms module is broken into two parts, a collection of -classes written in the extension module _transforms to handle -efficient transformation of data, and some helper functions in -transforms to make it easy to instantiate and use those objects. -Hence the core of this module lives in _transforms. +# """ +# The transforms module is broken into two parts, a collection of +# classes written in the extension module _transforms to handle +# efficient transformation of data, and some helper functions in +# transforms to make it easy to instantiate and use those objects. +# Hence the core of this module lives in _transforms. -The transforms class is built around the idea of a LazyValue. A -LazyValue is a base class that defines a method get that returns the -value. The concrete derived class Value wraps a float, and simply -returns the value of that float. The concrete derived class BinOp -allows binary operations on LazyValues, so you can add them, multiply -them, etc. When you do something like +# The transforms class is built around the idea of a LazyValue. A +# LazyValue is a base class that defines a method get that returns the +# value. The concrete derived class Value wraps a float, and simply +# returns the value of that float. The concrete derived class BinOp +# allows binary operations on LazyValues, so you can add them, multiply +# them, etc. When you do something like - inches = Value(8) - dpi = Value(72) - width = inches * dpi +# inches = Value(8) +# dpi = Value(72) +# width = inches * dpi -width is a BinOp instance (that tells you the width of the figure in -pixels). Later, if the figure size in changed, ie we call +# width is a BinOp instance (that tells you the width of the figure in +# pixels). Later, if the figure size in changed, ie we call - inches.set(10) +# inches.set(10) -The width variable is automatically updated because it stores a -pointer to the inches variable, not the value. Since a BinOp is also -a lazy value, you can define binary operations on BinOps as well, such -as +# The width variable is automatically updated because it stores a +# pointer to the inches variable, not the value. Since a BinOp is also +# a lazy value, you can define binary operations on BinOps as well, such +# as - middle = Value(0.5) * width +# middle = Value(0.5) * width -Pairs of LazyValue instances can occur as instances of two classes: +# Pairs of LazyValue instances can occur as instances of two classes: - pt = Point( Value(x), Value(y)) # where x, y are numbers - pt.x(), pt.y() return Value(x), Value(y)) +# pt = Point( Value(x), Value(y)) # where x, y are numbers +# pt.x(), pt.y() return Value(x), Value(y)) - iv = Interval( Value(x), Value(y)) - iv.contains(z) returns True if z is in the closed interval - iv.contains_open(z): same for open interval - iv.span() returns y-x as a float - iv.get_bounds() returns (x,y) as a tuple of floats - iv.set_bounds(x, y) allows input of new floats - iv.update(seq) updates the bounds to include all elements - in a sequence of floats - iv.shift(s) shifts the interval by s, a float +# iv = Interval( Value(x), Value(y)) +# iv.contains(z) returns True if z is in the closed interval +# iv.contains_open(z): same for open interval +# iv.span() returns y-x as a float +# iv.get_bounds() returns (x,y) as a tuple of floats +# iv.set_bounds(x, y) allows input of new floats +# iv.update(seq) updates the bounds to include all elements +# in a sequence of floats +# iv.shift(s) shifts the interval by s, a float -The bounding box class Bbox is also heavily used, and is defined by a -lower left point ll and an upper right point ur. The points ll and ur -are given by Point(x, y) instances, where x and y are LazyValues. So -you can represent a point such as +# The bounding box class Bbox is also heavily used, and is defined by a +# lower left point ll and an upper right point ur. The points ll and ur +# are given by Point(x, y) instances, where x and y are LazyValues. So +# you can represent a point such as - ll = Point( Value(0), Value(0) ) # the origin - ur = Point( width, height ) # the upper right of the figure +# ll = Point( Value(0), Value(0) ) # the origin +# ur = Point( width, height ) # the upper right of the figure -where width and height are defined as above, using the product of the -figure width in inches and the dpi. This is, in face, how the Figure -bbox is defined +# where width and height are defined as above, using the product of the +# figure width in inches and the dpi. This is, in face, how the Figure +# bbox is defined - bbox = Bbox(ll, ur) +# bbox = Bbox(ll, ur) -A bbox basically defines an x,y coordinate system, with ll giving the -lower left of the coordinate system and ur giving the upper right. +# A bbox basically defines an x,y coordinate system, with ll giving the +# lower left of the coordinate system and ur giving the upper right. -The bbox methods are +# The bbox methods are - ll() - return the lower left Point - ur() - return the upper right Point - contains(x,y) - return True if self contains point - overlaps(bbox) - return True if self overlaps bbox - overlapsx(bbox) - return True if self overlaps bbox in the x interval - overlapsy(bbox) - return True if self overlaps bbox in the y interval - intervalx() - return the x Interval instance - intervaly() - return the y interval instance - get_bounds() - get the left, bottom, width, height bounding tuple - update(xys, ignore) - update the bbox to bound all the xy tuples in - xys; if ignore is true ignore the current contents of bbox and - just bound the tuples. If ignore is false, bound self + tuples - width() - return the width of the bbox - height() - return the height of the bbox - xmax() - return the x coord of upper right - ymax() - return the y coord of upper right - xmin() - return the x coord of lower left - ymin() - return the y coord of lower left - scale(sx,sy) - scale the bbox by sx, sy - deepcopy() - return a deep copy of self (pointers are lost) +# ll() - return the lower left Point +# ur() - return the upper right Point +# contains(x,y) - return True if self contains point +# overlaps(bbox) - return True if self overlaps bbox +# overlapsx(bbox) - return True if self overlaps bbox in the x interval +# overlapsy(bbox) - return True if self overlaps bbox in the y interval +# intervalx() - return the x Interval instance +# intervaly() - return the y interval instance +# get_bounds() - get the left, bottom, width, height bounding tuple +# update(xys, ignore) - update the bbox to bound all the xy tuples in +# xys; if ignore is true ignore the current contents of bbox and +# just bound the tuples. If ignore is false, bound self + tuples +# width() - return the width of the bbox +# height() - return the height of the bbox +# xmax() - return the x coord of upper right +# ymax() - return the y coord of upper right +# xmin() - return the x coord of lower left +# ymin() - return the y coord of lower left +# scale(sx,sy) - scale the bbox by sx, sy +# deepcopy() - return a deep copy of self (pointers are lost) -The basic transformation maps one bbox to another, with an optional -nonlinear transformation of one of coordinates (eg log scaling). +# The basic transformation maps one bbox to another, with an optional +# nonlinear transformation of one of coordinates (eg log scaling). -The base class for transformations is Transformation, and the concrete -derived classes are SeparableTransformation and Affine. Earlier -versions of matplotlib handled transformation of x and y separately -(ie we assumed all transformations were separable) but this makes it -difficult to do rotations or polar transformations, for example. All -artists contain their own transformation, defaulting to the identity -transform. +# The base class for transformations is Transformation, and the concrete +# derived classes are SeparableTransformation and Affine. Earlier +# versions of matplotlib handled transformation of x and y separately +# (ie we assumed all transformations were separable) but this makes it +# difficult to do rotations or polar transformations, for example. All +# artists contain their own transformation, defaulting to the identity +# transform. -The signature of a separable transformation instance is +# The signature of a separable transformation instance is - trans = SeparableTransformation(bbox1, bbox2, funcx, funcy) +# trans = SeparableTransformation(bbox1, bbox2, funcx, funcy) -where funcx and funcy operate on x and y. The typical linear -coordinate transformation maps one bounding box to another, with funcx -and funcy both identity. Eg, +# where funcx and funcy operate on x and y. The typical linear +# coordinate transformation maps one bounding box to another, with funcx +# and funcy both identity. Eg, - transData = Transformation(viewLim, displayLim, - Func(IDENTITY), Func(IDENTITY)) +# transData = Transformation(viewLim, displayLim, +# Func(IDENTITY), Func(IDENTITY)) -maps the axes view limits to display limits. If the xaxis scaling is -changed to log, one simply calls +# maps the axes view limits to display limits. If the xaxis scaling is +# changed to log, one simply calls - transData.get_funcx().set_type(LOG10) +# transData.get_funcx().set_type(LOG10) -For more general transformations including rotation, the Affine class -is provided, which is constructed with 6 LazyValue instances: -a, b, c, d, tx, ty. These give the values of the matrix transformation +# For more general transformations including rotation, the Affine class +# is provided, which is constructed with 6 LazyValue instances: +# a, b, c, d, tx, ty. These give the values of the matrix transformation - [xo = |a c| [xi + [tx - yo] |b d| yi] ty] +# [xo = |a c| [xi + [tx +# yo] |b d| yi] ty] -where if sx, sy are the scaling components, tx, y are the translation -components, and alpha is the rotation +# where if sx, sy are the scaling components, tx, y are the translation +# components, and alpha is the rotation - a = sx*cos(alpha); - b = -sx*sin(alpha); - c = sy*sin(alpha); - d = sy*cos(alpha); +# a = sx*cos(alpha); +# b = -sx*sin(alpha); +# c = sy*sin(alpha); +# d = sy*cos(alpha); -The affine transformation can be accomplished for row vectors with a -single matrix multiplication - X_new = X_old * M -where - M = [ a b 0 - c d 0 - tx ty 1] -and each X is the row vector [x, y, 1]. Hence M is -the transpose of the matrix representation given in -http://en.wikipedia.org/wiki/Affine_transformation, -which is for the more usual column-vector representation -of the position.) +# The affine transformation can be accomplished for row vectors with a +# single matrix multiplication +# X_new = X_old * M +# where +# M = [ a b 0 +# c d 0 +# tx ty 1] +# and each X is the row vector [x, y, 1]. Hence M is +# the transpose of the matrix representation given in +# http://en.wikipedia.org/wiki/Affine_transformation, +# which is for the more usual column-vector representation +# of the position.) -From a user perspective, the most important Tranformation methods are +# From a user perspective, the most important Tranformation methods are -All transformations -------------------- - freeze() - eval and freeze the lazy objects - thaw() - release the lazy objects +# All transformations +# ------------------- +# freeze() - eval and freeze the lazy objects +# thaw() - release the lazy objects - xy_tup(xy) - transform the tuple (x,y) - seq_x_y(x, y) - transform the python sequences x and y - numerix_x_y(x, y) - x and y are numerix 1D arrays - numerix_xy(xy) - xy is a numerix array of shape (N,2) - inverse_numerix_xy(xy)- inverse of the above - seq_xy_tups(seq) - seq is a sequence of xy tuples or a (N,2) array - inverse_xy_tup(xy) - apply the inverse transformation to tuple xy +# xy_tup(xy) - transform the tuple (x,y) +# seq_x_y(x, y) - transform the python sequences x and y +# numerix_x_y(x, y) - x and y are numerix 1D arrays +# numerix_xy(xy) - xy is a numerix array of shape (N,2) +# inverse_numerix_xy(xy)- inverse of the above +# seq_xy_tups(seq) - seq is a sequence of xy tuples or a (N,2) array +# inverse_xy_tup(xy) - apply the inverse transformation to tuple xy - set_offset(xy, trans) - xy is an x,y tuple and trans is a - Transformation instance. This will apply a post transformational - offset of all future transformations by xt,yt = trans.xy_tup(xy[0], xy[1]) +# set_offset(xy, trans) - xy is an x,y tuple and trans is a +# Transformation instance. This will apply a post transformational +# offset of all future transformations by xt,yt = trans.xy_tup(xy[0], xy[1]) - deepcopy() - returns a deep copy; references are lost - shallowcopy() - returns a shallow copy excluding the offset +# deepcopy() - returns a deep copy; references are lost +# shallowcopy() - returns a shallow copy excluding the offset -Separable transformations -------------------------- +# Separable transformations +# ------------------------- - get_bbox1() - return the input bbox - get_bbox2() - return the output bbox - set_bbox1() - set the input bbox - set_bbox2() - set the output bbox - get_funcx() - return the Func instance on x - get_funcy() - return the Func instance on y - set_funcx() - set the Func instance on x - set_funcy() - set the Func instance on y +# get_bbox1() - return the input bbox +# get_bbox2() - return the output bbox +# set_bbox1() - set the input bbox +# set_bbox2() - set the output bbox +# get_funcx() - return the Func instance on x +# get_funcy() - return the Func instance on y +# set_funcx() - set the Func instance on x +# set_funcy() - set the Func instance on y -Affine transformations ----------------------- +# Affine transformations +# ---------------------- - as_vec6() - return the affine as length 6 list of Values +# as_vec6() - return the affine as length 6 list of Values -In general, you shouldn't need to construct your own transformations, -but should use the helper functions defined in this module. +# In general, you shouldn't need to construct your own transformations, +# but should use the helper functions defined in this module. - zero - return Value(0) - one - return Value(1) - origin - return Point(zero(), zero()) - unit_bbox - return the 0,0 to 1,1 bounding box - identity_affine - An affine identity transformation - identity_transform - An identity separable transformation - translation_transform - a pure translational affine - scale_transform - a pure scale affine - scale_sep_transform - a pure scale separable transformation - scale_translation_transform - a scale and translate affine - bound_vertices - return the bbox that bounds all the xy tuples - bbox_all - return the bbox that bounds all the bboxes - lbwh_to_bbox - build a bbox from tuple - left, bottom, width, height tuple +# zero - return Value(0) +# one - return Value(1) +# origin - return Point(zero(), zero()) +# unit_bbox - return the 0,0 to 1,1 bounding box +# identity_affine - An affine identity transformation +# identity_transform - An identity separable transformation +# translation_transform - a pure translational affine +# scale_transform - a pure scale affine +# scale_sep_transform - a pure scale separable transformation +# scale_translation_transform - a scale and translate affine +# bound_vertices - return the bbox that bounds all the xy tuples +# bbox_all - return the bbox that bounds all the bboxes +# lbwh_to_bbox - build a bbox from tuple +# left, bottom, width, height tuple - multiply_affines - return the affine that is the matrix product of - the two affines +# multiply_affines - return the affine that is the matrix product of +# the two affines - get_bbox_transform - return a SeparableTransformation instance that - transforms one bbox to another +# get_bbox_transform - return a SeparableTransformation instance that +# transforms one bbox to another - blend_xy_sep_transform - mix the x and y components of two separable - transformations into a new transformation. - This allows you to specify x and y in - different coordinate systems +# blend_xy_sep_transform - mix the x and y components of two separable +# transformations into a new transformation. +# This allows you to specify x and y in +# different coordinate systems - transform_bbox - apply a transformation to a bbox and return the - transformed bbox +# transform_bbox - apply a transformation to a bbox and return the +# transformed bbox - inverse_transform_bbox - apply the inverse transformation of a bbox - and return the inverse transformed bbox +# inverse_transform_bbox - apply the inverse transformation of a bbox +# and return the inverse transformed bbox - offset_copy - make a copy with an offset +# offset_copy - make a copy with an offset -The units/transform_unit.py code has many examples. +# The units/transform_unit.py code has many examples. -A related and partly overlapping class, PBox, has been added to the -original transforms module to facilitate Axes repositioning and resizing. -At present, the differences between Bbox and PBox include: +# A related and partly overlapping class, PBox, has been added to the +# original transforms module to facilitate Axes repositioning and resizing. +# At present, the differences between Bbox and PBox include: - Bbox works with the bounding box, the coordinates of the lower-left - and upper-right corners; PBox works with the lower-left coordinates - and the width, height pair (left, bottom, width, height, or 'lbwh'). - Obviously, these are equivalent, but lbwh is what is used by - Axes._position, and it is the natural specification for the types of - manipulations for which the PBox class was made. +# Bbox works with the bounding box, the coordinates of the lower-left +# and upper-right corners; PBox works with the lower-left coordinates +# and the width, height pair (left, bottom, width, height, or 'lbwh'). +# Obviously, these are equivalent, but lbwh is what is used by +# Axes._position, and it is the natural specification for the types of +# manipulations for which the PBox class was made. - Bbox uses LazyValues grouped in pairs as 'll' and 'ur' Point objects; - PBox uses a 4-element list, subclassed from the python list. +# Bbox uses LazyValues grouped in pairs as 'll' and 'ur' Point objects; +# PBox uses a 4-element list, subclassed from the python list. - Bbox and PBox methods are mostly quite different, reflecting their - different original purposes. Similarly, the CXX implementation of - Bbox is good for methods such as update and for lazy evaluation, but - for PBox intended uses, involving very little calculation, pure - python probably is adequate. +# Bbox and PBox methods are mostly quite different, reflecting their +# different original purposes. Similarly, the CXX implementation of +# Bbox is good for methods such as update and for lazy evaluation, but +# for PBox intended uses, involving very little calculation, pure +# python probably is adequate. -In the future we may reimplement the PBox using Bbox -and transforms, or eliminate it entirely by adding its methods -and attributes to Bbox and/or putting them elsewhere in this module. -""" -from __future__ import division -import math -import numpy as npy +# In the future we may reimplement the PBox using Bbox +# and transforms, or eliminate it entirely by adding its methods +# and attributes to Bbox and/or putting them elsewhere in this module. +# """ +# from __future__ import division +# import math +# import numpy as npy -from matplotlib._transforms import Value, Point, Interval, Bbox, Affine -from matplotlib._transforms import IDENTITY, LOG10, POLAR, Func, FuncXY -from matplotlib._transforms import SeparableTransformation -from matplotlib._transforms import NonseparableTransformation +# from matplotlib._transforms import Value, Point, Interval, Bbox, Affine +# from matplotlib._transforms import IDENTITY, LOG10, POLAR, Func, FuncXY +# from matplotlib._transforms import SeparableTransformation +# from matplotlib._transforms import NonseparableTransformation -def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): - ''' - Ensure the endpoints of a range are not too close together. +# def nonsingular(vmin, vmax, expander=0.001, tiny=1e-15, increasing=True): +# ''' +# Ensure the endpoints of a range are not too close together. - "too close" means the interval is smaller than 'tiny' times - the maximum absolute value. +# "too close" means the interval is smaller than 'tiny' times +# the maximum absolute value. - If they are too close, each will be moved by the 'expander'. - If 'increasing' is True and vmin > vmax, they will be swapped, - regardless of whether they are too close. - ''' - swapped = False - if vmax < vmin: - vmin, vmax = vmax, vmin - swapped = True - if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny: - if vmin==0.0: - vmin = -expander - vmax = expander - else: - vmin -= expander*abs(vmin) - vmax += expander*abs(vmax) - if swapped and not increasing: - vmin, vmax = vmax, vmin - return vmin, vmax +# If they are too close, each will be moved by the 'expander'. +# If 'increasing' is True and vmin > vmax, they will be swapped, +# regardless of whether they are too close. +# ''' +# swapped = False +# if vmax < vmin: +# vmin, vmax = vmax, vmin +# swapped = True +# if vmax - vmin <= max(abs(vmin), abs(vmax)) * tiny: +# if vmin==0.0: +# vmin = -expander +# vmax = expander +# else: +# vmin -= expander*abs(vmin) +# vmax += expander*abs(vmax) +# if swapped and not increasing: +# vmin, vmax = vmax, vmin +# return vmin, vmax -def zero(): return Value(0) +# def zero(): return Value(0) -def one() : return Value(1) +# def one() : return Value(1) -def origin(): - return Point( zero(), zero() ) +# def origin(): +# return Point( zero(), zero() ) -def unit_bbox(): - """ - Get a 0,0 -> 1,1 Bbox instance - """ - return Bbox( origin(), Point( one(), one() ) ) +# def unit_bbox(): +# """ +# Get a 0,0 -> 1,1 Bbox instance +# """ +# return Bbox( origin(), Point( one(), one() ) ) -def identity_affine(): - """ - Get an affine transformation that maps x,y -> x,y - """ +# def identity_affine(): +# """ +# Get an affine transformation that maps x,y -> x,y +# """ - return Affine(one(), zero(), zero(), one(), zero(), zero()) +# return Affine(one(), zero(), zero(), one(), zero(), zero()) -def identity_transform(): - """ - Get an affine transformation that maps x,y -> x,y - """ - return SeparableTransformation(unit_bbox(), unit_bbox(), - Func(IDENTITY), - Func(IDENTITY)) +# def identity_transform(): +# """ +# Get an affine transformation that maps x,y -> x,y +# """ +# return SeparableTransformation(unit_bbox(), unit_bbox(), +# Func(IDENTITY), +# Func(IDENTITY)) -def translation_transform(tx, ty): - """ - return a pure tranlational transformation... [truncated message content] |
From: <ef...@us...> - 2007-09-10 06:55:11
|
Revision: 3821 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3821&view=rev Author: efiring Date: 2007-09-09 23:55:10 -0700 (Sun, 09 Sep 2007) Log Message: ----------- Removed obsolete and broken methods from Axes and PolarAxes Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2007-09-10 01:42:39 UTC (rev 3820) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-09-10 06:55:10 UTC (rev 3821) @@ -1864,31 +1864,6 @@ c =mcolors.colorConverter.to_rgba(c) self._cursorProps = lw, c - - def panx(self, numsteps): - 'Pan the x axis numsteps (plus pan right, minus pan left)' - self.xaxis.pan(numsteps) - xmin, xmax = self.viewLim.intervalx().get_bounds() - self._send_xlim_event() - - def pany(self, numsteps): - 'Pan the x axis numsteps (plus pan up, minus pan down)' - self.yaxis.pan(numsteps) - self._send_ylim_event() - - def zoomx(self, numsteps): - 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)' - self.xaxis.zoom(numsteps) - xmin, xmax = self.viewLim.intervalx().get_bounds() - self._send_xlim_event() - - def zoomy(self, numsteps): - 'Zoom in on the x xaxis numsteps (plus for zoom in, minus for zoom out)' - self.yaxis.zoom(numsteps) - self._send_ylim_event() - - - def connect(self, s, func): """ Register observers to be notified when certain events occur. Register @@ -1910,6 +1885,7 @@ def disconnect(self, cid): 'disconnect from the Axes event.' raise DeprecationWarning('use the callbacks CallbackRegistry instance instead') + def get_children(self): 'return a list of child artists' children = [] @@ -5678,38 +5654,14 @@ 'ylabel not implemented' raise NotImplementedError('ylabel not defined for polar axes (yet)') + def set_xlim(self, xmin=None, xmax=None, emit=True, **kwargs): + 'xlim not implemented' + raise NotImplementedError('xlim not meaningful for polar axes') - def set_xlim(self, xmin=None, xmax=None, emit=True): - """ - set the xlimits - ACCEPTS: len(2) sequence of floats - """ - if xmax is None and iterable(xmin): - xmin,xmax = xmin + def set_ylim(self, ymin=None, ymax=None, emit=True, **kwargs): + 'ylim not implemented' + raise NotImplementedError('ylim not meaningful for polar axes') - old_xmin,old_xmax = self.get_xlim() - if xmin is None: xmin = old_xmin - if xmax is None: xmax = old_xmax - - self.viewLim.intervalx().set_bounds(xmin, xmax) - if emit: self._send_xlim_event() - - - def set_ylim(self, ymin=None, ymax=None, emit=True): - """ - set the ylimits - ACCEPTS: len(2) sequence of floats - """ - if ymax is None and iterable(ymin): - ymin,ymax = ymin - - old_ymin,old_ymax = self.get_ylim() - if ymin is None: ymin = old_ymin - if ymax is None: ymax = old_ymax - - self.viewLim.intervaly().set_bounds(ymin, ymax) - if emit: self._send_ylim_event() - def get_xscale(self): 'return the xaxis scale string' return 'polar' @@ -5760,10 +5712,9 @@ """ # this is some discarded code I was using to find the minimum positive # data point for some log scaling fixes. I realized there was a -# cleaner way to do it, but am ke -eping this around as an example for +# cleaner way to do it, but am keeping this around as an example for # how to get the data out of the axes. Might want to make something -# like this a method one day, or better yet make get_verts and Artist +# like this a method one day, or better yet make get_verts an Artist # method minx, maxx = self.get_xlim() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-09-10 01:42:43
|
Revision: 3820 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3820&view=rev Author: efiring Date: 2007-09-09 18:42:39 -0700 (Sun, 09 Sep 2007) Log Message: ----------- Numpification and cleanup of examples Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/examples/animation_blit.py trunk/matplotlib/examples/animation_blit_fltk.py trunk/matplotlib/examples/animation_blit_qt.py trunk/matplotlib/examples/animation_blit_qt4.py trunk/matplotlib/examples/animation_blit_tk.py trunk/matplotlib/examples/animation_blit_wx.py trunk/matplotlib/examples/backend_driver.py trunk/matplotlib/examples/clippedline.py trunk/matplotlib/examples/collections_demo.py trunk/matplotlib/examples/color_by_yvalue.py trunk/matplotlib/examples/contourf_demo.py trunk/matplotlib/examples/data_helper.py trunk/matplotlib/examples/dynamic_demo_wx.py trunk/matplotlib/examples/dynamic_image_wxagg.py trunk/matplotlib/examples/dynamic_image_wxagg2.py trunk/matplotlib/examples/embedding_in_gtk.py trunk/matplotlib/examples/embedding_in_gtk2.py trunk/matplotlib/examples/embedding_in_gtk3.py trunk/matplotlib/examples/embedding_in_qt.py trunk/matplotlib/examples/embedding_in_qt4.py trunk/matplotlib/examples/embedding_in_tk.py trunk/matplotlib/examples/embedding_in_tk2.py trunk/matplotlib/examples/embedding_in_wx.py trunk/matplotlib/examples/embedding_in_wx2.py trunk/matplotlib/examples/embedding_in_wx3.py trunk/matplotlib/examples/embedding_in_wx4.py trunk/matplotlib/examples/gtk_spreadsheet.py trunk/matplotlib/examples/histogram_demo_canvasagg.py trunk/matplotlib/examples/image_masked.py trunk/matplotlib/examples/mathtext_wx.py trunk/matplotlib/examples/mpl_with_glade.py trunk/matplotlib/examples/multi_image.py trunk/matplotlib/examples/pcolor_nonuniform.py trunk/matplotlib/examples/polar_bar.py trunk/matplotlib/examples/polar_demo.py trunk/matplotlib/examples/polar_legend.py trunk/matplotlib/examples/poly_editor.py trunk/matplotlib/examples/printing_in_wx.py trunk/matplotlib/examples/pythonic_matplotlib.py trunk/matplotlib/examples/scatter_masked.py trunk/matplotlib/examples/strip_chart_demo.py trunk/matplotlib/examples/tex_demo.py trunk/matplotlib/examples/tex_unicode_demo.py trunk/matplotlib/examples/vline_demo.py trunk/matplotlib/examples/webapp_demo.py trunk/matplotlib/examples/wxcursor_demo.py Removed Paths: ------------- trunk/matplotlib/examples/anim_tk.py trunk/matplotlib/examples/image_demo_na.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/CHANGELOG 2007-09-10 01:42:39 UTC (rev 3820) @@ -5,7 +5,9 @@ from pylab is nearly unchanged, but there is the new alternative of importing from pyplot to get the state-engine graphics without all the numeric - functions. - EF + functions. + Numpified examples; deleted two that were obsolete; + modified some to use pyplot. - EF 2007-09-08 Eliminated gd and paint backends - EF Deleted: trunk/matplotlib/examples/anim_tk.py =================================================================== --- trunk/matplotlib/examples/anim_tk.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/anim_tk.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,49 +0,0 @@ -# deprecated - this example is no longer needed. Follow the model of -# anim.py to use interaction = True to avoid all the cruft of timers, -# callbacks and the likes used here - -#!/usr/bin/env python2.3 - -import matplotlib -matplotlib.use('TkAgg') -import pylab - -#import Tkinter as Tk -import matplotlib.numerix as numerix -fig = pylab.figure(1) -ind = numerix.arange(60) - - - -x_tmp=[] -for i in range(100): - x_tmp.append(numerix.sin((ind+i)*numerix.pi/15.0)) - -X=numerix.array(x_tmp) - - -lines = pylab.plot(X[:,0],'o') - -manager = pylab.get_current_fig_manager() - -def updatefig(*args): - updatefig.count += 1 - lines[0].set_ydata(X[:,updatefig.count%60]) - manager.canvas.draw() - return updatefig.count -updatefig.count=-1 - -def run(*args): - print 'called run' - - import time - tstart = time.time() - while 1: - cnt = updatefig() - if cnt==100: break - print 'elapsed', 100.0/(time.time() - tstart) - -import Tkinter as Tk -manager.window.after(10, run) -manager.show() -Tk.mainloop() Modified: trunk/matplotlib/examples/animation_blit.py =================================================================== --- trunk/matplotlib/examples/animation_blit.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -10,7 +10,7 @@ import matplotlib matplotlib.use('GTKAgg') -import matplotlib.numerix as nx +import numpy as npy import pylab as p @@ -21,8 +21,8 @@ p.grid() # to ensure proper background restore # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) # for profiling tstart = time.time() @@ -34,7 +34,7 @@ # restore the clean slate background canvas.restore_region(update_line.background) # update the data - line.set_ydata(nx.sin(x+update_line.cnt/10.0)) + line.set_ydata(npy.sin(x+update_line.cnt/10.0)) # just draw the animated artist try: ax.draw_artist(line) Modified: trunk/matplotlib/examples/animation_blit_fltk.py =================================================================== --- trunk/matplotlib/examples/animation_blit_fltk.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit_fltk.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -3,7 +3,7 @@ import matplotlib matplotlib.use('FltkAgg') import pylab as p -import matplotlib.numerix as nx +import numpy as nx import time Modified: trunk/matplotlib/examples/animation_blit_qt.py =================================================================== --- trunk/matplotlib/examples/animation_blit_qt.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit_qt.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -15,7 +15,7 @@ ITERS = 1000 import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time class BlitQT(QObject): @@ -27,8 +27,8 @@ self.cnt = 0 # create the initial line - self.x = nx.arange(0,2*nx.pi,0.01) - self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2) + self.x = npy.arange(0,2*npy.pi,0.01) + self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2) self.background = None @@ -39,7 +39,7 @@ # restore the clean slate background self.canvas.restore_region(self.background) # update the data - self.line.set_ydata(nx.sin(self.x+self.cnt/10.0)) + self.line.set_ydata(npy.sin(self.x+self.cnt/10.0)) # just draw the animated artist self.ax.draw_artist(self.line) # just redraw the axes rectangle Modified: trunk/matplotlib/examples/animation_blit_qt4.py =================================================================== --- trunk/matplotlib/examples/animation_blit_qt4.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit_qt4.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -10,7 +10,7 @@ ITERS = 1000 import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time class BlitQT(QtCore.QObject): @@ -22,8 +22,8 @@ self.cnt = 0 # create the initial line - self.x = nx.arange(0,2*nx.pi,0.01) - self.line, = p.plot(self.x, nx.sin(self.x), animated=True, lw=2) + self.x = npy.arange(0,2*npy.pi,0.01) + self.line, = p.plot(self.x, npy.sin(self.x), animated=True, lw=2) self.background = None @@ -34,7 +34,7 @@ # restore the clean slate background self.canvas.restore_region(self.background) # update the data - self.line.set_ydata(nx.sin(self.x+self.cnt/10.0)) + self.line.set_ydata(npy.sin(self.x+self.cnt/10.0)) # just draw the animated artist self.ax.draw_artist(self.line) # just redraw the axes rectangle Modified: trunk/matplotlib/examples/animation_blit_tk.py =================================================================== --- trunk/matplotlib/examples/animation_blit_tk.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit_tk.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -6,7 +6,7 @@ import sys import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time ax = p.subplot(111) @@ -14,8 +14,8 @@ # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) def run(*args): background = canvas.copy_from_bbox(ax.bbox) @@ -26,7 +26,7 @@ # restore the clean slate background canvas.restore_region(background) # update the data - line.set_ydata(nx.sin(x+run.cnt/10.0)) + line.set_ydata(npy.sin(x+run.cnt/10.0)) # just draw the animated artist ax.draw_artist(line) # just redraw the axes rectangle Modified: trunk/matplotlib/examples/animation_blit_wx.py =================================================================== --- trunk/matplotlib/examples/animation_blit_wx.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/animation_blit_wx.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -12,7 +12,7 @@ import wx import sys import pylab as p -import matplotlib.numerix as nx +import numpy as npy import time @@ -30,8 +30,8 @@ p.grid() # to ensure proper background restore # create the initial line -x = nx.arange(0,2*nx.pi,0.01) -line, = p.plot(x, nx.sin(x), animated=True, lw=2) +x = npy.arange(0,2*npy.pi,0.01) +line, = p.plot(x, npy.sin(x), animated=True, lw=2) # for profiling tstart = time.time() @@ -46,7 +46,7 @@ # restore the clean slate background canvas.restore_region(update_line.background) # update the data - line.set_ydata(nx.sin(x+update_line.cnt/10.0)) + line.set_ydata(npy.sin(x+update_line.cnt/10.0)) # just draw the animated artist ax.draw_artist(line) # just redraw the axes rectangle Modified: trunk/matplotlib/examples/backend_driver.py =================================================================== --- trunk/matplotlib/examples/backend_driver.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/backend_driver.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -42,7 +42,6 @@ 'histogram_demo.py', 'image_demo.py', 'image_demo2.py', - 'image_demo_na.py', 'image_masked.py', 'image_origin.py', 'invert_axes.py', @@ -158,7 +157,7 @@ if __name__ == '__main__': times = {} - default_backends = ['Agg', 'PS', 'SVG', 'Template'] + default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template'] if sys.platform == 'win32': python = r'c:\Python24\python.exe' else: Modified: trunk/matplotlib/examples/clippedline.py =================================================================== --- trunk/matplotlib/examples/clippedline.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/clippedline.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -4,7 +4,7 @@ """ from matplotlib.lines import Line2D -import matplotlib.numerix as nx +import numpy as npy from pylab import figure, show class ClippedLine(Line2D): @@ -19,13 +19,13 @@ def set_data(self, *args, **kwargs): Line2D.set_data(self, *args, **kwargs) - self.xorig = nx.array(self._x) - self.yorig = nx.array(self._y) + self.xorig = npy.array(self._x) + self.yorig = npy.array(self._y) def draw(self, renderer): xlim = self.ax.get_xlim() - ind0, ind1 = nx.searchsorted(self.xorig, xlim) + ind0, ind1 = npy.searchsorted(self.xorig, xlim) self._x = self.xorig[ind0:ind1] self._y = self.yorig[ind0:ind1] N = len(self._x) @@ -43,8 +43,8 @@ fig = figure() ax = fig.add_subplot(111, autoscale_on=False) -t = nx.arange(0.0, 100.0, 0.01) -s = nx.sin(2*nx.pi*t) +t = npy.arange(0.0, 100.0, 0.01) +s = npy.sin(2*npy.pi*t) line = ClippedLine(ax, t, s, color='g', ls='-', lw=2) ax.add_line(line) ax.set_xlim(10,30) Modified: trunk/matplotlib/examples/collections_demo.py =================================================================== --- trunk/matplotlib/examples/collections_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/collections_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -17,10 +17,10 @@ ''' -import pylab as P +import matplotlib.pyplot as P from matplotlib import collections, axes, transforms from matplotlib.colors import colorConverter -import matplotlib.numerix as N +import numpy as N nverts = 50 npts = 100 @@ -33,8 +33,8 @@ spiral = zip(xx,yy) # Make some offsets -xo = P.randn(npts) -yo = P.randn(npts) +xo = N.random.randn(npts) +yo = N.random.randn(npts) xyo = zip(xo, yo) # Make a list of colors cycling through the rgbcmyk series. @@ -90,7 +90,7 @@ a = fig.add_subplot(2,2,3) col = collections.RegularPolyCollection(fig.dpi, 7, - sizes = P.fabs(xx)*10, offsets=xyo, + sizes = N.fabs(xx)*10, offsets=xyo, transOffset=a.transData) a.add_collection(col, autolim=True) trans = transforms.scale_transform(fig.dpi/transforms.Value(72.), @@ -111,12 +111,12 @@ ncurves = 20 offs = (0.1, 0.0) -yy = P.linspace(0, 2*N.pi, nverts) -ym = P.amax(yy) +yy = N.linspace(0, 2*N.pi, nverts) +ym = N.amax(yy) xx = (0.2 + (ym-yy)/ym)**2 * N.cos(yy-0.4) * 0.5 segs = [] for i in range(ncurves): - xxx = xx + 0.02*P.randn(nverts) + xxx = xx + 0.02*N.random.randn(nverts) curve = zip(xxx, yy*100) segs.append(curve) Modified: trunk/matplotlib/examples/color_by_yvalue.py =================================================================== --- trunk/matplotlib/examples/color_by_yvalue.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/color_by_yvalue.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,7 +1,7 @@ # use masked arrays to plot a line with different colors by y-value -import matplotlib.numerix.ma as ma -from matplotlib.numerix import logical_or -from pylab import plot, show, arange, sin, pi +import matplotlib.numerix.npyma as ma +from numpy import logical_or, arange, sin, pi +from matplotlib.pyplot import plot, show t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) Modified: trunk/matplotlib/examples/contourf_demo.py =================================================================== --- trunk/matplotlib/examples/contourf_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/contourf_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,6 +1,6 @@ #!/usr/bin/env python from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma origin = 'lower' #origin = 'upper' Modified: trunk/matplotlib/examples/data_helper.py =================================================================== --- trunk/matplotlib/examples/data_helper.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/data_helper.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,7 +1,8 @@ #!/usr/bin/env python # Some functions to load a return data for the plot demos -from matplotlib.numerix import fromstring, argsort, take, array, resize +from numpy import fromstring, argsort, take, array, resize + def get_two_stock_data(): """ load stock time and price data for two stocks The return values Modified: trunk/matplotlib/examples/dynamic_demo_wx.py =================================================================== --- trunk/matplotlib/examples/dynamic_demo_wx.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/dynamic_demo_wx.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -63,7 +63,7 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot -import matplotlib.numerix as numpy +import numpy from wx import * Modified: trunk/matplotlib/examples/dynamic_image_wxagg.py =================================================================== --- trunk/matplotlib/examples/dynamic_image_wxagg.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/dynamic_image_wxagg.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -12,26 +12,13 @@ import matplotlib matplotlib.use('WXAgg') -# jdh: you need to control Numeric vs numarray with numerix, otherwise -# matplotlib may be using numeric under the hood and while you are -# using numarray and this isn't efficient. Also, if you use -# numerix=numarray, it is important to compile matplotlib for numarray -# by setting NUMERIX = 'numarray' in setup.py before building from matplotlib import rcParams -##rcParams['numerix'] = 'numarray' - - -# jdh: you can import cm directly, you don't need to go via -# pylab import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg -# jdh: you don't need a figure manager in the GUI - this class was -# designed for the pylab interface - from matplotlib.figure import Figure -import matplotlib.numerix as numerix +import numpy as npy import wx @@ -75,12 +62,12 @@ # jdh you can add a subplot directly from the fig rather than # the fig manager a = self.fig.add_subplot(111) - self.x = numerix.arange(120.0)*2*numerix.pi/120.0 + self.x = npy.arange(120.0)*2*npy.pi/120.0 self.x.resize((100,120)) - self.y = numerix.arange(100.0)*2*numerix.pi/100.0 + self.y = npy.arange(100.0)*2*npy.pi/100.0 self.y.resize((120,100)) - self.y = numerix.transpose(self.y) - z = numerix.sin(self.x) + numerix.cos(self.y) + self.y = npy.transpose(self.y) + z = npy.sin(self.x) + npy.cos(self.y) self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest') def GetToolBar(self): @@ -89,9 +76,9 @@ return self.toolbar def onTimer(self, evt): - self.x += numerix.pi/15 - self.y += numerix.pi/20 - z = numerix.sin(self.x) + numerix.cos(self.y) + self.x += npy.pi/15 + self.y += npy.pi/20 + z = npy.sin(self.x) + npy.cos(self.y) self.im.set_array(z) self.canvas.draw() #self.canvas.gui_repaint() # jdh wxagg_draw calls this already Modified: trunk/matplotlib/examples/dynamic_image_wxagg2.py =================================================================== --- trunk/matplotlib/examples/dynamic_image_wxagg2.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/dynamic_image_wxagg2.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -12,24 +12,14 @@ import matplotlib matplotlib.use('WXAgg') -# jdh: you need to control Numeric vs numarray with numerix, otherwise -# matplotlib may be using numeric under the hood and while you are -# using numarray and this isn't efficient. Also, if you use -# numerix=numarray, it is important to compile matplotlib for numarray -# by setting NUMERIX = 'numarray' in setup.py before building from matplotlib import rcParams import numpy as npy -# jdh: you can import cm directly, you don't need to go via -# pylab import matplotlib.cm as cm from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg from matplotlib.backends.backend_wx import NavigationToolbar2Wx -# jdh: you don't need a figure manager in the GUI - this class was -# designed for the pylab interface - from matplotlib.figure import Figure from wx import * Modified: trunk/matplotlib/examples/embedding_in_gtk.py =================================================================== --- trunk/matplotlib/examples/embedding_in_gtk.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_gtk.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -8,7 +8,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: trunk/matplotlib/examples/embedding_in_gtk2.py =================================================================== --- trunk/matplotlib/examples/embedding_in_gtk2.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_gtk2.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -7,7 +7,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: trunk/matplotlib/examples/embedding_in_gtk3.py =================================================================== --- trunk/matplotlib/examples/embedding_in_gtk3.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_gtk3.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -7,7 +7,7 @@ from matplotlib.axes import Subplot from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi # uncomment to select /GTK/GTKAgg/GTKCairo #from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas Modified: trunk/matplotlib/examples/embedding_in_qt.py =================================================================== --- trunk/matplotlib/examples/embedding_in_qt.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_qt.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -11,7 +11,7 @@ import sys, os, random from qt import * -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure Modified: trunk/matplotlib/examples/embedding_in_qt4.py =================================================================== --- trunk/matplotlib/examples/embedding_in_qt4.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_qt4.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -12,7 +12,7 @@ import sys, os, random from PyQt4 import QtGui, QtCore -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure Modified: trunk/matplotlib/examples/embedding_in_tk.py =================================================================== --- trunk/matplotlib/examples/embedding_in_tk.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_tk.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -2,7 +2,7 @@ import matplotlib matplotlib.use('TkAgg') -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.axes import Subplot from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure Modified: trunk/matplotlib/examples/embedding_in_tk2.py =================================================================== --- trunk/matplotlib/examples/embedding_in_tk2.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_tk2.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -2,7 +2,7 @@ import matplotlib matplotlib.use('TkAgg') -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi from matplotlib.axes import Subplot from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure Modified: trunk/matplotlib/examples/embedding_in_wx.py =================================================================== --- trunk/matplotlib/examples/embedding_in_wx.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_wx.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -44,7 +44,7 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot -import matplotlib.numerix as numpy +import numpy from wx import * Modified: trunk/matplotlib/examples/embedding_in_wx2.py =================================================================== --- trunk/matplotlib/examples/embedding_in_wx2.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_wx2.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -4,7 +4,7 @@ toolbar - comment out the setA_toolbar line for no toolbar """ -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import matplotlib Modified: trunk/matplotlib/examples/embedding_in_wx3.py =================================================================== --- trunk/matplotlib/examples/embedding_in_wx3.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_wx3.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -25,8 +25,6 @@ from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg from matplotlib.figure import Figure import numpy as npy -import matplotlib.numerix.mlab as mlab -from matplotlib.mlab import meshgrid from wx import * from wx.xrc import * @@ -61,11 +59,11 @@ x = npy.arange(120.0)*2*npy.pi/60.0 y = npy.arange(100.0)*2*npy.pi/50.0 - self.x, self.y = meshgrid(x, y) + self.x, self.y = npy.meshgrid(x, y) z = npy.sin(self.x) + npy.cos(self.y) self.im = a.imshow( z, cmap=cm.jet)#, interpolation='nearest') - zmax = mlab.max(mlab.max(z))-ERR_TOL + zmax = npy.amax(z) - ERR_TOL ymax_i, xmax_i = npy.nonzero(z >= zmax) if self.im.origin == 'upper': ymax_i = z.shape[0]-ymax_i @@ -84,7 +82,7 @@ z = npy.sin(self.x) + npy.cos(self.y) self.im.set_array(z) - zmax = mlab.max(mlab.max(z))-ERR_TOL + zmax = npy.amax(z) - ERR_TOL ymax_i, xmax_i = npy.nonzero(z >= zmax) if self.im.origin == 'upper': ymax_i = z.shape[0]-ymax_i Modified: trunk/matplotlib/examples/embedding_in_wx4.py =================================================================== --- trunk/matplotlib/examples/embedding_in_wx4.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/embedding_in_wx4.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -4,7 +4,7 @@ toolbar """ -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import matplotlib @@ -19,7 +19,7 @@ from matplotlib.backends.backend_wx import _load_bitmap from matplotlib.figure import Figure -from matplotlib.numerix.mlab import rand +from numpy.random import rand from wx import * Modified: trunk/matplotlib/examples/gtk_spreadsheet.py =================================================================== --- trunk/matplotlib/examples/gtk_spreadsheet.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/gtk_spreadsheet.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -14,15 +14,13 @@ matplotlib.use('GTKAgg') # or 'GTK' from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas -#from matplotlib.numerix import rand -from matplotlib.numerix.random_array import random +from numpy.random import random from matplotlib.figure import Figure class DataManager(gtk.Window): numRows, numCols = 20,10 - #data = rand(numRows, numCols) data = random((numRows, numCols)) def __init__(self): Modified: trunk/matplotlib/examples/histogram_demo_canvasagg.py =================================================================== --- trunk/matplotlib/examples/histogram_demo_canvasagg.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/histogram_demo_canvasagg.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -13,7 +13,8 @@ from matplotlib.figure import Figure from matplotlib.axes import Subplot from matplotlib.mlab import normpdf -from matplotlib.numerix.mlab import randn +from numpy.random import randn +import numpy fig = Figure(figsize=(5,4), dpi=100) ax = fig.add_subplot(111) @@ -42,14 +43,14 @@ s = canvas.tostring_rgb() # save this and convert to bitmap as needed -# get the figure dimensions for creating bitmaps or numeric arrays, +# get the figure dimensions for creating bitmaps or numpy arrays, # etc. l,b,w,h = fig.bbox.get_bounds() w, h = int(w), int(h) if 0: - # convert to a Numeric array - X = fromstring(s, UInt8) + # convert to a numpy array + X = numpy.fromstring(s, numpy.uint8) X.shape = h, w, 3 if 0: Deleted: trunk/matplotlib/examples/image_demo_na.py =================================================================== --- trunk/matplotlib/examples/image_demo_na.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/image_demo_na.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,40 +0,0 @@ -#!/usr/bin/env python -from matplotlib import rcParams -rcParams['numerix'] = 'numarray' - -from pylab import * - - -def bivariate_normal(X, Y, sigmax=1.0, sigmay=1.0, - mux=0.0, muy=0.0, sigmaxy=0.0): - """ - Bivariate gaussan distribution for equal shape X, Y - - http://mathworld.wolfram.com/BivariateNormalDistribution.html - """ - Xmu = X-mux - Ymu = Y-muy - - rho = sigmaxy/(sigmax*sigmay) - z = (1.0/sigmax**2)*Xmu**2 + (1.0/sigmay)*Ymu**2 - (2*rho/(sigmax*sigmay))*Xmu*Ymu - return 1.0/(2*pi*sigmax*sigmay*(1-rho**2)) * exp( -1/(2*(1-rho**2))*z) - - -delta = 0.025 -x = arange(-3.0, 3.0, delta) -y = arange(-3.0, 3.0, delta) -X,Y = meshgrid(x, y) -Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0) -Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1) - -# difference of Gaussians -im = imshow(Z2-Z1) - -# set the interpolation method: 'nearest', 'bilinear', 'bicubic' and much more -im.set_interpolation('bilinear') - - -axis('off') -#savefig('test') -show() - Modified: trunk/matplotlib/examples/image_masked.py =================================================================== --- trunk/matplotlib/examples/image_masked.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/image_masked.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -4,7 +4,7 @@ ''' from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma import matplotlib.colors as colors delta = 0.025 Modified: trunk/matplotlib/examples/mathtext_wx.py =================================================================== --- trunk/matplotlib/examples/mathtext_wx.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/mathtext_wx.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -5,7 +5,7 @@ import matplotlib matplotlib.use("WxAgg") -from matplotlib.numerix import arange, sin, pi, cos, log +from numpy import arange, sin, pi, cos, log from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure @@ -42,14 +42,14 @@ self.figure = Figure() self.axes = self.figure.add_subplot(111) self.change_plot(0) - + self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.add_buttonbar() self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.add_toolbar() # comment this out for no toolbar - + menuBar = wx.MenuBar() # File Menu @@ -104,21 +104,21 @@ def OnChangePlot(self, event): self.change_plot(event.GetId() - 1000) - + def change_plot(self, plot_number): t = arange(1.0,3.0,0.01) s = functions[plot_number][1](t) self.axes.clear() self.axes.plot(t, s) self.Refresh() - + class MyApp(wx.App): def OnInit(self): frame = CanvasFrame(None, "wxPython mathtext demo app") self.SetTopWindow(frame) frame.Show(True) return True - + app = MyApp() app.MainLoop() Modified: trunk/matplotlib/examples/mpl_with_glade.py =================================================================== --- trunk/matplotlib/examples/mpl_with_glade.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/mpl_with_glade.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -8,7 +8,7 @@ from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar from matplotlib.widgets import SpanSelector -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import gtk import gtk.glade Modified: trunk/matplotlib/examples/multi_image.py =================================================================== --- trunk/matplotlib/examples/multi_image.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/multi_image.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -5,19 +5,20 @@ It also illustrates colorbar tick labelling with a multiplier. ''' -import pylab +from matplotlib.pyplot import figure, show, sci from matplotlib import cm, colors from matplotlib.font_manager import FontProperties -from matplotlib.numerix.mlab import amin, amax +from numpy import amin, amax, ravel +from numpy.random import rand Nr = 3 Nc = 2 -fig = pylab.gcf() +fig = figure() cmap = cm.cool figtitle = 'Multiple images' -t = pylab.gcf().text(0.5, 0.95, figtitle, +t = fig.text(0.5, 0.95, figtitle, horizontalalignment='center', fontproperties=FontProperties(size=16)) @@ -37,8 +38,8 @@ a.set_xticklabels([]) # Make some fake data with a range that varies # somewhat from one plot to the next. - data =((1+i+j)/10.0)*pylab.rand(10,20)*1e-6 - dd = pylab.ravel(data) + data =((1+i+j)/10.0)*rand(10,20)*1e-6 + dd = ravel(data) # Manually find the min and max of all colors for # use in setting the color scale. vmin = min(vmin, amin(dd)) @@ -60,12 +61,13 @@ # We need the following only if we want to run this # script interactively and be able to change the colormap. -pylab.sci(images[0]) -pylab.show() +sci(images[0]) +show() + Modified: trunk/matplotlib/examples/pcolor_nonuniform.py =================================================================== --- trunk/matplotlib/examples/pcolor_nonuniform.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/pcolor_nonuniform.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,11 +1,11 @@ -from pylab import figure, show -import matplotlib.numerix as nx +from matplotlib.pyplot import figure, show +import numpy as npy from matplotlib.image import NonUniformImage -x = nx.arange(-4, 4, 0.005) -y = nx.arange(-4, 4, 0.005) +x = npy.arange(-4, 4, 0.005) +y = npy.arange(-4, 4, 0.005) print 'Size %d points' % (len(x) * len(y)) -z = nx.sqrt(x[nx.NewAxis,:]**2 + y[:,nx.NewAxis]**2) +z = npy.sqrt(x[npy.newaxis,:]**2 + y[:,npy.newaxis]**2) fig = figure() ax = fig.add_subplot(111) Modified: trunk/matplotlib/examples/polar_bar.py =================================================================== --- trunk/matplotlib/examples/polar_bar.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/polar_bar.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,9 +1,8 @@ #!/usr/bin/env python -import matplotlib.numerix as nx -from matplotlib.mlab import linspace +import numpy as npy import matplotlib.cm as cm -from pylab import figure, show, rc +from matplotlib.pyplot import figure, show, rc # force square figure and square axes looks better for polar, IMO @@ -11,9 +10,9 @@ ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True) N = 20 -theta = nx.arange(0.0, 2*nx.pi, 2*nx.pi/N) -radii = 10*nx.mlab.rand(N) -width = nx.pi/4*nx.mlab.rand(N) +theta = npy.arange(0.0, 2*npy.pi, 2*npy.pi/N) +radii = 10*npy.random.rand(N) +width = npy.pi/4*npy.random.rand(N) bars = ax.bar(theta, radii, width=width, bottom=0.1) for r,bar in zip(radii, bars): bar.set_facecolor( cm.jet(r/10.)) Modified: trunk/matplotlib/examples/polar_demo.py =================================================================== --- trunk/matplotlib/examples/polar_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/polar_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -39,8 +39,8 @@ # See the pylab rgrids and thetagrids functions for # information on how to customize the grid locations and labels -import matplotlib.numerix as nx -from pylab import figure, show, rc +import numpy as npy +from matplotlib.pyplot import figure, show, rc # radar green, solid grid lines rc('grid', color='#316931', linewidth=1, linestyle='-') @@ -51,8 +51,8 @@ fig = figure(figsize=(8,8)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') -r = nx.arange(0, 3.0, 0.01) -theta = 2*nx.pi*r +r = npy.arange(0, 3.0, 0.01) +theta = 2*npy.pi*r ax.plot(theta, r, color='#ee8d18', lw=3) ax.set_rmax(2.0) Modified: trunk/matplotlib/examples/polar_legend.py =================================================================== --- trunk/matplotlib/examples/polar_legend.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/polar_legend.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,7 +1,7 @@ #!/usr/bin/env python -import matplotlib.numerix as nx -from pylab import figure, show, rc +import numpy as npy +from matplotlib.pyplot import figure, show, rc # radar green, solid grid lines rc('grid', color='#316931', linewidth=1, linestyle='-') @@ -12,8 +12,8 @@ fig = figure(figsize=(8,8)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c') -r = nx.arange(0, 3.0, 0.01) -theta = 2*nx.pi*r +r = npy.arange(0, 3.0, 0.01) +theta = 2*npy.pi*r ax.plot(theta, r, color='#ee8d18', lw=3, label='a line') ax.plot(0.5*theta, r, color='blue', ls='--', lw=3, label='another line') ax.legend() Modified: trunk/matplotlib/examples/poly_editor.py =================================================================== --- trunk/matplotlib/examples/poly_editor.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/poly_editor.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -5,8 +5,7 @@ """ from matplotlib.artist import Artist from matplotlib.patches import Polygon, CirclePolygon -from matplotlib.numerix import sqrt, nonzero, equal, asarray, dot, Float -from matplotlib.numerix.mlab import amin +from numpy import sqrt, nonzero, equal, asarray, dot, amin from matplotlib.mlab import dist_point_to_segment Modified: trunk/matplotlib/examples/printing_in_wx.py =================================================================== --- trunk/matplotlib/examples/printing_in_wx.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/printing_in_wx.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -39,7 +39,7 @@ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigCanvas from matplotlib.figure import Figure -import matplotlib.numerix as numpy +import numpy class PlotFrame(wx.Frame): help_msg=""" Menus for Modified: trunk/matplotlib/examples/pythonic_matplotlib.py =================================================================== --- trunk/matplotlib/examples/pythonic_matplotlib.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/pythonic_matplotlib.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -54,7 +54,7 @@ from pylab import figure, close, axes, subplot, show -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi t = arange(0.0, 1.0, 0.01) Modified: trunk/matplotlib/examples/scatter_masked.py =================================================================== --- trunk/matplotlib/examples/scatter_masked.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/scatter_masked.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,6 +1,6 @@ #!/usr/bin/env python from pylab import * -import matplotlib.numerix.ma as ma +import matplotlib.numerix.npyma as ma N = 100 r0 = 0.6 Modified: trunk/matplotlib/examples/strip_chart_demo.py =================================================================== --- trunk/matplotlib/examples/strip_chart_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/strip_chart_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -12,7 +12,7 @@ import gobject, gtk import matplotlib matplotlib.use('GTKAgg') -import matplotlib.numerix as nx +import numpy as npy from matplotlib.lines import Line2D @@ -36,9 +36,9 @@ def emitter(self, p=0.01): 'return a random value with probability p, else 0' - v = nx.mlab.rand(1) + v = npy.random.rand(1) if v>p: return 0. - else: return nx.mlab.rand(1) + else: return npy.random.rand(1) def update(self, *args): if self.background is None: return True Modified: trunk/matplotlib/examples/tex_demo.py =================================================================== --- trunk/matplotlib/examples/tex_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/tex_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -11,8 +11,8 @@ """ from matplotlib import rc -from matplotlib.numerix import arange, cos, pi -from pylab import figure, axes, plot, xlabel, ylabel, title, \ +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ grid, savefig, show Modified: trunk/matplotlib/examples/tex_unicode_demo.py =================================================================== --- trunk/matplotlib/examples/tex_unicode_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/tex_unicode_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -7,8 +7,8 @@ from matplotlib import rcParams rcParams['text.usetex']=True rcParams['text.latex.unicode']=True -from matplotlib.numerix import arange, cos, pi -from pylab import figure, axes, plot, xlabel, ylabel, title, \ +from numpy import arange, cos, pi +from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ grid, savefig, show figure(1) Modified: trunk/matplotlib/examples/vline_demo.py =================================================================== --- trunk/matplotlib/examples/vline_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/vline_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -1,17 +1,17 @@ #!/usr/bin/env python -from pylab import * -from matplotlib.numerix import sin, exp, multiply, absolute, pi -from matplotlib.numerix.random_array import normal +from matplotlib.pyplot import * +from numpy import sin, exp, absolute, pi, arange +from numpy.random import normal def f(t): s1 = sin(2*pi*t) e1 = exp(-t) - return absolute(multiply(s1,e1))+.05 + return absolute((s1*e1))+.05 t = arange(0.0, 5.0, 0.1) s = f(t) -nse = multiply(normal(0.0, 0.3, t.shape), s) +nse = normal(0.0, 0.3, t.shape) * s plot(t, s+nse, 'b^') vlines(t, [0], s) Modified: trunk/matplotlib/examples/webapp_demo.py =================================================================== --- trunk/matplotlib/examples/webapp_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/webapp_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -21,7 +21,7 @@ from matplotlib.backends.backend_agg import FigureCanvasAgg from matplotlib.figure import Figure from matplotlib.cbook import iterable -import matplotlib.numerix as nx +import numpy as npy def make_fig(): """ @@ -40,9 +40,9 @@ line, = ax.plot([1,2,3], 'ro--', markersize=12, markerfacecolor='g') # make a translucent scatter collection - x = nx.mlab.rand(100) - y = nx.mlab.rand(100) - area = nx.pi*(10 * nx.mlab.rand(100))**2 # 0 to 10 point radiuses + x = npy.random.rand(100) + y = npy.random.rand(100) + area = npy.pi*(10 * npy.random.rand(100))**2 # 0 to 10 point radiuses c = ax.scatter(x,y,area) c.set_alpha(0.5) Modified: trunk/matplotlib/examples/wxcursor_demo.py =================================================================== --- trunk/matplotlib/examples/wxcursor_demo.py 2007-09-09 22:41:36 UTC (rev 3819) +++ trunk/matplotlib/examples/wxcursor_demo.py 2007-09-10 01:42:39 UTC (rev 3820) @@ -6,7 +6,7 @@ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.backends.backend_wx import NavigationToolbar2Wx from matplotlib.figure import Figure -from matplotlib.numerix import arange, sin, pi +from numpy import arange, sin, pi import wx This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-09-09 22:41:38
|
Revision: 3819 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3819&view=rev Author: efiring Date: 2007-09-09 15:41:36 -0700 (Sun, 09 Sep 2007) Log Message: ----------- Factored plotting part of pylab.py into pyplot.py Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/boilerplate.py trunk/matplotlib/examples/rc_traits.py trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/mlab.py trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf trunk/matplotlib/lib/matplotlib/pylab.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/pyplot.py Removed Paths: ------------- trunk/matplotlib/examples/gdtest.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/CHANGELOG 2007-09-09 22:41:36 UTC (rev 3819) @@ -1,3 +1,12 @@ +2007-09-09 Split out the plotting part of pylab and put it in + pyplot.py; removed numerix from the remaining pylab.py, + which imports everything from pyplot.py. The intention + is that apart from cleanups, the result of importing + from pylab is nearly unchanged, but there is the + new alternative of importing from pyplot to get + the state-engine graphics without all the numeric + functions. - EF + 2007-09-08 Eliminated gd and paint backends - EF 2007-09-06 .bmp file format is now longer an alias for .raw @@ -8,12 +17,12 @@ Now it doesn't crash Preview.app. - JKS 2007-09-06 Refactored image saving code so that all GUI backends can - save most image types. See FILETYPES for a matrix of - backends and their supported file types. - Backend canvases should no longer write their own print_figure() - method -- instead they should write a print_xxx method for - each filetype they can output and add an entry to their - class-scoped filetypes dictionary. - MGD + save most image types. See FILETYPES for a matrix of + backends and their supported file types. + Backend canvases should no longer write their own print_figure() + method -- instead they should write a print_xxx method for + each filetype they can output and add an entry to their + class-scoped filetypes dictionary. - MGD 2007-09-05 Fixed Qt version reporting in setupext.py - DSD Modified: trunk/matplotlib/boilerplate.py =================================================================== --- trunk/matplotlib/boilerplate.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/boilerplate.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -29,7 +29,7 @@ return ret if Axes.%(func)s.__doc__ is not None: %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + \"\"\" -Addition kwargs: hold = [True|False] overrides default hold state\"\"\" +Additional kwargs: hold = [True|False] overrides default hold state\"\"\" """ _fmtmisc = """\ @@ -74,6 +74,8 @@ 'plot', 'plot_date', 'psd', + 'quiver', + 'quiverkey', 'scatter', 'semilogx', 'semilogy', @@ -82,8 +84,6 @@ 'stem', 'step', 'vlines', - 'quiver', - 'quiverkey', 'xcorr', ) @@ -104,7 +104,6 @@ 'pcolormesh' : 'gci._current = ret', 'imshow' : 'gci._current = ret', 'spy' : 'gci._current = ret', - 'quiver2' : 'gci._current = ret', 'quiver' : 'gci._current = ret', 'specgram' : 'gci._current = ret[-1]', @@ -129,11 +128,13 @@ # This function was autogenerated by boilerplate.py. Do not edit as # changes will be lost def %(name)s(): - 'set the default colormap to %(name)s and apply to current image if any. See help(colormaps) for more information' + ''' + set the default colormap to %(name)s and apply to current image if any. + See help(colormaps) for more information + ''' rc('image', cmap='%(name)s') im = gci() - if im is not None: im.set_cmap(cm.%(name)s) draw_if_interactive() Deleted: trunk/matplotlib/examples/gdtest.py =================================================================== --- trunk/matplotlib/examples/gdtest.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/examples/gdtest.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -1,34 +0,0 @@ -#!/usr/bin/env python -import matplotlib -matplotlib.use('GD') -from pylab import * - -def f(t): - s1 = cos(2*pi*t) - e1 = exp(-t) - return multiply(s1,e1) - -t1 = arange(0.0, 5.0, .1) -t2 = arange(0.0, 5.0, 0.02) -t3 = arange(0.0, 2.0, 0.01) - - -if 1: - subplot(211) - l = plot(t1, f(t1), 'k-^') - setp(l, 'markerfacecolor', 'r') - xlim(0,5) - title('A tale of 2 subplots', fontsize=12) - ylabel('Signal 1', fontsize=10) - - subplot(212) - l = plot(t1, f(t1), 'k->') - xlim(0,5) - ylabel('Signal 2', fontsize=10) - xlabel('time (s)', fontsize=10, fontname='Courier') - -ax = gca() - - -#savefig('gdtest', dpi=150) -show() Modified: trunk/matplotlib/examples/rc_traits.py =================================================================== --- trunk/matplotlib/examples/rc_traits.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/examples/rc_traits.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -128,8 +128,8 @@ antialiased = flexible_true_trait timezones = 'UTC', 'US/Central', 'ES/Eastern' # fixme: and many more -backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GD', 'GDK', 'GTK', 'Agg', - 'GTKCairo', 'Paint', 'PS', 'SVG', 'Template', 'TkAgg', +backends = ('GTKAgg', 'Cairo', 'FltkAgg', 'GDK', 'GTK', 'Agg', + 'GTKCairo', 'PS', 'SVG', 'Template', 'TkAgg', 'WX') class RC(traits.HasTraits): Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -530,16 +530,16 @@ class RcParams(dict): - + """A dictionary object including validation - + validating functions are defined and associated with rc parameters in rcsetup.py """ - + validate = dict([ (key, converter) for key, (default, converter) in \ defaultParams.iteritems() ]) - + def __setitem__(self, key, val): try: if key in _deprecated_map.keys(): @@ -620,7 +620,7 @@ ret['datapath'] = get_data_path() verbose.report('loaded rc file %s'%fname) - + return ret Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -39,7 +39,7 @@ key = val optional comment val should be valid python syntax, just as you would use when setting - properties using rcParams. This should become more obvious by inspecting + properties using rcParams. This should become more obvious by inspecting the default values listed herein. Colors: for the color values below, you can either use @@ -50,7 +50,7 @@ - a legal html color name, eg red, blue, darkslategray Interactivity: see http://matplotlib.sourceforge.net/interactive.html. - + ### CONFIGURATION BEGINS HERE ### """ @@ -61,15 +61,15 @@ numerix = T.Trait('numpy', 'numpy', 'numeric', 'numarray') maskedarray = T.false units = T.false - + class backend(TConfig): """Valid backends are: 'GTKAgg', 'GTKCairo', 'QtAgg', 'Qt4Agg', 'TkAgg', 'Agg', 'Cairo', 'PS', 'PDF', 'SVG'""" use = T.Trait('TkAgg', mplT.BackendHandler()) - + class cairo(TConfig): format = T.Trait('png', 'png', 'ps', 'pdf', 'svg') - + class tk(TConfig): """ window_focus : Maintain shell focus for TkAgg @@ -78,7 +78,7 @@ window_focus = T.false pythoninspect = T.false - + class ps(TConfig): papersize = T.Trait('letter', 'auto', 'letter', 'legal', 'ledger', 'A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', @@ -87,22 +87,22 @@ 'B8', 'B9', 'B10') useafm = T.false fonttype = T.Trait(3, 42) - + class distiller(TConfig): use = T.Trait(None, None, 'ghostscript', 'xpdf', False) resolution = T.Float(6000) - + class pdf(TConfig): compression = T.Range(0, 9, 6) fonttype = T.Trait(3, 42) inheritcolor = T.false use14corefonts = T.false - + class svg(TConfig): image_inline = T.true image_noscale = T.false embed_chars = T.true - + class lines(TConfig): linewidth = T.Float(1.0) linestyle = T.Trait('-','--','-.', ':', 'steps', '', ' ', None) @@ -122,10 +122,10 @@ linewidth = T.Float(1.0) facecolor = T.Trait('blue', mplT.ColorHandler()) edgecolor = T.Trait('black', mplT.ColorHandler()) - antialiased = T.true + antialiased = T.true class font(TConfig): - family = T.Trait('sans-serif', 'sans-serif', 'serif', 'cursive', + family = T.Trait('sans-serif', 'sans-serif', 'serif', 'cursive', 'fantasy', 'monospace') style = T.Trait('normal', 'normal', 'italic', 'oblique') variant = T.Trait('normal', 'normal', 'small-caps') @@ -136,16 +136,16 @@ 'expanded', 'extra-expanded', 'ultra-expanded', 'wider', 'narrower') size = T.Float(12.0) - serif = T.ListStr(["Bitstream Vera Serif", "New Century Schoolbook", - "Century Schoolbook L", "Utopia", "ITC Bookman", "Bookman", - "Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino", + serif = T.ListStr(["Bitstream Vera Serif", "New Century Schoolbook", + "Century Schoolbook L", "Utopia", "ITC Bookman", "Bookman", + "Nimbus Roman No9 L", "Times New Roman", "Times", "Palatino", "Charter", "serif"]) - sans_serif = T.ListStr(["Bitstream Vera Sans", "Lucida Grande", "Verdana", - "Geneva", "Lucid", "Arial", "Helvetica", "Avant Garde", + sans_serif = T.ListStr(["Bitstream Vera Sans", "Lucida Grande", "Verdana", + "Geneva", "Lucid", "Arial", "Helvetica", "Avant Garde", "sans-serif"]) - cursive = T.ListStr(["Apple Chancery", "Textile", "Zapf Chancery", "Sand", + cursive = T.ListStr(["Apple Chancery", "Textile", "Zapf Chancery", "Sand", "cursive"]) - fantasy = T.ListStr(["Comic Sans MS", "Chicago", "Charcoal", "Impact", "Western", + fantasy = T.ListStr(["Comic Sans MS", "Chicago", "Charcoal", "Impact", "Western", "fantasy"]) monospace = T.ListStr(["Bitstream Vera Sans Mono", "Andale Mono", "Nimbus Mono L", "Courier New", "Courier", "Fixed", "Terminal", "monospace"]) @@ -153,12 +153,12 @@ class text(TConfig): color = T.Trait('black',mplT.ColorHandler()) usetex = T.false - + class latex(TConfig): unicode = T.false preamble = T.ListStr([]) dvipnghack = T.false - + class mathtext(TConfig): cal = T.Trait('cursive' , mplT.FontconfigPatternHandler()) rm = T.Trait('serif' , mplT.FontconfigPatternHandler()) @@ -182,16 +182,16 @@ 'large', 'x-large', 'xx-large', T.Float) labelcolor = T.Trait('black', mplT.ColorHandler()) axisbelow = T.false - + class formatter(TConfig): limits = T.List(T.Float, [-7, 7], minlen=2, maxlen=2) - + class xticks(TConfig): color = T.Trait('black', mplT.ColorHandler()) labelsize = T.Trait('small', 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', T.Float) direction = T.Trait('in', 'out') - + class major(TConfig): size = T.Float(4) pad = T.Float(4) @@ -205,7 +205,7 @@ labelsize = T.Trait('small', 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', T.Float) direction = T.Trait('in', 'out') - + class major(TConfig): size = T.Float(4) pad = T.Float(4) @@ -220,8 +220,8 @@ linewidth = T.Float(0.5) class legend(TConfig): - loc = T.Trait('upper right', 'best', 'upper right', 'upper left', - 'lower left', 'lower right', 'right', 'center left', + loc = T.Trait('upper right', 'best', 'upper right', 'upper left', + 'lower left', 'lower right', 'right', 'center left', 'center right', 'lower center', 'upper center', 'center') isaxes = T.true numpoints = T.Int(3) @@ -264,26 +264,26 @@ class contour(TConfig): negative_linestyle = T.Trait('dashed', 'dashed', 'solid') - + class savefig(TConfig): dpi = T.Float(100) facecolor = T.Trait('white', mplT.ColorHandler()) edgecolor = T.Trait('white', mplT.ColorHandler()) orientation = T.Trait('portrait', 'portrait', 'landscape') - + class verbose(TConfig): level = T.Trait('silent', 'silent', 'helpful', 'debug', 'debug-annoying') fileo = T.Trait('sys.stdout', 'sys.stdout', T.File) class RcParamsWrapper(dict): - + """A backwards-compatible interface to a traited config object """ - + def __init__(self, tconfig): self.tconfig = tconfig - + self.tconfig_map = { 'backend' : (self.tconfig.backend, 'use'), 'numerix' : (self.tconfig, 'numerix'), @@ -337,7 +337,7 @@ 'text.latex.unicode' : (self.tconfig.text.latex, 'unicode'), 'text.latex.preamble' : (self.tconfig.text.latex, 'preamble'), 'text.dvipnghack' : (self.tconfig.text.latex, 'dvipnghack'), - + 'mathtext.cal' : (self.tconfig.mathtext, 'cal'), 'mathtext.rm' : (self.tconfig.mathtext, 'rm'), 'mathtext.tt' : (self.tconfig.mathtext, 'tt'), @@ -455,7 +455,7 @@ def keys(self): return self.tconfig_map.keys() - + def has_key(self, val): return self.tconfig_map.has_key(val) @@ -466,7 +466,7 @@ except AttributeError: for key, val in arg: self[key] = val - + for key in kwargs: self[key] = kwargs[key] Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -70,8 +70,8 @@ return fonttype validate_backend = ValidateInStrings('backend',[ - 'Agg2', 'Agg', 'Aqt', 'Cairo', 'CocoaAgg', 'EMF', 'GD', 'GDK', - 'GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'Paint', 'Pdf', 'PS', + 'Agg2', 'Agg', 'Aqt', 'Cairo', 'CocoaAgg', 'EMF', 'GDK', + 'GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'Pdf', 'PS', 'QtAgg', 'Qt4Agg', 'SVG', 'Template', 'TkAgg', 'WX', 'WXAgg', ], ignorecase=True) @@ -143,7 +143,7 @@ if len(s)==6 and s.isalnum(): # looks like hex return '#' + s - + if len(s)==7 and s.startswith('#') and s[1:].isalnum(): return s @@ -198,11 +198,11 @@ return float(s) except ValueError: raise ValueError('not a valid font size') - + def validate_font_properties(s): parse_fontconfig_pattern(s) return s - + validate_verbose = ValidateInStrings('verbose',[ 'silent', 'helpful', 'debug', 'debug-annoying', ]) @@ -367,7 +367,7 @@ 'mathtext.sf' : ['sans\-serif', validate_font_properties], 'mathtext.use_cm' : [True, validate_bool], 'mathtext.fallback_to_cm' : [True, validate_bool], - + 'image.aspect' : ['equal', validate_aspect], # equal, auto, a number 'image.interpolation' : ['bilinear', str], 'image.cmap' : ['jet', str], # one of gray, jet, etc Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -1937,7 +1937,7 @@ return npy.max(npy.sum(npy.absolute((npy.transpose(x))), axis=0)) elif y=='fro': xx = npy.dot(x.transpose(), x) - return npy.sqrt(asum(npy.diag(xx), axis=0)) + return npy.sqrt(npy.sum(npy.diag(xx), axis=0)) else: raise ValueError('Second argument not permitted for matrices') Modified: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlib.conf 2007-09-09 22:41:36 UTC (rev 3819) @@ -3,32 +3,32 @@ # This is a sample matplotlib configuration file. It should be placed # in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and # C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# +# # By default, the installer will overwrite the existing file in the install # path, so if you want to preserve yours, please move it to your HOME dir and # set the environment variable if necessary. -# +# # This file is best viewed in a editor which supports ini or conf mode syntax # highlighting. -# +# # Blank lines, or lines starting with a comment symbol, are ignored, # as are trailing comments. Other lines must have the format -# +# # key = val optional comment -# +# # val should be valid python syntax, just as you would use when setting -# properties using rcParams. This should become more obvious by inspecting +# properties using rcParams. This should become more obvious by inspecting # the default values listed herein. -# +# # Colors: for the color values below, you can either use # - a matplotlib color string, such as r, k, or b # - an rgb tuple, such as (1.0, 0.5, 0.0) # - a hex string, such as #ff00ff or ff00ff # - a scalar grayscale intensity such as 0.75 # - a legal html color name, eg red, blue, darkslategray -# +# # Interactivity: see http://matplotlib.sourceforge.net/interactive.html. -# +# # ### CONFIGURATION BEGINS HERE ### # a value of type 'str' @@ -42,7 +42,7 @@ # 'Africa/Abidjan' or 'Africa/Accra' or 'Africa/Addis_Ababa' or 'Africa/Algiers' # or 'Africa/Asmara' or 'Africa/Asmera' or 'Africa/Bamako' or 'Africa/Bangui' o # r 'Africa/Banjul' or 'Africa/Bissau' or 'Africa/Blantyre' or 'Africa/Brazzavil -# <...snipped 10590 chars...> +# <...snipped 10590 chars...> # or 'Turkey' or 'UCT' or 'US/Alaska' or 'US/Aleutian' or 'US/Arizona' or 'US/Ce # ntral' or 'US/East-Indiana' or 'US/Eastern' or 'US/Hawaii' or 'US/Indiana-Star # ke' or 'US/Michigan' or 'US/Mountain' or 'US/Pacific' or 'US/Pacific-New' or ' @@ -72,14 +72,14 @@ # name like 'orange', a hex color like '#efefef', a grayscale intensity # like '0.5', or an RGBA tuple (1,0,0,1) labelcolor = 'black' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'medium' # a value of type 'float' linewidth = 1.0 # one of 0, on, false, 1, no, n, y, off, yes, true polargrid = True - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' titlesize = 'large' @@ -191,7 +191,7 @@ serif = ['Bitstream Vera Serif', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif'] # a value of type 'float' size = 12.0 - # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' + # 'ultra-condensed' or 'extra-condensed' or 'condensed' or 'semi-condensed' # or 'normal' or 'semi-expanded' or 'expanded' or 'extra-expanded' or 'ultra # -expanded' or 'wider' or 'narrower' stretch = 'normal' @@ -218,11 +218,11 @@ aspect = 'equal' # 'Accent' or 'Accent_r' or 'Blues' or 'Blues_r' or 'BrBG' or 'BrBG_r' or 'B # uGn' or 'BuGn_r' or 'BuPu' or 'BuPu_r' or 'Dark2' or 'Dark2_r' or 'GnBu' o - # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or - # <...snipped 1010 chars...> - # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or + # r 'GnBu_r' or 'Greens' or 'Greens_r' or 'Greys' or 'Greys_r' or 'OrRd' or + # <...snipped 1010 chars...> + # ist_stern' or 'gist_stern_r' or 'gist_yarg' or 'gist_yarg_r' or 'gray' or # 'gray_r' or 'hot' or 'hot_r' or 'hsv' or 'hsv_r' or 'jet' or 'jet_r' or 'p - # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or + # ink' or 'pink_r' or 'prism' or 'prism_r' or 'spectral' or 'spectral_r' or # 'spring' or 'spring_r' or 'summer' or 'summer_r' or 'winter' or 'winter_r' cmap = 'jet' # 'bilinear' or 'nearest' or 'bicubic' or 'spline16' or 'spline36' or 'hanni @@ -237,7 +237,7 @@ [legend] # a value of type 'float' axespad = 0.02 - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' fontsize = 'medium' # a value of type 'float' @@ -362,7 +362,7 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'small' @@ -385,7 +385,7 @@ color = 'black' # 'in' or 'out' direction = 'in' - # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' + # a value of type 'float' or 'xx-small' or 'x-small' or 'small' or 'medium' # or 'large' or 'x-large' or 'xx-large' labelsize = 'small' @@ -399,4 +399,4 @@ # a value of type 'float' pad = 4.0 # a value of type 'float' - size = 2.0 \ No newline at end of file + size = 2.0 Modified: trunk/matplotlib/lib/matplotlib/pylab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pylab.py 2007-09-09 00:41:17 UTC (rev 3818) +++ trunk/matplotlib/lib/matplotlib/pylab.py 2007-09-09 22:41:36 UTC (rev 3819) @@ -124,7 +124,7 @@ fliplr - flip the rows of a matrix up/down flipud - flip the columns of a matrix left/right linspace - a linear spaced vector of N values from min to max inclusive - logspace - a log spaced vector of N values from min to max inclusive + logspace - a log spaced vector of N values from min to max inclusive meshgrid - repeat x and y to make regular matrices ones - an array of ones rand - an array from the uniform distribution [0,1] @@ -198,54 +198,21 @@ exception of those in mlab.py provided by matplotlib. """ import sys, warnings -import cm -import _pylab_helpers -import mlab #so I can override hist, psd, etc... -from axes import Axes, PolarAxes -import backends from cbook import flatten, is_string_like, exception_to_str, popd, \ silent_list, iterable, enumerate, dedent -from colors import Normalize, normalize # latter for backwards compat. -from cm import get_cmap -from figure import Figure, figaspect -import image -from matplotlib import rcParams, rcParamsDefault, get_backend -from backend_bases import FigureCanvasBase -from artist import getp, get -from artist import setp as _setp +import matplotlib.numerix as nx +import numpy as npy +from matplotlib import mpl # pulls in most modules -import matplotlib.cbook as cbook -from matplotlib.mlab import csv2rec - -# a hack to keep old versions of ipython working with mpl after bug -# fix #1209354 -if 'IPython.Shell' in sys.modules: - from backends import new_figure_manager, draw_if_interactive, show -else: - from backends import pylab_setup - new_figure_manager, draw_if_interactive, show = pylab_setup() - - - -from image import imread as _imread -from lines import Line2D -from text import Text, Annotation -from patches import Polygon, Rectangle, Circle, Arrow -from transforms import blend_xy_sep_transform -from widgets import SubplotTool, Button, Slider, Widget - -import numerix as nx - -import numpy as npy -from matplotlib import mpl # catch more than an import error here, since the src could fail too, # eg a bad pytz install. I don't want to break all of matplotlib for # date support try: - from dates import date2num, num2date, datestr2num, strpdate2num, drange,\ + from matplotlib.dates import date2num, num2date,\ + datestr2num, strpdate2num, drange,\ epoch2num, num2epoch, mx2num,\ DateFormatter, IndexDateFormatter, DateLocator,\ RRuleLocator, YearLocator, MonthLocator, WeekdayLocator,\ @@ -256,24 +223,16 @@ __dates_all__ = [] pass else: - import dates - __dates_all__ = dates.__all__ + import matplotlib.dates + __dates_all__ = matplotlib.dates.__all__ -from ticker import TickHelper, Formatter, FixedFormatter, NullFormatter,\ - FuncFormatter, FormatStrFormatter, ScalarFormatter,\ - LogFormatter, LogFormatterExponent, LogFormatterMathtext,\ - Locator, IndexLocator, FixedLocator, NullLocator,\ - LinearLocator, LogLocator, AutoLocator, MultipleLocator,\ - MaxNLocator -import ticker -import matplotlib # bring all the symbols in so folks can import them from # pylab in one fell swoop -from numerix import array, zeros, shape, rank, size, fromstring,\ +from numpy.oldnumeric import array, zeros, shape, rank, size, fromstring,\ take, put, putmask, reshape, repeat, choose, searchsorted,\ - asum, cumsum, product, cumproduct, alltrue, sometrue, allclose,\ + cumsum, product, cumproduct, alltrue, sometrue, allclose,\ arrayrange, arange, asarray, convolve, swapaxes, concatenate,\ transpose, sort, argsort, argmax, argmin, innerproduct, dot,\ outerproduct, resize, indices, fromfunction, diagonal, trace,\ @@ -287,28 +246,32 @@ cosh, arccosh, arcsinh, arctanh, cross_correlate,\ pi, ArrayType, matrixmultiply -from numerix import Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32,\ +from numpy.oldnumeric import sum as asum + +from numpy.oldnumeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, Float32,\ Float64, Complex32, Complex64, Float, Int, Complex -from matplotlib.numerix.fft import fft -from matplotlib.numerix.linear_algebra import inverse, eigenvectors +from numpy.fft import fft # Why just fft? +from numpy.linalg import inv as inverse +from numpy.oldnumeric.linear_algebra import eigenvectors + # not quite the same as linalg.eig -#from matplotlib.numerix.mlab import rand,randn,eye,tri,diag,fliplr,flipud,rot90,tril,triu,ptp,mean,msort,median,std,cumsum,prod,cumprod,trapz,diff,cov,corrcoef,squeeze,kaiser,blackman,bartlett,hanning,hamming,sinc,eig,svd,angle,roots,amin, amax pymin, pymax = min, max -from matplotlib.numerix.mlab import * +from numpy.oldnumeric.mlab import * min, max = pymin, pymax +from numpy import amin, amax from matplotlib.mlab import window_hanning, window_none,\ conv, detrend, detrend_mean, detrend_none, detrend_linear,\ - corrcoef, polyfit, polyval, vander, entropy, normpdf,\ + polyfit, polyval, entropy, normpdf,\ levypdf, find, trapz, prepca, fix, rem, norm, orth, rank,\ sqrtm, prctile, center_matrix, rk4, exp_safe, amap,\ sum_flat, mean_flat, rms_flat, l1norm, l2norm, norm, frange,\ diagonal_matrix, base_repr, binary_repr, log2, ispower2,\ bivariate_normal, load, save, stineman_interp -from numpy import meshgrid, linspace, logspace +from numpy import meshgrid, linspace, logspace, corrcoef, vander """ problem syms @@ -326,2283 +289,7 @@ sign """ +from matplotlib.pyplot import * -from colorbar import colorbar_doc -def colorbar(mappable = None, cax=None,**kw): - if mappable is None: - mappable = gci() - ret = gcf().colorbar(mappable, cax = cax, **kw) - draw_if_interactive() - return ret -colorbar.__doc__ = colorbar_doc -def colors(): - """ - This is a do nothing function to provide you with help on how - matplotlib handles colors. - - Commands which take color arguments can use several formats to - specify the colors. For the basic builtin colors, you can use a - single letter - - b : blue - g : green - r : red - c : cyan - m : magenta - y : yellow - k : black - w : white - - - For a greater range of colors, you have two options. You can - specify the color using an html hex string, as in - - color = '#eeefff' - - or you can pass an R,G,B tuple, where each of R,G,B are in the - range [0,1]. - - You can also use any legal html name for a color, like 'red', - 'burlywood' and 'chartreuse' - - The example below creates a subplot with a dark - slate gray background - - subplot(111, axisbg=(0.1843, 0.3098, 0.3098)) - - Here is an example that creates a pale turqoise title - - title('Is this the best color?', color='#afeeee') - - """ - pass - -def plotting(): - """ - Plotting commands - axes - Create a new axes - axis - Set or return the current axis limits - bar - make a bar chart - boxplot - make a box and whiskers chart - cla - clear current axes - clabel - label a contour plot - clf - clear a figure window - close - close a figure window - colorbar - add a colorbar to the current figure - cohere - make a plot of coherence - contour - make a contour plot - contourf - make a filled contour plot - csd - make a plot of cross spectral density - draw - force a redraw of the current figure - errorbar - make an errorbar graph - figlegend - add a legend to the figure - figimage - add an image to the figure, w/o resampling - figtext - add text in figure coords - figure - create or change active figure - fill - make filled polygons - gca - return the current axes - gcf - return the current figure - gci - get the current image, or None - get - get a handle graphics property - hist - make a histogram - hold - set the hold state on current axes - legend - add a legend to the axes - loglog - a log log plot - imread - load image file into array - imshow - plot image data - matshow - display a matrix in a new figure preserving aspect - pcolor - make a pseudocolor plot - plot - make a line plot - psd - make a plot of power spectral density - quiver - make a direction field (arrows) plot - rc - control the default params - savefig - save the current figure - scatter - make a scatter plot - set - set a handle graphics property - semilogx - log x axis - semilogy - log y axis - show - show the figures - specgram - a spectrogram plot - stem - make a stem plot - subplot - make a subplot (numrows, numcols, axesnum) - table - add a table to the axes - text - add some text at location x,y to the current axes - title - add a title to the current axes - xlabel - add an xlabel to the current axes - ylabel - add a ylabel to the current axes - - autumn - set the default colormap to autumn - bone - set the default colormap to bone - cool - set the default colormap to cool - copper - set the default colormap to copper - flag - set the default colormap to flag - gray - set the default colormap to gray - hot - set the default colormap to hot - hsv - set the default colormap to hsv - jet - set the default colormap to jet - pink - set the default colormap to pink - prism - set the default colormap to prism - spring - set the default colormap to spring - summer - set the default colormap to summer - winter - set the default colormap to winter - spectral - set the default colormap to spectral - - """ - pass - -def colormaps(): - """ - matplotlib provides the following colormaps. - - autumn bone cool copper flag gray hot hsv jet pink prism - spring summer winter spectral - - You can set the colormap for an image, pcolor, scatter, etc, - either as a keyword argumentdef con - - >>> imshow(X, cmap=cm.hot) - - or post-hoc using the corresponding pylab interface function - - >>> imshow(X) - >>> hot() - >>> jet() - - In interactive mode, this will update the colormap allowing you to - see which one works best for your data. - """ - pass - - - -def get_current_fig_manager(): - figManager = _pylab_helpers.Gcf.get_active() - if figManager is None: - gcf() # creates an active figure as a side effect - figManager = _pylab_helpers.Gcf.get_active() - return figManager - - -# note we check for __doc__ is not None since py2exe optimize removes -# the docstrings -def connect(s, func): - return get_current_fig_manager().canvas.mpl_connect(s, func) -if FigureCanvasBase.mpl_connect.__doc__ is not None: - connect.__doc__ = dedent(FigureCanvasBase.mpl_connect.__doc__) - -def disconnect(cid): - return get_current_fig_manager().canvas.mpl_disconnect(cid) -if FigureCanvasBase.mpl_disconnect.__doc__ is not None: - disconnect.__doc__ = dedent(FigureCanvasBase.mpl_disconnect.__doc__) - -def get_plot_commands(): return ( 'axes', 'axis', 'bar', 'boxplot', 'cla', 'clf', - 'close', 'colorbar', 'cohere', 'csd', 'draw', 'errorbar', - 'figlegend', 'figtext', 'figimage', 'figure', 'fill', 'gca', - 'gcf', 'gci', 'get', 'gray', 'barh', 'jet', 'hist', 'hold', 'imread', - 'imshow', 'legend', 'loglog', 'quiver', 'rc', 'pcolor', 'pcolormesh', 'plot', 'psd', - 'savefig', 'scatter', 'set', 'semilogx', 'semilogy', 'show', - 'specgram', 'stem', 'subplot', 'table', 'text', 'title', 'xlabel', - 'ylabel', 'pie', 'polar') - -def raise_msg_to_str(msg): - """msg is a return arg from a raise. Join with new lines""" - if not is_string_like(msg): - msg = '\n'.join(map(str, msg)) - return msg - - -#----- Now we get started with the matlab(TM) commands ----# - - - -def axis(*v, **kwargs): - """ - Set/Get the axis properties:: - - v = axis() returns the current axes as v = [xmin, xmax, ymin, ymax] - - axis(v) where v = [xmin, xmax, ymin, ymax] sets the min and max - of the x and y axes - - axis('off') turns off the axis lines and labels - - axis('equal') changes limits of x or y axis so that equal - increments of x and y have the same length; a circle - is circular. - - axis('scaled') achieves the same result by changing the - dimensions of the plot box instead of the axis data - limits. - - axis('tight') changes x and y axis limits such that all data is - shown. If all data is already shown, it will move it to the center - of the figure without modifying (xmax-xmin) or (ymax-ymin). Note - this is slightly different than in matlab. - - axis('image') is 'scaled' with the axis limits equal to the - data limits. - - axis('auto') or 'normal' (deprecated) restores default behavior; - axis limits are automatically scaled to make the data fit - comfortably within the plot box. - - if len(*v)==0, you can pass in xmin, xmax, ymin, ymax as kwargs - selectively to alter just those limits w/o changing the others. - See help(xlim) and help(ylim) for more information - - The xmin, xmax, ymin, ymax tuple is returned - - """ - ax = gca() - v = ax.axis(*v, **kwargs) - draw_if_interactive() - return v - - -def axes(*args, **kwargs): - """ - Add an axes at positon rect specified by:: - - axes() by itself creates a default full subplot(111) window axis - - axes(rect, axisbg='w') where rect=[left, bottom, width, height] in - normalized (0,1) units. axisbg is the background color for the - axis, default white - - axes(h) where h is an axes instance makes h the - current axis An Axes instance is returned - - kwargs: - - axisbg=color : the axes background color - frameon=False : don't display the frame - sharex=otherax : the current axes shares xaxis attribute with otherax - sharey=otherax : the current axes shares yaxis attribute with otherax - polar=True|False : use a polar axes or not - - Examples - - examples/axes_demo.py places custom axes. - examples/shared_axis_demo.py uses sharex and sharey - - - """ - - nargs = len(args) - if len(args)==0: return subplot(111, **kwargs) - if nargs>1: - raise TypeError('Only one non keyword arg to axes allowed') - arg = args[0] - - if isinstance(arg, Axes): - a = gcf().sca(arg) - else: - rect = arg - a = gcf().add_axes(rect, **kwargs) - draw_if_interactive() - return a - -def delaxes(*args): - """ - delaxes(ax) - remove ax from the current figure. If ax doesn't - exist an error will be raised. - - delaxes(): delete the current axes - """ - if not len(args): - ax = gca() - else: - ax = args[0] - ret = gcf().delaxes(ax) - draw_if_interactive() - return ret - - -def _get_target_images(target=None): - if target is None: - ax = gca() - all = ax.get_images() - - if not len(all): - raise RuntimeError('You must first define an image, eg with imshow') - - images = [all[-1]] - else: - if iterable(target): images = target - else: images = [target] - - return images - -def clim(vmin=None, vmax=None): - """ - Set the color limits of the current image - - To apply clim to all axes images do - - clim(0, 0.5) - - If either vmin or vmax is None, the image min/max respectively - will be used for color scaling. - - If you want to set the clim of multiple images, - use, for example for im in gca().get_images(): im.set_clim(0, - 0.05) - - """ - im = gci() - if im is None: - raise RuntimeError('You must first define an image, eg with imshow') - - im.set_clim(vmin, vmax) - draw_if_interactive() - -def close(*args): - """ - Close a figure window - - close() by itself closes the current figure - - close(num) closes figure number num - - close(h) where h is a figure handle(instance) closes that figure - - close('all') closes all the figure windows - """ - - if len(args)==0: - figManager = _pylab_helpers.Gcf.get_active() - if figManager is None: return - else: _pylab_helpers.Gcf.destroy(figManager.num) - elif len(args)==1: - arg = args[0] - if arg=='all': - for manager in _pylab_helpers.Gcf.get_all_fig_managers(): - _pylab_helpers.Gcf.destroy(manager.num) - elif isinstance(arg, int): - _pylab_helpers.Gcf.destroy(arg) - elif isinstance(arg, Figure): - for manager in _pylab_helpers.Gcf.get_all_fig_managers(): - if manager.canvas.figure==arg: - _pylab_helpers.Gcf.destroy(manager.num) - else: - raise TypeError('Unrecognized argument type %s to close'%type(arg)) - else: - raise TypeError('close takes 0 or 1 arguments') - - -def clf(): - """ - Clear the current figure - """ - gcf().clf() - draw_if_interactive() - - - -def draw(): - 'redraw the current figure' - get_current_fig_manager().canvas.draw() - -def figtext(*args, **kwargs): - - ret = gcf().text(*args, **kwargs) - draw_if_interactive() - return ret -if Figure.text.__doc__ is not None: - figtext.__doc__ = dedent(Figure.text.__doc__) - -def figimage(*args, **kwargs): - # allow callers to override the hold state by passing hold=True|False - ret = gcf().figimage(*args, **kwargs) - draw_if_interactive() - gci._current = ret - return ret -if Figure.figimage.__doc__ is not None: - figimage.__doc__ = dedent(Figure.figimage.__doc__) + """ -Addition kwargs: hold = [True|False] overrides default hold state""" - -def figlegend(handles, labels, loc, **kwargs): - """ - Place a legend in the figure. Labels are a sequence of - strings, handles is a sequence of line or patch instances, and - loc can be a string r an integer specifying the legend - location - - USAGE: - legend( (line1, line2, line3), - ('label1', 'label2', 'label3'), - 'upper right') - - See help(legend) for information about the location codes - - A matplotlib.legend.Legend instance is returned - """ - l= gcf().legend(handles, labels, loc, **kwargs) - draw_if_interactive() - return l - -def savefig(*args, **kwargs): - fig = gcf() - return fig.savefig(*args, **kwargs) -if Figure.savefig.__doc__ is not None: - savefig.__doc__ = dedent(Figure.savefig.__doc__) - - -def figure(num=None, # autoincrement if None, else integer from 1-N - figsize = None, # defaults to rc figure.figsize - dpi = None, # defaults to rc figure.dpi - facecolor = None, # defaults to rc figure.facecolor - edgecolor = None, # defaults to rc figure.edgecolor - frameon = True, - FigureClass = Figure, - **kwargs - ): - """ - figure(num = None, figsize=(8, 6), dpi=80, facecolor='w', edgecolor='k') - - - Create a new figure and return a handle to it. If num=None, the figure - number will be incremented and a new figure will be created. The returned - figure objects have a .number attribute holding this number. - - If num is an integer, and figure(num) already exists, make it - active and return the handle to it. If figure(num) does not exist - it will be created. Numbering starts at 1, matlab style - - figure(1) - - If you are creating many figures, make sure you explicitly call "close" - on the figures you are not using, because this will enable pylab - to properly clean up the memory. - - kwargs: - - figsize - width x height in inches; defaults to rc figure.figsize - dpi - resolution; defaults to rc figure.dpi - facecolor - the background color; defaults to rc figure.facecolor - edgecolor - the border color; defaults to rc figure.edgecolor - - rcParams gives the default values from the matplotlibrc file - - FigureClass is a Figure or derived class that will be passed on to - new_figure_manager in the backends which allows you to hook custom - Figureclasses into the pylab interface. Additional kwargs will be - passed on to your figure init function - """ - - if figsize is None : figsize = rcParams['figure.figsize'] - if dpi is None : dpi = rcParams['figure.dpi'] - if facecolor is None : facecolor = rcParams['figure.facecolor'] - if edgecolor is None : edgecolor = rcParams['figure.edgecolor'] - - if num is None: - allnums = [f.num for f in _pylab_helpers.Gcf.get_all_fig_managers()] - if allnums: - num = max(allnums) + 1 - else: - num = 1 - - figManager = _pylab_helpers.Gcf.get_fig_manager(num) - if figManager is None: - if get_backend()=='PS': dpi = 72 - - figManager = new_figure_manager(num, figsize=figsize, dpi=dpi, facecolor=facecolor, edgecolor=edgecolor, frameon=frameon, FigureClass=FigureClass, **kwargs) - _pylab_helpers.Gcf.set_active(figManager) - figManager.canvas.figure.number = num - - draw_if_interactive() - return figManager.canvas.figure - -def gca(**kwargs): - """ - Return the current axis instance. This can be used to control - axis properties either using set or the Axes methods. - - Example: - - plot(t,s) - set(gca(), 'xlim', [0,10]) # set the x axis limits - - or - - plot(t,s) - a = gca() - a.set_xlim([0,10]) # does the same - """ - - ax = gcf().gca(**kwargs) - return ax - -def gcf(): - "Return a handle to the current figure" - - figManager = _pylab_helpers.Gcf.get_active() - if figManager is not None: - return figManager.canvas.figure - else: - return figure() - -def gci(): - """ - get the current ScalarMappable instance (image or patch - collection), or None if no images or patch collections have been - defined. The commands imshow and figimage create images - instances, and the commands pcolor and scatter create patch - collection instances - """ - return gci._current -gci._current = None - - -def sci(im): - """ - Set the current image (the target of colormap commands like jet, hot or clim) - """ - gci._current = im - - -def hold(b=None): - """ - Set the hold state. If hold is None (default), toggle the - hold state. Else set the hold state to boolean value b. - - Eg - hold() # toggle hold - hold(True) # hold is on - hold(False) # hold is off - - When hold is True, subsequent plot commands will be added to the - current axes. When hold is False, the current axes and figure - will be cleared on the next plot command - """ - - gcf().hold(b) - gca().hold(b) - rc('axes', hold=b) - -def ishold(): - """ - Return the hold status of the current axes - """ - return gca().ishold() - -def isinteractive(): - """ - Return the interactive status - """ - return matplotlib.is_interactive() - -def imread(*args, **kwargs): - return _imread(*args, **kwargs) -if _imread.__doc__ is not None: - imread.__doc__ = dedent(_imread.__doc__) - - - - -def rc(*args, **kwargs): - matplotlib.rc(*args, **kwargs) -if matplotlib.rc.__doc__ is not None: - rc.__doc__ = dedent(matplotlib.rc.__doc__) - -def rcdefaults(): - matplotlib.rcdefaults() - draw_if_interactive() -if matplotlib.rcdefaults.__doc__ is not None: - rcdefaults.__doc__ = dedent(matplotlib.rcdefaults.__doc__) - - -def subplot(*args, **kwargs): - """ - Create a subplot command, creating axes with - - subplot(numRows, numCols, plotNum) - - where plotNum=1 is the first plot number and increasing plotNums - fill rows first. max(plotNum)==numRows*numCols - - You can leave out the commas if numRows<=numCols<=plotNum<10, as - in - - subplot(211) # 2 rows, 1 column, first (upper) plot - - subplot(111) is the default axis - - The background color of the subplot can be specified via keyword - argument 'axisbg', which takes a color string or gdk.Color as value, as in - - subplot(211, axisbg='y') - - See help(axes) for additional information on axes and subplot - keyword arguments. - - New subplots that overlap old will delete the old axes. If you do - not want this behavior, use fig.add_subplot or the axes command. Eg - - from pylab import * - plot([1,2,3]) # implicitly creates subplot(111) - subplot(211) # overlaps, subplot(111) is killed - plot(rand(12), rand(12)) - - """ - - - fig = gcf() - a = fig.add_subplot(*args, **kwargs) - bbox = a.bbox - byebye = [] - for other in fig.axes: - if other==a: continue - if bbox.overlaps(other.bbox, ignoreend=True): - byebye.append(other) - for ax in byebye: delaxes(ax) - - draw_if_interactive() - return a - - -def twinx(ax=None): - """ - Make a second axes overlay ax (or the current axes if ax is None) - sharing the xaxis. The ticks for ax2 will be placed on the right, - and the ax2 instance is returned. See examples/two_scales.py - """ - if ax is None: - ax=gca() - - - ax2 = gcf().add_axes(ax.get_position(), sharex=ax, frameon=False) - ax2.yaxis.tick_right() - ax2.yaxis.set_label_position('right') - ax.yaxis.tick_left() - draw_if_interactive() - return ax2 - - -def twiny(ax=None): - """ - Make a second axes overlay ax (or the current axes if ax is None) - sharing the yaxis. The ticks for ax2 will be placed on the top, - and the ax2 instance is returned. - """ - if ax is None: - ax=gca() - - - ax2 = gcf().add_axes(ax.get_position(), sharey=ax, frameon=False) - ax2.xaxis.tick_top() - ax2.xaxis.set_label_position('top') - ax.xaxis.tick_bottom() - draw_if_interactive() - return ax2 - -def title(s, *args, **kwargs): - """ - Set the title of the current axis to s - - Default font override is: - override = { - 'fontsize' : 'medium', - 'verticalalignment' : 'bottom', - 'horizontalalignment' : 'center' - } - - See the text docstring for information of how override and the - optional args work - - """ - l = gca().set_title(s, *args, **kwargs) - draw_if_interactive() - return l - - - -def xlabel(s, *args, **kwargs): - """ - Set the x axis label of the current axis to s - - Default override is - - override = { - 'fontsize' : 'small', - 'verticalalignment' : 'top', - 'horizontalalignment' : 'center' - } - - See the text docstring for information of how override and - the optional args work - - """ - l = gca().set_xlabel(s, *args, **kwargs) - draw_if_interactive() - return l - -def ylabel(s, *args, **kwargs): - """ - Set the y axis label of the current axis to s - - Defaults override is - - override = { - 'fontsize' : 'small', - 'verticalalignment' : 'center', - 'horizontalalignment' : 'right', - 'rotation'='vertical' : } - - See the text docstring for information of how override and the - optional args work - - """ - l = gca().set_ylabel(s, *args, **kwargs) - draw_if_interactive() - return l - - - - - -def xlim(*args, **kwargs): - """ - Set/Get the xlimits of the current axes - - xmin, xmax = xlim() : return the current xlim - xlim( (xmin, xmax) ) : set the xlim to xmin, xmax - xlim( xmin, xmax ) : set the xlim to xmin, xmax - - If you do not specify args, you can pass the xmin and xmax as - kwargs, eg - - xlim(xmax=3) # adjust the max leaving min unchanged - xlim(xmin=1) # adjust the min leaving max unchanged - - The new axis limits are returned as a length 2 tuple - - """ - ax = gca() - ret = ax.set_xlim(*args, **kwargs) - draw_if_interactive() - return ret - - -def ylim(*args, **kwargs): - """ - Set/Get the ylimits of the current axes - - ymin, ymax = ylim() : return the current ylim - ylim( (ymin, ymax) ) : set the ylim to ymin, ymax - ylim( ymin, ymax ) : set the ylim to ymin, ymax - - If you do not specify args, you can pass the ymin and ymax as - kwargs, eg - - ylim(ymax=3) # adjust the max leaving min unchanged - ylim(ymin=1) # adjust the min leaving max unchanged - - The new axis limits are returned as a length 2 tuple - - """ - ax = gca() - ret = ax.set_ylim(*args, **kwargs) - draw_if_interactive() - return ret - - - - -def xticks(*args, **kwargs): - """ - Set/Get the xlimits of the current ticklocs, labels - - # return locs, labels where locs is an array of tick locations and - # labels is an array of tick labels. - locs, labels = xticks() - - # set the locations of the xticks - xticks( arange(6) ) - - # set the locations and labels of the xticks - xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') ) - - The keyword args, if any, are text properties; see text for more - information on text properties. - """ - ax = gca() - - if len(args)==0: - locs = ax.get_xticks() - labels = ax.get_xticklabels() - elif len(args)==1: - locs = ax.set_xticks(args[0]) - labels = ax.get_xticklabels() - elif len(args)==2: - locs = ax.set_xticks(args[0]) - labels = ax.set_xticklabels(args[1], **kwargs) - else: raise TypeError('Illegal number of arguments to xticks') - if len(kwargs): - for l in labels: - l.update(kwargs) - - draw_if_interactive() - return locs, silent_list('Text xticklabel', labels) - - - -def rgrids(*args, **kwargs): - """ - Set/Get the radial locations of the gridlines and ticklabels - - With no args, simply return lines, labels where lines is an - array of radial gridlines (Line2D instances) and labels is an - array of tick labels (Text instances). - - lines, labels = rgrids() - - With arguments, the syntax is - - lines, labels = RGRIDS(radii, labels=None, angle=22.5, **kwargs) - - The labels will appear at radial distances radii at angle - - labels, if not None, is a len(radii) list of strings of the - labels to use at each angle. - - if labels is None, the self.rformatter will be used - - Return value is a list of lines, labels where the lines are - matplotlib.Line2D instances and the labels are matplotlib.Text - instances. Note that on input the labels argument is a list of - strings, and on output it is a list of Text instances - - Examples - # set the locations of the radial gridlines and labels - lines, labels = rgrids( (0.25, 0.5, 1.0) ) - - # set the locations and labels of the radial gridlines and labels - lines, labels = rgrids( (0.25, 0.5, 1.0), ('Tom', 'Dick', 'Harry' ) - - """ - ax = gca() - if not isinstance(ax, PolarAxes): - raise RuntimeError('rgrids only defined for polar axes') - if len(args)==0: - lines = ax.rgridlines() - labels = ax.rgridlabels() - else: - lines, labels = ax.set_rgrids(*args, **kwargs) - - draw_if_interactive() - return ( silent_list('Line2D rgridline', lines), - silent_list('Text rgridlabel', labels) ) - -def thetagrids(*args, **kwargs): - """ - Set/Get the theta locations of the gridlines and ticklabels - - If no arguments are passed, return lines, labels where lines is an - array of radial gridlines (Line2D instances) and labels is an - array of tick labels (Text instances). - - lines, labels = thetagrids() - - Otherwise the syntax is - - lines, labels = THETAGRIDS(angles, labels=None, fmt='%d', frac = 1.1) - - set the angles at which to place the theta grids (these gridlines - are equal along the theta dimension). angles is in degrees - - labels, if not None, is a len(angles) list of strings of the - labels to use at each angle. - - if labels is None, the labels with be fmt%angle - - frac is the fraction of the polar axes radius at which to place - the label (1 is the edge).Eg 1.05 isd outside the axes and 0.95 - is inside the axes - - Return value is a list of lines, labels where the lines are - matplotlib.Line2D instances and the labels are matplotlib.Text - instances. Note that on input the labels argument is a list of - strings, and on output it is a list of Text instances - - Examples: - - # set the locations of the radial gridlines and labels - lines, labels = thetagrids( range(45,360,90) ) - - # set the locations and labels of the radial gridlines and labels - lines, labels = thetagrids( range(45,360,90), ('NE', 'NW', 'SW','SE') ) - """ - ax = gca() - if not isinstance(ax, PolarAxes): - raise RuntimeError('rgrids only defined for polar axes') - if len(args)==0: - lines = ax.thetagridlines() - labels = ax.thetagridlabels() - else: - lines, labels = ax.set_thetagrids(*args, **kwargs) - - draw_if_interactive() - return (silent_list('Line2D thetagridline', lines), - silent_list('Text thetagridlabel', labels) - ) - -def yticks(*args, **kwargs): - """ - Set/Get the ylimits of the current ticklocs, labels - - # return locs, labels where locs is an array of tick locations and - # labels is an array of tick labels. - locs, labels = yticks() - - # set the locations of the yticks - yticks( arange(6) ) - - # set the locations and labels of the yticks - yticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') ) - - The keyword args, if any, are text properties; see text for more - information on text properties. - """ - ax = gca() - - if len(args)==0: - locs = ax.get_yticks() - labels = ax.get_yticklabels() - elif len(args)==1: - locs = ax.set_yticks(args[0]) - labels = ax.get_yticklabels() - elif len(args)==2: - locs = ax.set_yticks(args[0]) - labels = ax.set_yticklabels(args[1], **kwargs) - else: raise TypeError('Illegal number of arguments to yticks') - if len(kwargs): - for l in labels: - l.update(kwargs) - - draw_if_interactive() - - return ( locs, - silent_list('Text yticklabel', labels) - ) - -def polar(*args, **kwargs): - """ - POLAR(theta, r) - - Make a polar plot. Multiple theta, r arguments are supported, - with format strings, as in plot. - """ - ax = gca(polar=True) - ret = ax.plot(*args, **kwargs) - draw_if_interactive() - return ret - -def over(func, *args, **kwargs): - """ - Call func(*args, **kwargs) with hold(True) and then restore the hold state - """ - h = ishold() - hold(True) - func(*args, **kwargs) - hold(h) - -def ioff(): - 'turn interactive mode off' - matplotlib.interactive(False) - -def ion(): - 'turn interactive mode on' - matplotlib.interactive(True) - -def switch_backend(newbackend): - """ - Swtich the default backend to newbackend. This feature is - EXPERIMENTAL, and is only expected to work switching to an image - backend. Eg, if you have a bunch of PS scripts that you want to - run from an interactive ipython session, yuo may want to switch to - the PS backend before running them to avoid having a bunch of GUI - windows popup. If you try to interactively switch from one GUI - backend to another, you will explode. - - Calling this command will close all open windows. - """ - close('all') - global new_figure_manager, draw_if_interactive, show - matplotlib.use(newbackend) - reload(backends) - from backends import new_figure_manager, draw_if_interactive, show - -def matshow(A, fignum=None, **kw): - """Display an array as a matrix in a new figure window. - - The origin is set at the upper left hand corner and rows (first dimension - of the array) are displayed horizontally. The aspect ratio of the figure - window is that of the array, unless this would make an excessively - short or narrow figure. - - Tick labels for the xaxis are placed on top. - - With one exception, keyword arguments are passed to - imshow(). - - Special keyword argument which is NOT passed to imshow(): - - - fignum(None): by default, matshow() creates a new figure window with - automatic numbering. If ... [truncated message content] |
From: <ef...@us...> - 2007-09-09 00:41:21
|
Revision: 3818 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3818&view=rev Author: efiring Date: 2007-09-08 17:41:17 -0700 (Sat, 08 Sep 2007) Log Message: ----------- Removed matplotlibrc; it is generated by setup.py. Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc Deleted: trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc =================================================================== --- trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc 2007-09-08 23:53:06 UTC (rev 3817) +++ trunk/matplotlib/lib/matplotlib/mpl-data/matplotlibrc 2007-09-09 00:41:17 UTC (rev 3818) @@ -1,315 +0,0 @@ -### MATPLOTLIBRC FORMAT - -# This is a sample matplotlib configuration file. It should be placed -# in HOME/.matplotlib/matplotlibrc (unix/linux like systems) and -# C:\Documents and Settings\yourname\.matplotlib (win32 systems) -# -# By default, the installer will overwrite the existing file in the -# install path, so if you want to preserve your's, please move it to -# your HOME dir and set the environment variable if necessary. -# -# This file is best viewed in a editor which supports python mode -# syntax highlighting -# -# Blank lines, or lines starting with a comment symbol, are ignored, -# as are trailing comments. Other lines must have the format -# -# key : val # optional comment -# -# Colors: for the color values below, you can either use -# - a matplotlib color string, such as r, k, or b -# - an rgb tuple, such as (1.0, 0.5, 0.0) -# - a hex string, such as ff00ff (no '#' symbol) -# - a scalar grayscale intensity such as 0.75 -# - a legal html color name, eg red, blue, darkslategray - -#### CONFIGURATION BEGINS HERE -# the default backend; one of GTK GTKAgg GTKCairo FltkAgg QtAgg TkAgg -# Agg Cairo GD GDK Paint PS PDF SVG Template -backend : TkAgg -numerix : numpy # numpy, Numeric or numarray -#maskedarray : False # True to use external maskedarray module - # instead of numpy.ma; this is a temporary - # setting for testing maskedarray. -#interactive : False # see http://matplotlib.sourceforge.net/interactive.html -#toolbar : toolbar2 # None | classic | toolbar2 -#timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris - -# Where your matplotlib data lives if you installed to a non-default -# location. This is where the matplotlib fonts, bitmaps, etc reside -#datapath : /home/jdhunter/mpldata - - -### LINES -# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more -# information on line properties. -#lines.linewidth : 1.0 # line width in points -#lines.linestyle : - # solid line -#lines.color : blue -#lines.marker : None # the default marker -#lines.markeredgewidth : 0.5 # the line width around the marker symbol -#lines.markersize : 6 # markersize, in points -#lines.dash_joinstyle : miter # miter|round|bevel -#lines.dash_capstyle : butt # butt|round|projecting -#lines.solid_joinstyle : miter # miter|round|bevel -#lines.solid_capstyle : projecting # butt|round|projecting -#lines.antialiased : True # render lines in antialised (no jaggies) - -### PATCHES -# Patches are graphical objects that fill 2D space, like polygons or -# circles. See -# http://matplotlib.sourceforge.net/matplotlib.patches.html for more -# information on patch properties -#patch.linewidth : 1.0 # edge width in points -#patch.facecolor : blue -#patch.edgecolor : black -#patch.antialiased : True # render patches in antialised (no jaggies) - -### FONT -# -# font properties used by text.Text. See -# http://matplotlib.sourceforge.net/matplotlib.font_manager.html for more -# information on font properties. The 6 font properties used for font -# matching are given below with their default values. -# -# The font.family property has five values: 'serif' (e.g. Times), -# 'sans-serif' (e.g. Helvetica), 'cursive' (e.g. Zapf-Chancery), -# 'fantasy' (e.g. Western), and 'monospace' (e.g. Courier). Each of -# these font families has a default list of font names in decreasing -# order of priority associated with them. -# -# The font.style property has three values: normal (or roman), italic -# or oblique. The oblique style will be used for italic, if it is not -# present. -# -# The font.variant property has two values: normal or small-caps. For -# TrueType fonts, which are scalable fonts, small-caps is equivalent -# to using a font size of 'smaller', or about 83% of the current font -# size. -# -# The font.weight property has effectively 13 values: normal, bold, -# bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as -# 400, and bold is 700. bolder and lighter are relative values with -# respect to the current weight. -# -# The font.stretch property has 11 values: ultra-condensed, -# extra-condensed, condensed, semi-condensed, normal, semi-expanded, -# expanded, extra-expanded, ultra-expanded, wider, and narrower. This -# property is not currently implemented. -# -# The font.size property is the default font size for text, given in pts. -# 12pt is the standard value. -# -#font.family : sans-serif -#font.style : normal -#font.variant : normal -#font.weight : medium -#font.stretch : normal -# note that font.size controls default text sizes. To configure -# special text sizes tick labels, axes, labels, title, etc, see the rc -# settings for axes and ticks. Special text sizes can be defined -# relative to font.size, using the following values: xx-small, x-small, -# small, medium, large, x-large, xx-large, larger, or smaller -#font.size : 12.0 -#font.serif : Bitstream Vera Serif, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif -#font.sans-serif : Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif -#font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, cursive -#font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy -#font.monospace : Bitstream Vera Sans Mono, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace - -### TEXT -# text properties used by text.Text. See -# http://matplotlib.sourceforge.net/matplotlib.text.html for more -# information on text properties - -#text.color : black - -### LaTeX customizations. See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex -#text.usetex : False # use latex for all text handling. The following fonts - # are supported through the usual rc parameter settings: - # new century schoolbook, bookman, times, palatino, - # zapf chancery, charter, serif, sans-serif, helvetica, - # avant garde, courier, monospace, computer modern roman, - # computer modern sans serif, computer modern typewriter - # If another font is desired which can loaded using the - # LaTeX \usepackage command, please inquire at the - # matplotlib mailing list -#text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling - # unicode strings. -#text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES - # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP - # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. - # preamble is a comma separated list of LaTeX statements - # that are included in the LaTeX document preamble. - # An example: - # text.latex.preamble : \usepackage{bm},\usepackage{euler} - # The following packages are always loaded with usetex, so - # beware of package collisions: color, geometry, graphicx, - # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages - # may also be loaded, depending on your font settings -#text.dvipnghack : False # some versions of dvipng don't handle - # alpha channel properly. Use True to correct and flush - # ~/.matplotlib/tex.cache before testing -#text.markup : 'plain' # Affects how text, such as titles and labels, are - # interpreted by default. - # 'plain': As plain, unformatted text - # 'tex': As TeX-like text. Text between $'s will be - # formatted as a TeX math expression. - # This setting has no effect when text.usetex is True. - # In that case, all text will be sent to TeX for - # processing. - -# The following settings allow you to select the fonts in math mode. -# They map from a TeX font name to a set of arguments for the FontProperties constructor. -# (See FontProperties for more details). -# These settings are only used if mathtext.use_cm is False, otherwise, the -# Bakoma TeX Computer Modern fonts are used. -#mathtext.cal : cursive -#mathtext.rm : serif -#mathtext.tt : monospace -#mathtext.it : serif:italic -#mathtext.bf : serif:bold -#mathtext.sf : sans -#mathtext.use_cm : True -#mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern - # fonts when a symbol can not be found in one of - # the user-specified math fonts. - -### AXES -# default face and edge color, default tick sizes, -# default fontsizes for ticklabels, and so on. See -# http://matplotlib.sourceforge.net/matplotlib.axes.html#Axes -#axes.hold : True # whether to clear the axes by default on -#axes.facecolor : white # axes background color -#axes.edgecolor : black # axes edge color -#axes.linewidth : 1.0 # edge linewidth -#axes.grid : False # display grid or not -#axes.titlesize : 14 # fontsize of the axes title -#axes.labelsize : 12 # fontsize of the x any y labels -#axes.labelcolor : black -#axes.axisbelow : False # whether axis gridlines and ticks are below - # the axes elements (lines, text, etc) -#axes.formatter.limits : -7, 7 # use scientific notation if log10 - # of the axis range is smaller than the - # first or larger than the second - -#polaraxes.grid : True # display grid on polar axes - -### TICKS -# see http://matplotlib.sourceforge.net/matplotlib.axis.html#Ticks -#xtick.major.size : 4 # major tick size in points -#xtick.minor.size : 2 # minor tick size in points -#xtick.major.pad : 4 # distance to major tick label in points -#xtick.minor.pad : 4 # distance to the minor tick label in points -#xtick.color : k # color of the tick labels -#xtick.labelsize : 12 # fontsize of the tick labels -#xtick.direction : in # direction: in or out - -#ytick.major.size : 4 # major tick size in points -#ytick.minor.size : 2 # minor tick size in points -#ytick.major.pad : 4 # distance to major tick label in points -#ytick.minor.pad : 4 # distance to the minor tick label in points -#ytick.color : k # color of the tick labels -#ytick.labelsize : 12 # fontsize of the tick labels -#ytick.direction : in # direction: in or out - - -### GRIDS -#grid.color : black # grid color -#grid.linestyle : : # dotted -#grid.linewidth : 0.5 # in points - -### Legend -#legend.isaxes : True -#legend.numpoints : 2 # the number of points in the legend line -#legend.fontsize : 14 -#legend.pad : 0.2 # the fractional whitespace inside the legend border -#legend.markerscale : 1.0 # the relative size of legend markers vs. original -# the following dimensions are in axes coords -#legend.labelsep : 0.010 # the vertical space between the legend entries -#legend.handlelen : 0.05 # the length of the legend lines -#legend.handletextsep : 0.02 # the space between the legend line and legend text -#legend.axespad : 0.02 # the border between the axes and legend edge -#legend.shadow : False - -### FIGURE -# See http://matplotlib.sourceforge.net/matplotlib.figure.html#Figure -#figure.figsize : 8, 6 # figure size in inches -#figure.dpi : 80 # figure dots per inch -#figure.facecolor : 0.75 # figure facecolor; 0.75 is scalar gray -#figure.edgecolor : white # figure edgecolor - -# The figure subplot parameters. All dimensions are fraction of the -# figure width or height -#figure.subplot.left : 0.125 # the left side of the subplots of the figure -#figure.subplot.right : 0.9 # the right side of the subplots of the figure -#figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure -#figure.subplot.top : 0.9 # the top of the subplots of the figure -#figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots -#figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots - - -### IMAGES -#image.aspect : equal # equal | auto | a number -#image.interpolation : bilinear # see help(imshow) for options -#image.cmap : jet # gray | jet etc... -#image.lut : 256 # the size of the colormap lookup table -#image.origin : upper # lower | upper - - -### CONTOUR PLOTS -#contour.negative_linestyle : dashed # dashed | solid - -### SAVING FIGURES -# the default savefig params can be different for the GUI backends. -# Eg, you may want a higher resolution, or to make the figure -# background white -#savefig.dpi : 100 # figure dots per inch -#savefig.facecolor : white # figure facecolor when saving -#savefig.edgecolor : white # figure edgecolor when saving - -#cairo.format : png # png, ps, pdf, svg - -# tk backend params -#tk.window_focus : False # Maintain shell focus for TkAgg -#tk.pythoninspect : False # tk sets PYTHONINSEPCT - -# ps backend params -#ps.papersize : letter # auto, letter, legal, ledger, A0-A10, B0-B10 -#ps.useafm : False # use of afm fonts, results in small files -#ps.usedistiller : False # can be: None, ghostscript or xpdf - # Experimental: may produce smaller files. - # xpdf intended for production of publication quality files, - # but requires ghostscript, xpdf and ps2eps -#ps.distiller.res : 6000 # dpi -#ps.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) - -# pdf backend params -#pdf.compression : 6 # integer from 0 to 9 - # 0 disables compression (good for debugging) -#pdf.fonttype : 3 # Output Type 3 (Type3) or Type 42 (TrueType) - -# svg backend params -#svg.image_inline : True # write raster image data directly into the svg file -#svg.image_noscale : False # suppress scaling of raster data embedded in SVG -#svg.embed_chars : False # embed character outlines in the SVG file - -# Set the verbose flags. This controls how much information -# matplotlib gives you at runtime and where it goes. The verbosity -# levels are: silent, helpful, debug, debug-annoying. Any level is -# inclusive of all the levels below it. If you setting is debug, -# you'll get all the debug and helpful messages. When submitting -# problems to the mailing-list, please set verbose to helpful or debug -# and paste the output into your report. -# -# The fileo gives the destination for any calls to verbose.report. -# These objects can a filename, or a filehandle like sys.stdout. -# -# You can override the rc default verbosity from the command line by -# giving the flags --verbose-LEVEL where LEVEL is one of the legal -# levels, eg --verbose-helpful. -# -# You can access the verbose instance in your code -# from matplotlib import verbose. -#verbose.level : silent # one of silent, helpful, debug, debug-annoying -#verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2007-09-08 23:53:16
|
Revision: 3817 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3817&view=rev Author: efiring Date: 2007-09-08 16:53:06 -0700 (Sat, 08 Sep 2007) Log Message: ----------- Delete gd and paint backends. Modified Paths: -------------- trunk/matplotlib/API_CHANGES trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/backends/__init__.py trunk/matplotlib/setupext.py Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/backends/backend_gd.py trunk/matplotlib/lib/matplotlib/backends/backend_paint.py Modified: trunk/matplotlib/API_CHANGES =================================================================== --- trunk/matplotlib/API_CHANGES 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/API_CHANGES 2007-09-08 23:53:06 UTC (rev 3817) @@ -1,3 +1,5 @@ + The gd and paint backends have been deleted. + The errorbar method and function now accept additional kwargs so that upper and lower limits can be indicated by capping the bar with a caret instead of a straight line segment. Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/CHANGELOG 2007-09-08 23:53:06 UTC (rev 3817) @@ -1,3 +1,5 @@ +2007-09-08 Eliminated gd and paint backends - EF + 2007-09-06 .bmp file format is now longer an alias for .raw 2007-09-07 Added clip path support to pdf backend. - JKS @@ -7,7 +9,7 @@ 2007-09-06 Refactored image saving code so that all GUI backends can save most image types. See FILETYPES for a matrix of - backends and their supported file types. + backends and their supported file types. Backend canvases should no longer write their own print_figure() method -- instead they should write a print_xxx method for each filetype they can output and add an entry to their @@ -16,7 +18,7 @@ 2007-09-05 Fixed Qt version reporting in setupext.py - DSD 2007-09-04 Embedding Type 1 fonts in PDF, and thus usetex support - via dviread, sort of works. To test, enable it by + via dviread, sort of works. To test, enable it by renaming _draw_tex to draw_tex. - JKS 2007-09-03 Added ability of errorbar show limits via caret or Modified: trunk/matplotlib/lib/matplotlib/backends/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/__init__.py 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/lib/matplotlib/backends/__init__.py 2007-09-08 23:53:06 UTC (rev 3817) @@ -7,7 +7,7 @@ interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg', 'TkAgg', 'WX', 'WXAgg', 'CocoaAgg', 'Aqt'] -non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GD', 'GDK', 'Paint', +non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GDK', 'Pdf', 'PS', 'SVG', 'Template'] all_backends = interactive_bk + non_interactive_bk Deleted: trunk/matplotlib/lib/matplotlib/backends/backend_gd.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gd.py 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gd.py 2007-09-08 23:53:06 UTC (rev 3817) @@ -1,374 +0,0 @@ -""" -A gd backend http://newcenturycomputers.net/projects/gdmodule.html -""" - - -from __future__ import division -import sys, os, math, warnings - -import numpy as npy - -try: - import gd -except ImportError: - print >>sys.stderr, 'You must first install the gd module http://newcenturycomputers.net/projects/gdmodule.html' - sys.exit() - -from matplotlib.backend_bases import RendererBase, \ - GraphicsContextBase, FigureManagerBase, FigureCanvasBase -from matplotlib import verbose -from matplotlib._pylab_helpers import Gcf -from matplotlib.cbook import enumerate, pieces, is_string_like -from matplotlib.colors import colorConverter -from matplotlib.figure import Figure -from matplotlib.transforms import Bbox -from matplotlib.font_manager import findfont -# support old font names -if (os.environ.has_key('GDFONTPATH') and not - os.environ.has_key('TTFPATH')): - os.environ['TTFPATH'] = os.environ['GDFONTPATH'] - - - - -PIXELS_PER_INCH = 96 # constant GD uses for screen DPI - - -def round(x): - return int(math.floor(x+0.5)) - - -class RendererGD(RendererBase): - """ - The renderer handles all the drawing primitives using a graphics - context instance that controls the colors/styles - """ - - - # todo: can gd support cap and join styles? - def __init__(self, im, dpi): - "Initialize the renderer with a gd image instance" - self.im = im - self._cached = {} # a map from get_color args to colors - - self.width, self.height = im.size() - self.dpi = dpi - - - def get_canvas_width_height(self): - 'return the canvas width and height in display coords' - return self.width, self.height - - def get_text_width_height_descent(self, s, prop, ismath): - """ - get the width and height in display coords of the string s - with fontsize in points - """ - - size = prop.get_size_in_points() - font = findfont(prop) - - scale = self.get_text_scale() - try: - llx, lly, lrx, lry, urx, ury, ulx, uly = \ - self.im.get_bounding_rect( - font, scale*size, 0.0, (0,0), s) - except ValueError: - raise RuntimeError('Could not load font %s. Try setting TTFFONTPATH to include this font' % fontname) - - w = abs(lrx - llx) - h = abs(lly - uly) - return w, h, h - - - def flipy(self): - 'return true if y small numbers are top for renderer' - return True - - - def draw_arc(self, gc, rgbFace, x, y, width, height, angle1, angle2, rotation): - """ - Draw an arc centered at x,y with width and height and angles - from 0.0 to 360.0 - """ - - center = int(x), self.height-int(y) - wh = int(width), int(height) - a1, a2 = int(angle1), int(angle2) - if rgbFace is not None: - color = self.get_gd_color( rgbFace ) - self.im.filledEllipse( - center, wh, color) - color = self.get_gd_color( gc.get_rgb() ) - self.im.arc(center, wh, a1, a2, color) - self.flush_clip() - - def draw_line(self, gc, x1, y1, x2, y2): - """ - Draw a single line from x1,y1 to x2,y2 - """ - self.draw_lines(gc, npy.array([x1, x2]), npy.array([y1, y2])) - - def draw_lines(self, gc, x, y): - """ - x and y are equal length arrays, draw lines connecting each - point in x, y - """ - - x = x.astype(npy.int16) - y = self.height*npy.ones(y.shape, npy.int16) - y.astype(npy.int16) - style = self._set_gd_style(gc) - self.im.lines( zip(x,y), style) - self.flush_clip() - - def draw_point(self, gc, x, y): - """ - Draw a single point at x,y - """ - self.im.setPixel((int(x),self.height-int(y)), - self.get_gd_color( gc.get_rgb() )) - self.flush_clip() - - - - def draw_polygon(self, gc, rgbFace, points): - """ - Draw a polygon. points is a len vertices tuple, each element - giving the x,y coords a vertex - """ - - edgecolor = self.get_gd_color( gc.get_rgb() ) - - points = [(int(x), self.height-int(y)) for x,y in points] - - - if rgbFace is not None: - facecolor = self.get_gd_color( rgbFace ) - self.im.filledPolygon(points, facecolor) - else: facecolor = None - if edgecolor != facecolor: - self.im.polygon(points, edgecolor) - self.flush_clip() - - def draw_rectangle(self, gc, rgbFace, x, y, width, height): - """ - Draw a rectangle at lower left x,y with width and height - If filled=True, fill the rectangle with the gc foreground - gc is a GraphicsContext instance - """ - - lb = int(x), self.height-int(y) - ur = int(x+width), self.height-int((y+height)) - edgecolor = self.get_gd_color( gc.get_rgb() ) - - if rgbFace is not None: - facecolor = self.get_gd_color( rgbFace ) - self.im.filledRectangle(ur, lb, facecolor) - else: facecolor = None - - if edgecolor != facecolor: - self.im.rectangle(ur, lb, edgecolor) - self.flush_clip() - - def draw_text(self, gc, x, y, s, prop, angle, ismath): - """ - Render the text using the RendererGD instance - """ - - size = prop.get_size_in_points() - font = findfont(prop) - - x = int(x) - y = int(y) - - color = self.get_gd_color( gc.get_rgb() ) - - angle *= math.pi/180.0 - - scale = self.get_text_scale() - self.im.string_ft(font, scale*size, angle, - (x, y), s, color) - self.flush_clip() - - def finish(self): - pass - #self.im.writePng( file('xx.png', 'w') ) - - - def flush_clip(self): - imw, imh = self.im.size() - lb = 0, 0 - ur = imw, imh - self.im.setClip(ur, lb) - - - def get_gd_color(self, rgb): - """ - RGB is a unit RGB tuple, return a gd color - """ - - r,g,b = rgb - rgbi = (int(r*255),int(g*255),int(b*255)) - - try: return self._cached[rgbi] - except KeyError: pass - - color = self.im.colorAllocate( rgbi ) - - if color==-1: - warnings.warn('Unable to allocate color %1.3f, %1.3f, %1.3f; using nearest neighbor' % rgb) - color = self.im.colorClosest(rgbi) - - self._cached[rgbi] = color - return color - - - - - def get_text_scale(self): - """ - Return the scale factor for fontsize taking screendpi and pixels per - inch into account - """ - return self.dpi.get()/PIXELS_PER_INCH - - def new_gc(self): - """ - Return an instance of a GraphicsContextGD - """ - return GraphicsContextGD( self.im, self ) - - def _set_gd_style(self, gc): - color = self.get_gd_color( gc.get_rgb() ) - offset, dashes = gc.get_dashes() - - if dashes is not None: - pixels = self.points_to_pixels(dashes) - style = [] - for on, off in pieces(pixels): - if on<1: on = 1 - else: on = round(on) - if off<1: off = 1 - else: off = round(off) - - style.extend([color]*on) - style.extend([gd.gdTransparent]*off) - self.im.setStyle(style) - return gd.gdStyled - else: - if gc.get_antialiased(): - self.im.setAntiAliased(color) - return gd.gdAntiAliased - else: - self.im.setStyle([color]) - return gd.gdStyled - - - def points_to_pixels(self, points): - """ - convert point measures to pixes using dpi and the pixels per - inch of the display - """ - return npy.asarray(points)*(PIXELS_PER_INCH/72.0*self.dpi.get()/72.0) - - -class GraphicsContextGD(GraphicsContextBase): - """ - The graphics context provides the color, line styles, etc... See - the gtk and postscript backends for examples of mapping the - graphics context attributes (cap styles, join styles, line widths, - colors) to a particular backend. """ - def __init__(self, im, renderer): - """ - Initialize with a gd image - """ - GraphicsContextBase.__init__(self) - self.im = im - self.renderer = renderer - - - def set_clip_rectangle(self, rectangle): - GraphicsContextBase.set_clip_rectangle(self, rectangle) - x,y,w,h = rectangle - imw, imh = self.im.size() - lb = int(x), imh-int(y) - ur = int(x+w), imh-int(y+h) - self.im.setClip(ur, lb) - - def set_linestyle(self, style): - GraphicsContextBase.set_linestyle(self, style) - offset, dashes = self.dashd[style] - self.set_dashes(offset, dashes) - - def set_linewidth(self, lw): - GraphicsContextBase.set_linewidth(self, lw) - pixels = self.renderer.points_to_pixels(lw) - if pixels<1: pixels = 1 - else: pixels = round(pixels) - self.im.setThickness(pixels) - -######################################################################## -# -# The following functions and classes are for matlab compatibility -# mode (pylab) and implement figure managers, etc... -# -######################################################################## - - -def new_figure_manager(num, *args, **kwargs): - """ - Add a new figure num (default autoincrement). For GUI - backends, you'll need to instantiate a new window and embed - the figure in it. - """ - FigureClass = kwargs.pop('FigureClass', Figure) - thisFig = FigureClass(*args, **kwargs) - canvas = FigureCanvasGD(thisFig) - manager = FigureManagerGD(canvas, num) - return manager - - -class FigureCanvasGD(FigureCanvasBase): - filetypes = {'PNG': 'Portable Network Graphics'} - - def print_png(self, filename, *args, **kwargs): - im = self.draw() - im.writePng(filename) - - def get_default_filetype(self): - return 'png' - - def draw(self): - """ - Draw to a gd image and return the image instance - - """ - - left, bottom, width, height = self.figure.bbox.get_bounds() - im = gd.image((int(width), int(height))) - - if not hasattr(im, 'setAntiAliased'): - raise RuntimeError('gd_requirements_failed') - renderer = RendererGD(im, self.figure.dpi) - self.figure.draw(renderer) - renderer.finish() - - return im - -class FigureManagerGD(FigureManagerBase): - """ - This class manages all the figures for matlab mode - """ - pass - - - -######################################################################## -# -# Now just provide the standard names that backend.__init__ is expecting -# -######################################################################## - -FigureManager = FigureManagerGD - - Deleted: trunk/matplotlib/lib/matplotlib/backends/backend_paint.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_paint.py 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/lib/matplotlib/backends/backend_paint.py 2007-09-08 23:53:06 UTC (rev 3817) @@ -1,281 +0,0 @@ -""" -This ia a paint (libart) backend - -You can select it as a backend with - - import matplotlib - matplotlib.use('Paint') - -REQUIREMENTS - - backend_paint requires pypaint-0.??, which in turn requires - libart and freetype1 -""" - -from __future__ import division -import sys -import os -import paint - -import numpy as npy - -from matplotlib import verbose - -from matplotlib._pylab_helpers import Gcf -from matplotlib.backend_bases import RendererBase,\ - GraphicsContextBase, FigureCanvasBase, FigureManagerBase -from matplotlib.cbook import enumerate -from matplotlib.figure import Figure -from matplotlib.text import Text, _process_text_args - -from matplotlib.font_manager import findfont - -""" - - * added dpi instance to renderer so drawing could scale with dpi - - * added dash path - JDH - - * reversed the order of fill and stroke for rectangle, arc and - polygon so edge color would be visible - - * adjusted circle centers - -""" - - - - - -#paint/font.c defined dpi as 96 -PIXELS_PER_INCH = 96 # a constant used to scale text with dpi - - -class RendererPaint(RendererBase): - """ - The renderer handles all the drawing primitives using a graphics - context instance that controls the colors/styles - """ - - fontd = {} # cache paint font instances - - def __init__(self, width, height, dpi): - """creates a new image""" - w, h = int(width), int(height) - self.image = paint.image(w, h) - self.width, self.height = w, h - self.dpi = dpi # for scaling dashes, linewidths - - def get_canvas_width_height(self): - 'return the canvas width and height in display coords' - return self.width, self.height - - def get_text_width_height(self, s, prop, ismath): - """ - get the width and height in display coords of the string s - with fontsize in points - """ - font = self._get_paint_font(s, prop, 0.0) - return font.textsize(s) - - def flipy(self): - 'return true if y small numbers are top for renderer' - return True - - - def get_text_scale(self): - """ - Return the scale factor for fontsize taking screendpi and pixels per - inch into account - """ - return self.dpi.get()/PIXELS_PER_INCH - - - - def draw_text(self, gc, x, y, s, prop, angle, ismath): - """ - Render the text using the RendererPaint instance - """ - font = self._get_paint_font(s, prop, angle) - - text_color = self.get_paint_color(gc.get_rgb()) - self.image.text(font, x, y, text_color, s) - - def _get_paint_font(self, s, prop, angle): - """ - Get the paint font for text instance t, cacheing for efficiency - """ - - fname = findfont(prop) - size = self.get_text_scale() * prop.get_size_in_points() - - props = fname, size, angle - - font = self.fontd.get(props) - if font is None: - font = paint.font(*props) - self.fontd[props] = font - return font - - def get_paint_color(self, rgb): - """returns a paint color object based on the given rgb tuple""" - r,g,b = rgb - return paint.rgb(int(r*255),int(g*255),int(b*255)) - - def draw_arc(self, gcEdge, rgbFace, x, y, width, height, angle1, angle2, rotation): - """ - Draw an arc centered at x,y with width and height and angles - from 0.0 to 360.0. - - If rgbFace is not None, fill the rectangle with it. gcEdge - is a GraphicsContext instance - """ - arc = paint.arc(x-0.5*width, self.height - (y-0.5*height), - x+0.5*width, self.height - (y+0.5*height), - angle1, angle2) - if rgbFace: - self.image.fill(arc, self.get_paint_color(rgbFace)) - self.image.stroke(arc, self.get_paint_color(gcEdge.get_rgb()), - self.points_to_pixels(gcEdge.get_linewidth())) - - - def draw_line(self, gc, x1, y1, x2, y2): - """ - Draw a single line from x1,y1 to x2,y2 - """ - path = paint.line(x1, self.height - y1, x2, self.height - y2) - path = self.dash_path(gc, path) - self.image.stroke(path, \ - self.get_paint_color(gc.get_rgb()), - self.points_to_pixels(gc.get_linewidth())) - - - def dash_path(self, gc, path): - """ - Add dashes to the path and return it if dashes are set - """ - offset, dashes = gc.get_dashes() - if dashes is not None: - - dashes = tuple(self.points_to_pixels(npy.asarray(dashes))) - return path.dash(offset, dashes) - else: - return path - - def draw_lines(self, gc, x, y): - """ - x and y are equal length arrays, draw lines connecting each - point in x, y - """ - assert(len(x)==len(y)) - # faster as a list comp - - path = [(paint.MOVETO, x[0], self.height-y[0])] - path.extend( [ (paint.LINETO, x[i], self.height-y[i]) for i in range(1, len(x))]) - - path = self.dash_path(gc, paint.make_path(path)) - self.image.stroke(path, - self.get_paint_color(gc.get_rgb()), - self.points_to_pixels(gc.get_linewidth())) - - - def draw_polygon(self, gcEdge, rgbFace, points): - """ - Draw a polygon. points is a len vertices tuple, each element - giving the x,y coords a vertex. - - If rgbFace is not None, fill the rectangle with it. gcEdge - is a GraphicsContext instance - """ - x = [p[0] for p in points] - y = [p[1] for p in points] - path = [(paint.MOVETO, x[0], self.height - y[0])] - for i in range(len(x)-1): - path.append((paint.LINETO, x[i+1], self.height - y[i+1])) - path.append((paint.LINETO, x[0], self.height - y[0])) - path = paint.make_path(path) - - if rgbFace: - self.image.fill(path, self.get_paint_color(rgbFace)) - self.image.stroke(path, - self.get_paint_color(gcEdge.get_rgb()), - self.points_to_pixels(gcEdge.get_linewidth())) - def draw_rectangle(self, gcEdge, rgbFace, x, y, width, height): - """ - Draw a rectangle at lower left x,y with width and height. - - If rgbFace is not None, fill the rectangle with it. gcEdge - is a GraphicsContext instance - """ - path = paint.rect(x, self.height - y, x+width, self.height - (y+height)) - - if rgbFace: - self.image.fill(path, self.get_paint_color(rgbFace)) - self.image.stroke(path, - self.get_paint_color(gcEdge.get_rgb()), - self.points_to_pixels(gcEdge.get_linewidth())) - - def draw_point(self, gc, x, y): - """ - Draw a single point at x,y - """ - self.image.stroke( - paint.line(x, self.height - y, x, self.height - y), - self.get_paint_color(gc.get_rgb()), - self.points_to_pixels(gc.get_linewidth())) - - def points_to_pixels(self, points): - return points*(PIXELS_PER_INCH/72.0*self.dpi.get()/72.0) - - - -class FigureCanvasPaint(FigureCanvasBase): - - def draw(self): - """ - Render the figure using RendererPaint instance renderer - """ - t1,t2,width,height = self.figure.bbox.get_bounds() - renderer = RendererPaint(width,height, self.figure.dpi) - self.figure.draw(renderer) - return renderer - - filetypes = {'png': 'Portable Network Graphics'} - - def print_png(self, filename, *args, **kwargs): - renderer = self.draw() - renderer.image.write_png(filename) - - def get_default_filetype(self): - return 'png' - -######################################################################## -# -# The following functions and classes are for matlab compatibility -# mode (pylab) and implement window/figure managers, -# etc... -# -######################################################################## - - -def new_figure_manager_paint(num, *args, **kwargs): - """ - Add a new figure num (default autoincrement). For GUI - backends, you'll need to instantiate a new window and embed - the figure in it. - """ - FigureClass = kwargs.pop('FigureClass', Figure) - thisFig = FigureClass(*args, **kwargs) - canvas = FigureCanvasPaint(thisFig) - manager = FigureManagerBase(canvas, num) - return manager - - -######################################################################## -# -# Now just provide the standard names that backend.__init__ is expecting -# -######################################################################## -new_figure_manager = new_figure_manager_paint - - Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2007-09-07 20:43:20 UTC (rev 3816) +++ trunk/matplotlib/setupext.py 2007-09-08 23:53:06 UTC (rev 3817) @@ -130,7 +130,7 @@ def print_line(*args, **kwargs): pass print_status = print_message = print_raw = print_line - + class CleanUpFile: """CleanUpFile deletes the specified filename when self is destroyed.""" def __init__(self, name): @@ -174,7 +174,7 @@ has_pkgconfig.cache = (status == 0) return has_pkgconfig.cache has_pkgconfig.cache = None - + def get_pkgconfig(module, packages, flags="--libs --cflags", @@ -189,7 +189,7 @@ '-l': 'libraries', '-D': 'define_macros', '-U': 'undef_macros'} - + status, output = commands.getstatusoutput( "%s %s %s" % (pkg_config_exec, flags, packages)) if status == 0: @@ -247,7 +247,7 @@ ", ".join(["'%s'" % x for x in module.include_dirs])) return True - + def check_for_libpng(): module = Extension("test", []) get_pkgconfig(module, 'libpng') @@ -260,7 +260,7 @@ ", ".join(["'%s'" % x for x in module.include_dirs])) return True - + def add_base_flags(module): incdirs = filter(os.path.exists, [os.path.join(p, 'include') for p in basedir[sys.platform] ]) @@ -318,7 +318,7 @@ return False else: print_status("Cairo", cairo.version) - + def check_for_numpy(): gotit = False try: @@ -357,16 +357,12 @@ # put these later for correct link order module.libraries.extend(std_libs) -def add_gd_flags(module): - 'Add the module flags to build extensions which use gd' - module.libraries.append('gd') - def add_ft2font_flags(module): 'Add the module flags to ft2font extension' if not get_pkgconfig(module, 'freetype2'): module.libraries.extend(['freetype', 'z']) add_base_flags(module) - + basedirs = module.include_dirs[:] # copy the list to avoid inf loop! for d in basedirs: module.include_dirs.append(os.path.join(d, 'freetype2')) @@ -381,7 +377,7 @@ if os.path.exists(p): module.library_dirs.append(p) else: add_base_flags(module) - + if sys.platform == 'win32' and win32_compiler == 'mingw32': module.libraries.append('gw32c') @@ -417,7 +413,7 @@ def ver2str(tup): return ".".join([str(x) for x in tup]) - + if gotit: import gobject if hasattr(gobject, 'pygobject_version'): @@ -432,7 +428,7 @@ if explanation is not None: print_message(explanation) - + return gotit def add_pygtk_flags(module): @@ -459,26 +455,26 @@ ]) add_base_flags(module) - + if not os.environ.has_key('PKG_CONFIG_PATH'): # If Gtk+ is installed, pkg-config is required to be installed os.environ['PKG_CONFIG_PATH'] = 'C:\GTK\lib\pkgconfig' - - pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split() - gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split() - includes = pygtkIncludes + gtkIncludes - module.include_dirs.extend([include[2:] for include in includes]) - - pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split() - gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split() + + pygtkIncludes = getoutput('pkg-config --cflags-only-I pygtk-2.0').split() + gtkIncludes = getoutput('pkg-config --cflags-only-I gtk+-2.0').split() + includes = pygtkIncludes + gtkIncludes + module.include_dirs.extend([include[2:] for include in includes]) + + pygtkLinker = getoutput('pkg-config --libs pygtk-2.0').split() + gtkLinker = getoutput('pkg-config --libs gtk+-2.0').split() linkerFlags = pygtkLinker + gtkLinker - + module.libraries.extend( [flag[2:] for flag in linkerFlags if flag.startswith('-l')]) - + module.library_dirs.extend( [flag[2:] for flag in linkerFlags if flag.startswith('-L')]) - + module.extra_link_args.extend( [flag for flag in linkerFlags if not (flag.startswith('-l') or flag.startswith('-L'))]) @@ -544,7 +540,7 @@ if explanation is not None: print_message(explanation) return gotit - + def find_wx_config(): """If the WX_CONFIG environment variable has been set, returns it value. Otherwise, search for `wx-config' in the PATH directories and return the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2007-09-07 20:43:22
|
Revision: 3816 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3816&view=rev Author: jouni Date: 2007-09-07 13:43:20 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Return widths of glyphs to caller Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/dviread.py Modified: trunk/matplotlib/lib/matplotlib/dviread.py =================================================================== --- trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-07 20:28:01 UTC (rev 3815) +++ trunk/matplotlib/lib/matplotlib/dviread.py 2007-09-07 20:43:20 UTC (rev 3816) @@ -8,7 +8,7 @@ dvi = Dvi(filename, 72) for text, boxes in dvi: # iterate over pages text, boxes = dvi.output(72) - for x,y,font,glyph in text: + for x,y,font,glyph,width in text: fontname, pointsize = dvi.fontinfo(font) ... for x,y,height,width in boxes: @@ -48,7 +48,7 @@ Iterate through the pages of the file. Returns (text, pages) pairs, where: - text is a list of (x, y, fontnum, glyphnum) tuples + text is a list of (x, y, fontnum, glyphnum, width) tuples boxes is a list of (x, y, height, width) tuples The coordinates are transformed into a standard Cartesian @@ -78,13 +78,14 @@ """ t0 = self.text[0] minx, miny, maxx, maxy = t0[0], t0[1], t0[0], t0[1] - for x,y,_,_ in self.text + self.boxes: + for elt in self.text + self.boxes: + x,y = elt[:2] if x < minx: minx = x if y < miny: miny = y if x > maxx: maxx = x if y > maxy: maxy = y d = self.dpi / (72.27 * 2**16) # from TeX's "scaled points" to dpi units - text = [ ((x-minx)*d, (maxy-y)*d, f, g) for (x,y,f,g) in self.text ] + text = [ ((x-minx)*d, (maxy-y)*d, f, g, w*d) for (x,y,f,g,w) in self.text ] boxes = [ ((x-minx)*d, (maxy-y)*d, h*d, w*d) for (x,y,h,w) in self.boxes ] return text, boxes @@ -219,14 +220,17 @@ # I think we can assume this is constant self.state = _dvistate.outer + def _width_of(self, char): + font = self.fonts[self.f] + width = font.tfm.width[char] + width = (width * font.scale) >> 20 + return width + def _set_char(self, char): if self.state != _dvistate.inpage: raise ValueError, "misplaced set_char in dvi file" self._put_char(char) - font = self.fonts[self.f] - width = font.tfm.width[char] - width = (width * font.scale) >> 20 - self.h += width + self.h += self._width_of(char) def _set_rule(self, a, b): if self.state != _dvistate.inpage: @@ -237,7 +241,7 @@ def _put_char(self, char): if self.state != _dvistate.inpage: raise ValueError, "misplaced put_char in dvi file" - self.text.append((self.h, self.v, self.f, char)) + self.text.append((self.h, self.v, self.f, char, self._width_of(char))) def _put_rule(self, a, b): if self.state != _dvistate.inpage: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-07 20:28:04
|
Revision: 3815 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3815&view=rev Author: mdboom Date: 2007-09-07 13:28:01 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Support characters composed of multiple characters. Only one supported at the moment is AA (angstrom). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-09-07 19:45:48 UTC (rev 3814) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-09-07 20:28:01 UTC (rev 3815) @@ -153,13 +153,6 @@ #################### -# a character over another character -charOverChars = { - # The first 2 entires in the tuple are (font, char, sizescale) for - # the two symbols under and over. The third entry is the space - # between the two symbols in points - r'\angstrom' : ( ('rm', 'A', 1.0), (None, '\circ', 0.5), 0.0 ), - } ############################################################################## # FONTS @@ -1771,7 +1764,7 @@ def Error(msg): def raise_error(s, loc, toks): - raise ParseFatalException(msg) + raise ParseFatalException(msg + "\n" + s) empty = Empty() empty.setParseAction(raise_error) @@ -1854,8 +1847,7 @@ bslash = Literal('\\') - accent = oneOf("hat check dot breve acute ddot grave tilde bar " - "vec \" ` ' ~ . ^ widehat widetilde") + accent = oneOf(self._accent_map.keys() + list(self._wide_accents)) function = oneOf("arccos csc ker min arcsin deg lg Pr arctan det " "lim sec arg dim liminf sin cos exp limsup sinh " @@ -1890,8 +1882,13 @@ ) ).setParseAction(self.symbol).leaveWhitespace() + c_over_c =(Suppress(bslash) + + oneOf(self._char_over_chars.keys()) + ).setParseAction(self.char_over_chars) + accent = Group( - Combine(bslash + accent) + Suppress(bslash) + + accent + placeable ).setParseAction(self.accent).setName("accent") @@ -1930,7 +1927,7 @@ Suppress(Literal("[")) + Group( OneOrMore( - symbol + (c_over_c | symbol) ^ font ) ) @@ -1942,7 +1939,7 @@ placeable <<(accent ^ function - ^ symbol + ^ (c_over_c | symbol) ^ group ^ frac ^ sqrt @@ -2120,25 +2117,69 @@ do_kern = False)] return [char] + _char_over_chars = { + # The first 2 entires in the tuple are (font, char, sizescale) for + # the two symbols under and over. The third element is the space + # (in multiples of underline height) + r'AA' : ( ('rm', 'A', 1.0), (None, '\circ', 0.5), 0.0), + } + + def char_over_chars(self, s, loc, toks): + sym = toks[0] + state = self.get_state() + thickness = state.font_output.get_underline_thickness( + state.font, state.fontsize, state.dpi) + + under_desc, over_desc, space = \ + self._char_over_chars.get(sym, (None, None, 0.0)) + if under_desc is None: + raise ParseFatalException("Error parsing symbol") + + over_state = state.copy() + if over_desc[0] is not None: + over_state.font = over_desc[0] + over_state.fontsize *= over_desc[2] + over = Accent(over_desc[1], over_state) + + under_state = state.copy() + if under_desc[0] is not None: + under_state.font = under_desc[0] + under_state.fontsize *= under_desc[2] + under = Char(under_desc[1], under_state) + + width = max(over.width, under.width) + + over_centered = HCentered([over]) + over_centered.hpack(width, 'exactly') + + under_centered = HCentered([under]) + under_centered.hpack(width, 'exactly') + + return Vlist([ + over_centered, + Vbox(0., thickness * space), + under_centered + ]) + _accent_map = { - r'\hat' : r'\circumflexaccent', - r'\breve' : r'\combiningbreve', - r'\bar' : r'\combiningoverline', - r'\grave' : r'\combininggraveaccent', - r'\acute' : r'\combiningacuteaccent', - r'\ddot' : r'\combiningdiaeresis', - r'\tilde' : r'\combiningtilde', - r'\dot' : r'\combiningdotabove', - r'\vec' : r'\combiningrightarrowabove', - r'\"' : r'\combiningdiaeresis', - r"\`" : r'\combininggraveaccent', - r"\'" : r'\combiningacuteaccent', - r'\~' : r'\combiningtilde', - r'\.' : r'\combiningdotabove', - r'\^' : r'\circumflexaccent' + r'hat' : r'\circumflexaccent', + r'breve' : r'\combiningbreve', + r'bar' : r'\combiningoverline', + r'grave' : r'\combininggraveaccent', + r'acute' : r'\combiningacuteaccent', + r'ddot' : r'\combiningdiaeresis', + r'tilde' : r'\combiningtilde', + r'dot' : r'\combiningdotabove', + r'vec' : r'\combiningrightarrowabove', + r'"' : r'\combiningdiaeresis', + r"`" : r'\combininggraveaccent', + r"'" : r'\combiningacuteaccent', + r'~' : r'\combiningtilde', + r'.' : r'\combiningdotabove', + r'^' : r'\circumflexaccent' } - _wide_accents = Set(r"\widehat \widetilde".split()) + _wide_accents = Set(r"widehat widetilde".split()) def accent(self, s, loc, toks): assert(len(toks)==1) @@ -2150,7 +2191,7 @@ accent, sym = toks[0] if accent in self._wide_accents: accent = AutoWidthChar( - accent, sym.width, state, char_class=Accent) + '\\' + accent, sym.width, state, char_class=Accent) else: accent = Accent(self._accent_map[accent], state) centered = HCentered([accent]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2007-09-07 19:45:51
|
Revision: 3814 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3814&view=rev Author: jouni Date: 2007-09-07 12:45:48 -0700 (Fri, 07 Sep 2007) Log Message: ----------- In backend_pdf usetex, gather consecutive characters with same x coordinate and same font into strings. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-07 18:53:51 UTC (rev 3813) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-09-07 19:45:48 UTC (rev 3814) @@ -1435,6 +1435,7 @@ dvifile = texmanager.make_dvi(s, fontsize) dvi = dviread.Dvi(dvifile, 72) text, boxes = iter(dvi).next() + dvi.close() if angle == 0: # avoid rounding errors in common case def mytrans(x1, y1): @@ -1444,10 +1445,10 @@ return x + cos(a)*x1 - sin(a)*y1, \ y + sin(a)*x1 + cos(a)*y1 - self.check_gc(gc, gc._rgb) - self.file.output(Op.begin_text) - oldfontnum, oldx, oldy = None, 0, 0 - for x1, y1, fontnum, glyph in text: + # Gather font information and do some setup for combining + # characters into strings. + oldfontnum, seq = None, [] + for x1, y1, fontnum, glyph, width in text: if fontnum != oldfontnum: texname, fontsize = dvi.fontinfo(fontnum) fontinfo = self.tex_font_mapping(texname) @@ -1455,14 +1456,50 @@ self.file.fontInfo[pdfname] = Bunch( encodingfile=fontinfo.encoding, afmfile=fontinfo.afm) - self.file.output(pdfname, fontsize, Op.selectfont) + seq += [['font', pdfname, fontsize]] oldfontnum = fontnum - x1, y1 = mytrans(x1, y1) - self._setup_textpos(x1, y1, angle, oldx, oldy) - self.file.output(chr(glyph), Op.show) - oldx, oldy = x1, y1 + seq += [['text', x1, y1, [chr(glyph)], x1+width]] + seq += [('end',)] + + # Find consecutive text strings with constant x coordinate and + # combine into one string (if needed kern would be less than + # 0.1 points) or several strings interspersed with kerns. + i, curx = 0, 0 + while i < len(seq)-1: + elt, next = seq[i:i+2] + if elt[0] == next[0] == 'text' and elt[2] == next[2]: + offset = elt[4] - next[1] + if abs(offset) < 0.1: + elt[3][-1] += next[3][0] + elt[4] += next[4]-next[1] + else: + elt[3] += [offset, next[3][0]] + elt[4] = next[4] + del seq[i+1] + continue + i += 1 + + # Now do the actual output. + self.check_gc(gc, gc._rgb) + self.file.output(Op.begin_text) + curx, cury, oldx, oldy = 0, 0, 0, 0 + for elt in seq: + if elt[0] == 'font': + self.file.output(elt[1], elt[2], Op.selectfont) + elif elt[0] == 'text': + curx, cury = mytrans(elt[1], elt[2]) + self._setup_textpos(curx, cury, angle, oldx, oldy) + oldx, oldy = curx, cury + if len(elt[3]) == 1: + self.file.output(elt[3][0], Op.show) + else: + self.file.output(elt[3], Op.showkern) + else: + assert elt[0] == 'end' self.file.output(Op.end_text) + # Finally output the boxes (used for the variable-length lines + # in square roots and the like). boxgc = self.new_gc() boxgc.copy_properties(gc) boxgc.set_linewidth(0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-07 18:53:59
|
Revision: 3813 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3813&view=rev Author: mdboom Date: 2007-09-07 11:53:51 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Merged revisions 3810-3812 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r3811 | mdboom | 2007-09-07 14:07:43 -0400 (Fri, 07 Sep 2007) | 2 lines Note that .bmp is no longer an alias for .raw ........ r3812 | mdboom | 2007-09-07 14:08:43 -0400 (Fri, 07 Sep 2007) | 2 lines Turn svg.embed_char_paths on by default. ........ Modified Paths: -------------- branches/transforms/CHANGELOG branches/transforms/lib/matplotlib/config/mplconfig.py branches/transforms/lib/matplotlib/config/rcsetup.py branches/transforms/lib/matplotlib/rcsetup.py branches/transforms/matplotlibrc.template Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-3809 + /trunk/matplotlib:1-3812 Modified: branches/transforms/CHANGELOG =================================================================== --- branches/transforms/CHANGELOG 2007-09-07 18:08:43 UTC (rev 3812) +++ branches/transforms/CHANGELOG 2007-09-07 18:53:51 UTC (rev 3813) @@ -1,3 +1,5 @@ +2007-09-06 .bmp file format is now longer an alias for .raw + 2007-09-07 Added clip path support to pdf backend. - JKS 2007-09-06 Fixed a bug in the embedding of Type 1 fonts in PDF. Modified: branches/transforms/lib/matplotlib/config/mplconfig.py =================================================================== --- branches/transforms/lib/matplotlib/config/mplconfig.py 2007-09-07 18:08:43 UTC (rev 3812) +++ branches/transforms/lib/matplotlib/config/mplconfig.py 2007-09-07 18:53:51 UTC (rev 3813) @@ -101,7 +101,7 @@ class svg(TConfig): image_inline = T.true image_noscale = T.false - embed_chars = T.false + embed_chars = T.true class lines(TConfig): linewidth = T.Float(1.0) Modified: branches/transforms/lib/matplotlib/config/rcsetup.py =================================================================== --- branches/transforms/lib/matplotlib/config/rcsetup.py 2007-09-07 18:08:43 UTC (rev 3812) +++ branches/transforms/lib/matplotlib/config/rcsetup.py 2007-09-07 18:53:51 UTC (rev 3813) @@ -466,7 +466,7 @@ 'pdf.fonttype' : [3, validate_fonttype], # 3 (Type3) or 42 (Truetype) 'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file 'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG - 'svg.embed_char_paths' : [False, validate_bool], # True to save all characters as paths in the SVG + 'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate } Modified: branches/transforms/lib/matplotlib/rcsetup.py =================================================================== --- branches/transforms/lib/matplotlib/rcsetup.py 2007-09-07 18:08:43 UTC (rev 3812) +++ branches/transforms/lib/matplotlib/rcsetup.py 2007-09-07 18:53:51 UTC (rev 3813) @@ -466,7 +466,7 @@ 'pdf.fonttype' : [3, validate_fonttype], # 3 (Type3) or 42 (Truetype) 'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file 'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG - 'svg.embed_char_paths' : [False, validate_bool], # True to save all characters as paths in the SVG + 'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate } Modified: branches/transforms/matplotlibrc.template =================================================================== --- branches/transforms/matplotlibrc.template 2007-09-07 18:08:43 UTC (rev 3812) +++ branches/transforms/matplotlibrc.template 2007-09-07 18:53:51 UTC (rev 3813) @@ -292,7 +292,7 @@ # svg backend params #svg.image_inline : True # write raster image data directly into the svg file #svg.image_noscale : False # suppress scaling of raster data embedded in SVG -#svg.embed_chars : False # embed character outlines in the SVG file +#svg.embed_chars : True # embed character outlines in the SVG file # Set the verbose flags. This controls how much information # matplotlib gives you at runtime and where it goes. The verbosity This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-09-07 18:08:44
|
Revision: 3812 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3812&view=rev Author: mdboom Date: 2007-09-07 11:08:43 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Turn svg.embed_char_paths on by default. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcsetup.py trunk/matplotlib/lib/matplotlib/rcsetup.py trunk/matplotlib/matplotlibrc.template Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-09-07 18:07:43 UTC (rev 3811) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2007-09-07 18:08:43 UTC (rev 3812) @@ -101,7 +101,7 @@ class svg(TConfig): image_inline = T.true image_noscale = T.false - embed_chars = T.false + embed_chars = T.true class lines(TConfig): linewidth = T.Float(1.0) Modified: trunk/matplotlib/lib/matplotlib/config/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2007-09-07 18:07:43 UTC (rev 3811) +++ trunk/matplotlib/lib/matplotlib/config/rcsetup.py 2007-09-07 18:08:43 UTC (rev 3812) @@ -466,7 +466,7 @@ 'pdf.fonttype' : [3, validate_fonttype], # 3 (Type3) or 42 (Truetype) 'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file 'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG - 'svg.embed_char_paths' : [False, validate_bool], # True to save all characters as paths in the SVG + 'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate } Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py =================================================================== --- trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-09-07 18:07:43 UTC (rev 3811) +++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-09-07 18:08:43 UTC (rev 3812) @@ -466,7 +466,7 @@ 'pdf.fonttype' : [3, validate_fonttype], # 3 (Type3) or 42 (Truetype) 'svg.image_inline' : [True, validate_bool], # write raster image data directly into the svg file 'svg.image_noscale' : [False, validate_bool], # suppress scaling of raster data embedded in SVG - 'svg.embed_char_paths' : [False, validate_bool], # True to save all characters as paths in the SVG + 'svg.embed_char_paths' : [True, validate_bool], # True to save all characters as paths in the SVG 'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate } Modified: trunk/matplotlib/matplotlibrc.template =================================================================== --- trunk/matplotlib/matplotlibrc.template 2007-09-07 18:07:43 UTC (rev 3811) +++ trunk/matplotlib/matplotlibrc.template 2007-09-07 18:08:43 UTC (rev 3812) @@ -292,7 +292,7 @@ # svg backend params #svg.image_inline : True # write raster image data directly into the svg file #svg.image_noscale : False # suppress scaling of raster data embedded in SVG -#svg.embed_chars : False # embed character outlines in the SVG file +#svg.embed_chars : True # embed character outlines in the SVG file # Set the verbose flags. This controls how much information # matplotlib gives you at runtime and where it goes. The verbosity This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |