Revision: 5151
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5151&view=rev
Author: jdh2358
Date: 2008-05-16 12:47:10 -0700 (Fri, 16 May 2008)
Log Message:
-----------
reorganized examples
Added Paths:
-----------
trunk/matplotlib/examples/animation/
trunk/matplotlib/examples/animation/animation_blit.py
trunk/matplotlib/examples/animation/animation_blit_fltk.py
trunk/matplotlib/examples/animation/animation_blit_qt.py
trunk/matplotlib/examples/animation/animation_blit_qt4.py
trunk/matplotlib/examples/animation/animation_blit_tk.py
trunk/matplotlib/examples/animation/animation_blit_wx.py
trunk/matplotlib/examples/animation/dynamic_collection.py
trunk/matplotlib/examples/animation/dynamic_demo_wx.py
trunk/matplotlib/examples/animation/dynamic_image_wxagg.py
trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py
trunk/matplotlib/examples/event_handling/
trunk/matplotlib/examples/event_handling/lasso_demo.py
trunk/matplotlib/examples/event_handling/pick_event_demo.py
trunk/matplotlib/examples/event_handling/zoom_window.py
trunk/matplotlib/examples/misc/
trunk/matplotlib/examples/misc/font_indexing.py
trunk/matplotlib/examples/misc/ftface_props.py
trunk/matplotlib/examples/misc/rc_traits.py
trunk/matplotlib/examples/misc/rec_groupby_demo.py
trunk/matplotlib/examples/misc/rec_join_demo.py
trunk/matplotlib/examples/pylab/
trunk/matplotlib/examples/pylab/README
trunk/matplotlib/examples/pylab/__init__.py
trunk/matplotlib/examples/pylab/accented_text.py
trunk/matplotlib/examples/pylab/agg_buffer_to_array.py
trunk/matplotlib/examples/pylab/agg_oo.py
trunk/matplotlib/examples/pylab/alignment_test.py
trunk/matplotlib/examples/pylab/anim.py
trunk/matplotlib/examples/pylab/annotation_demo.py
trunk/matplotlib/examples/pylab/anscombe.py
trunk/matplotlib/examples/pylab/arctest.py
trunk/matplotlib/examples/pylab/arrow_demo.py
trunk/matplotlib/examples/pylab/auto_layout.py
trunk/matplotlib/examples/pylab/axes_demo.py
trunk/matplotlib/examples/pylab/axes_props.py
trunk/matplotlib/examples/pylab/axhspan_demo.py
trunk/matplotlib/examples/pylab/axis_equal_demo.py
trunk/matplotlib/examples/pylab/backend_driver.py
trunk/matplotlib/examples/pylab/bar_stacked.py
trunk/matplotlib/examples/pylab/barchart_demo.py
trunk/matplotlib/examples/pylab/barcode_demo.py
trunk/matplotlib/examples/pylab/barh_demo.py
trunk/matplotlib/examples/pylab/boxplot_demo.py
trunk/matplotlib/examples/pylab/break.py
trunk/matplotlib/examples/pylab/broken_barh.py
trunk/matplotlib/examples/pylab/clippedline.py
trunk/matplotlib/examples/pylab/cohere_demo.py
trunk/matplotlib/examples/pylab/color_by_yvalue.py
trunk/matplotlib/examples/pylab/color_demo.py
trunk/matplotlib/examples/pylab/colours.py
trunk/matplotlib/examples/pylab/contour_demo.py
trunk/matplotlib/examples/pylab/contour_image.py
trunk/matplotlib/examples/pylab/contourf_demo.py
trunk/matplotlib/examples/pylab/contourf_log.py
trunk/matplotlib/examples/pylab/coords_demo.py
trunk/matplotlib/examples/pylab/coords_report.py
trunk/matplotlib/examples/pylab/csd_demo.py
trunk/matplotlib/examples/pylab/cursor_demo.py
trunk/matplotlib/examples/pylab/custom_figure_class.py
trunk/matplotlib/examples/pylab/custom_projection_example.py
trunk/matplotlib/examples/pylab/custom_scale_example.py
trunk/matplotlib/examples/pylab/custom_ticker1.py
trunk/matplotlib/examples/pylab/customize_rc.py
trunk/matplotlib/examples/pylab/dannys_example.py
trunk/matplotlib/examples/pylab/dash_control.py
trunk/matplotlib/examples/pylab/dashpointlabel.py
trunk/matplotlib/examples/pylab/dashtick.py
trunk/matplotlib/examples/pylab/data_browser.py
trunk/matplotlib/examples/pylab/data_helper.py
trunk/matplotlib/examples/pylab/date_demo1.py
trunk/matplotlib/examples/pylab/date_demo2.py
trunk/matplotlib/examples/pylab/date_demo_convert.py
trunk/matplotlib/examples/pylab/date_demo_rrule.py
trunk/matplotlib/examples/pylab/date_index_formatter.py
trunk/matplotlib/examples/pylab/dynamic_demo.py
trunk/matplotlib/examples/pylab/dynamic_image_gtkagg.py
trunk/matplotlib/examples/pylab/ellipse_demo.py
trunk/matplotlib/examples/pylab/ellipse_rotated.py
trunk/matplotlib/examples/pylab/equal_aspect_ratio.py
trunk/matplotlib/examples/pylab/errorbar_demo.py
trunk/matplotlib/examples/pylab/errorbar_limits.py
trunk/matplotlib/examples/pylab/figimage_demo.py
trunk/matplotlib/examples/pylab/figlegend_demo.py
trunk/matplotlib/examples/pylab/figtext.py
trunk/matplotlib/examples/pylab/fill_between.py
trunk/matplotlib/examples/pylab/fill_between_posneg.py
trunk/matplotlib/examples/pylab/fill_demo.py
trunk/matplotlib/examples/pylab/fill_demo2.py
trunk/matplotlib/examples/pylab/fill_spiral.py
trunk/matplotlib/examples/pylab/finance_demo.py
trunk/matplotlib/examples/pylab/font_table_ttf.py
trunk/matplotlib/examples/pylab/fonts_demo.py
trunk/matplotlib/examples/pylab/fonts_demo_kw.py
trunk/matplotlib/examples/pylab/ganged_plots.py
trunk/matplotlib/examples/pylab/geo_demo.py
trunk/matplotlib/examples/pylab/ginput_demo.py
trunk/matplotlib/examples/pylab/gradient_bar.py
trunk/matplotlib/examples/pylab/hatch_demo.py
trunk/matplotlib/examples/pylab/hexbin_demo.py
trunk/matplotlib/examples/pylab/hist_colormapped.py
trunk/matplotlib/examples/pylab/histogram_demo.py
trunk/matplotlib/examples/pylab/hline_demo.py
trunk/matplotlib/examples/pylab/image_demo.py
trunk/matplotlib/examples/pylab/image_demo2.py
trunk/matplotlib/examples/pylab/image_demo3.py
trunk/matplotlib/examples/pylab/image_interp.py
trunk/matplotlib/examples/pylab/image_masked.py
trunk/matplotlib/examples/pylab/image_origin.py
trunk/matplotlib/examples/pylab/image_slices_viewer.py
trunk/matplotlib/examples/pylab/integral_demo.py
trunk/matplotlib/examples/pylab/interactive.py
trunk/matplotlib/examples/pylab/interactive2.py
trunk/matplotlib/examples/pylab/interp_demo.py
trunk/matplotlib/examples/pylab/invert_axes.py
trunk/matplotlib/examples/pylab/keypress_demo.py
trunk/matplotlib/examples/pylab/layer_images.py
trunk/matplotlib/examples/pylab/legend_auto.py
trunk/matplotlib/examples/pylab/legend_demo.py
trunk/matplotlib/examples/pylab/legend_demo2.py
trunk/matplotlib/examples/pylab/legend_scatter.py
trunk/matplotlib/examples/pylab/line_collection.py
trunk/matplotlib/examples/pylab/line_collection2.py
trunk/matplotlib/examples/pylab/line_styles.py
trunk/matplotlib/examples/pylab/lineprops_dialog_gtk.py
trunk/matplotlib/examples/pylab/load_converter.py
trunk/matplotlib/examples/pylab/loadrec.py
trunk/matplotlib/examples/pylab/log_bar.py
trunk/matplotlib/examples/pylab/log_demo.py
trunk/matplotlib/examples/pylab/log_test.py
trunk/matplotlib/examples/pylab/logo.py
trunk/matplotlib/examples/pylab/major_minor_demo1.py
trunk/matplotlib/examples/pylab/major_minor_demo2.py
trunk/matplotlib/examples/pylab/manual_axis.py
trunk/matplotlib/examples/pylab/masked_demo.py
trunk/matplotlib/examples/pylab/mathtext_demo.py
trunk/matplotlib/examples/pylab/mathtext_examples.py
trunk/matplotlib/examples/pylab/matplotlib_icon.py
trunk/matplotlib/examples/pylab/matshow.py
trunk/matplotlib/examples/pylab/movie_demo.py
trunk/matplotlib/examples/pylab/mri_demo.py
trunk/matplotlib/examples/pylab/mri_with_eeg.py
trunk/matplotlib/examples/pylab/multi_image.py
trunk/matplotlib/examples/pylab/multiline.py
trunk/matplotlib/examples/pylab/multiple_figs_demo.py
trunk/matplotlib/examples/pylab/nan_test.py
trunk/matplotlib/examples/pylab/newscalarformatter_demo.py
trunk/matplotlib/examples/pylab/pcolor_demo.py
trunk/matplotlib/examples/pylab/pcolor_demo2.py
trunk/matplotlib/examples/pylab/pcolor_log.py
trunk/matplotlib/examples/pylab/pcolor_nonuniform.py
trunk/matplotlib/examples/pylab/pcolor_small.py
trunk/matplotlib/examples/pylab/pick_event_demo2.py
trunk/matplotlib/examples/pylab/pie_demo.py
trunk/matplotlib/examples/pylab/plotfile_demo.py
trunk/matplotlib/examples/pylab/polar_bar.py
trunk/matplotlib/examples/pylab/polar_demo.py
trunk/matplotlib/examples/pylab/polar_legend.py
trunk/matplotlib/examples/pylab/polar_scatter.py
trunk/matplotlib/examples/pylab/poly_editor.py
trunk/matplotlib/examples/pylab/poormans_contour.py
trunk/matplotlib/examples/pylab/print_stdout.py
trunk/matplotlib/examples/pylab/psd_demo.py
trunk/matplotlib/examples/pylab/pstest.py
trunk/matplotlib/examples/pylab/pylab_with_gtk.py
trunk/matplotlib/examples/pylab/pythonic_matplotlib.py
trunk/matplotlib/examples/pylab/quadmesh_demo.py
trunk/matplotlib/examples/pylab/quiver_demo.py
trunk/matplotlib/examples/pylab/scatter_custom_symbol.py
trunk/matplotlib/examples/pylab/scatter_demo.py
trunk/matplotlib/examples/pylab/scatter_demo2.py
trunk/matplotlib/examples/pylab/scatter_masked.py
trunk/matplotlib/examples/pylab/scatter_profile.py
trunk/matplotlib/examples/pylab/scatter_star_poly.py
trunk/matplotlib/examples/pylab/set_and_get.py
trunk/matplotlib/examples/pylab/shared_axis_across_figures.py
trunk/matplotlib/examples/pylab/shared_axis_demo.py
trunk/matplotlib/examples/pylab/simple3d.py
trunk/matplotlib/examples/pylab/simple_plot.py
trunk/matplotlib/examples/pylab/simple_plot_fps.py
trunk/matplotlib/examples/pylab/specgram_demo.py
trunk/matplotlib/examples/pylab/spy_demos.py
trunk/matplotlib/examples/pylab/stem_plot.py
trunk/matplotlib/examples/pylab/step_demo.py
trunk/matplotlib/examples/pylab/stix_fonts_demo.py
trunk/matplotlib/examples/pylab/stock_demo.py
trunk/matplotlib/examples/pylab/strip_chart_demo.py
trunk/matplotlib/examples/pylab/subplot_demo.py
trunk/matplotlib/examples/pylab/subplot_toolbar.py
trunk/matplotlib/examples/pylab/subplots_adjust.py
trunk/matplotlib/examples/pylab/symlog_demo.py
trunk/matplotlib/examples/pylab/system_monitor.py
trunk/matplotlib/examples/pylab/table_demo.py
trunk/matplotlib/examples/pylab/tex_demo.py
trunk/matplotlib/examples/pylab/tex_unicode_demo.py
trunk/matplotlib/examples/pylab/text_handles.py
trunk/matplotlib/examples/pylab/text_rotation.py
trunk/matplotlib/examples/pylab/text_themes.py
trunk/matplotlib/examples/pylab/to_numeric.py
trunk/matplotlib/examples/pylab/toggle_images.py
trunk/matplotlib/examples/pylab/transoffset.py
trunk/matplotlib/examples/pylab/two_scales.py
trunk/matplotlib/examples/pylab/unicode_demo.py
trunk/matplotlib/examples/pylab/vertical_ticklabels.py
trunk/matplotlib/examples/pylab/vline_demo.py
trunk/matplotlib/examples/pylab/webapp_demo.py
trunk/matplotlib/examples/pylab/xcorr_demo.py
trunk/matplotlib/examples/pylab/zorder_demo.py
trunk/matplotlib/examples/pyplot/
trunk/matplotlib/examples/pyplot/barchart_demo.py
trunk/matplotlib/examples/pyplot/collections_demo.py
trunk/matplotlib/examples/pyplot/colorbar_only.py
trunk/matplotlib/examples/pyplot/date_demo.py
trunk/matplotlib/examples/pyplot/scatter_piecharts.py
trunk/matplotlib/examples/tests/
trunk/matplotlib/examples/user_interfaces/
trunk/matplotlib/examples/user_interfaces/README.wx
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk3.py
trunk/matplotlib/examples/user_interfaces/embedding_in_qt.py
trunk/matplotlib/examples/user_interfaces/embedding_in_qt4.py
trunk/matplotlib/examples/user_interfaces/embedding_in_tk.py
trunk/matplotlib/examples/user_interfaces/embedding_in_tk2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx2.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx3.py
trunk/matplotlib/examples/user_interfaces/embedding_in_wx4.py
trunk/matplotlib/examples/user_interfaces/gtk_spreadsheet.py
trunk/matplotlib/examples/user_interfaces/histogram_demo_canvasagg.py
trunk/matplotlib/examples/user_interfaces/mathtext_wx.py
trunk/matplotlib/examples/user_interfaces/mpl_with_glade.glade
trunk/matplotlib/examples/user_interfaces/mpl_with_glade.py
trunk/matplotlib/examples/user_interfaces/printing_in_wx.py
trunk/matplotlib/examples/user_interfaces/rec_edit_gtk_custom.py
trunk/matplotlib/examples/user_interfaces/rec_edit_gtk_simple.py
trunk/matplotlib/examples/user_interfaces/simple3d_oo.py
trunk/matplotlib/examples/user_interfaces/wxcursor_demo.py
Removed Paths:
-------------
trunk/matplotlib/examples/README
trunk/matplotlib/examples/README.wx
trunk/matplotlib/examples/__init__.py
trunk/matplotlib/examples/accented_text.py
trunk/matplotlib/examples/agg_buffer_to_array.py
trunk/matplotlib/examples/agg_oo.py
trunk/matplotlib/examples/alignment_test.py
trunk/matplotlib/examples/anim.py
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/annotation_demo.py
trunk/matplotlib/examples/anscombe.py
trunk/matplotlib/examples/arctest.py
trunk/matplotlib/examples/arrow_demo.py
trunk/matplotlib/examples/auto_layout.py
trunk/matplotlib/examples/axes_demo.py
trunk/matplotlib/examples/axes_props.py
trunk/matplotlib/examples/axhspan_demo.py
trunk/matplotlib/examples/axis_equal_demo.py
trunk/matplotlib/examples/backend_driver.py
trunk/matplotlib/examples/bar_stacked.py
trunk/matplotlib/examples/barchart_demo.py
trunk/matplotlib/examples/barcode_demo.py
trunk/matplotlib/examples/barh_demo.py
trunk/matplotlib/examples/boxplot_demo.py
trunk/matplotlib/examples/break.py
trunk/matplotlib/examples/broken_barh.py
trunk/matplotlib/examples/clippedline.py
trunk/matplotlib/examples/cohere_demo.py
trunk/matplotlib/examples/collections_demo.py
trunk/matplotlib/examples/color_by_yvalue.py
trunk/matplotlib/examples/color_demo.py
trunk/matplotlib/examples/colorbar_only.py
trunk/matplotlib/examples/colours.py
trunk/matplotlib/examples/contour_demo.py
trunk/matplotlib/examples/contour_image.py
trunk/matplotlib/examples/contourf_demo.py
trunk/matplotlib/examples/contourf_log.py
trunk/matplotlib/examples/coords_demo.py
trunk/matplotlib/examples/coords_report.py
trunk/matplotlib/examples/csd_demo.py
trunk/matplotlib/examples/cursor_demo.py
trunk/matplotlib/examples/custom_figure_class.py
trunk/matplotlib/examples/custom_projection_example.py
trunk/matplotlib/examples/custom_scale_example.py
trunk/matplotlib/examples/custom_ticker1.py
trunk/matplotlib/examples/customize_rc.py
trunk/matplotlib/examples/dannys_example.py
trunk/matplotlib/examples/dash_control.py
trunk/matplotlib/examples/dashpointlabel.py
trunk/matplotlib/examples/dashtick.py
trunk/matplotlib/examples/data_browser.py
trunk/matplotlib/examples/data_helper.py
trunk/matplotlib/examples/date_demo.py
trunk/matplotlib/examples/date_demo1.py
trunk/matplotlib/examples/date_demo2.py
trunk/matplotlib/examples/date_demo_convert.py
trunk/matplotlib/examples/date_demo_rrule.py
trunk/matplotlib/examples/date_index_formatter.py
trunk/matplotlib/examples/dynamic_collection.py
trunk/matplotlib/examples/dynamic_demo.py
trunk/matplotlib/examples/dynamic_demo_wx.py
trunk/matplotlib/examples/dynamic_image_gtkagg.py
trunk/matplotlib/examples/dynamic_image_wxagg.py
trunk/matplotlib/examples/dynamic_image_wxagg2.py
trunk/matplotlib/examples/ellipse_demo.py
trunk/matplotlib/examples/ellipse_rotated.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/equal_aspect_ratio.py
trunk/matplotlib/examples/errorbar_demo.py
trunk/matplotlib/examples/errorbar_limits.py
trunk/matplotlib/examples/figimage_demo.py
trunk/matplotlib/examples/figlegend_demo.py
trunk/matplotlib/examples/figtext.py
trunk/matplotlib/examples/fill_between.py
trunk/matplotlib/examples/fill_between_posneg.py
trunk/matplotlib/examples/fill_demo.py
trunk/matplotlib/examples/fill_demo2.py
trunk/matplotlib/examples/fill_spiral.py
trunk/matplotlib/examples/finance_demo.py
trunk/matplotlib/examples/font_indexing.py
trunk/matplotlib/examples/font_table_ttf.py
trunk/matplotlib/examples/fonts_demo.py
trunk/matplotlib/examples/fonts_demo_kw.py
trunk/matplotlib/examples/ftface_props.py
trunk/matplotlib/examples/ganged_plots.py
trunk/matplotlib/examples/geo_demo.py
trunk/matplotlib/examples/ginput_demo.py
trunk/matplotlib/examples/gradient_bar.py
trunk/matplotlib/examples/gtk_spreadsheet.py
trunk/matplotlib/examples/hatch_demo.py
trunk/matplotlib/examples/hexbin_demo.py
trunk/matplotlib/examples/hist_colormapped.py
trunk/matplotlib/examples/histogram_demo.py
trunk/matplotlib/examples/histogram_demo_canvasagg.py
trunk/matplotlib/examples/hline_demo.py
trunk/matplotlib/examples/image_demo.py
trunk/matplotlib/examples/image_demo2.py
trunk/matplotlib/examples/image_demo3.py
trunk/matplotlib/examples/image_interp.py
trunk/matplotlib/examples/image_masked.py
trunk/matplotlib/examples/image_origin.py
trunk/matplotlib/examples/image_slices_viewer.py
trunk/matplotlib/examples/integral_demo.py
trunk/matplotlib/examples/interactive.py
trunk/matplotlib/examples/interactive2.py
trunk/matplotlib/examples/interp_demo.py
trunk/matplotlib/examples/invert_axes.py
trunk/matplotlib/examples/keypress_demo.py
trunk/matplotlib/examples/lasso_demo.py
trunk/matplotlib/examples/layer_images.py
trunk/matplotlib/examples/legend_auto.py
trunk/matplotlib/examples/legend_demo.py
trunk/matplotlib/examples/legend_demo2.py
trunk/matplotlib/examples/legend_scatter.py
trunk/matplotlib/examples/line_collection.py
trunk/matplotlib/examples/line_collection2.py
trunk/matplotlib/examples/line_styles.py
trunk/matplotlib/examples/lineprops_dialog_gtk.py
trunk/matplotlib/examples/load_converter.py
trunk/matplotlib/examples/loadrec.py
trunk/matplotlib/examples/log_bar.py
trunk/matplotlib/examples/log_demo.py
trunk/matplotlib/examples/log_test.py
trunk/matplotlib/examples/logo.py
trunk/matplotlib/examples/major_minor_demo1.py
trunk/matplotlib/examples/major_minor_demo2.py
trunk/matplotlib/examples/manual_axis.py
trunk/matplotlib/examples/masked_demo.py
trunk/matplotlib/examples/mathtext_demo.py
trunk/matplotlib/examples/mathtext_examples.py
trunk/matplotlib/examples/mathtext_wx.py
trunk/matplotlib/examples/matplotlib_icon.py
trunk/matplotlib/examples/matshow.py
trunk/matplotlib/examples/movie_demo.py
trunk/matplotlib/examples/mpl_with_glade.glade
trunk/matplotlib/examples/mpl_with_glade.py
trunk/matplotlib/examples/mri_demo.py
trunk/matplotlib/examples/mri_with_eeg.py
trunk/matplotlib/examples/multi_image.py
trunk/matplotlib/examples/multiline.py
trunk/matplotlib/examples/multiple_figs_demo.py
trunk/matplotlib/examples/nan_test.py
trunk/matplotlib/examples/newscalarformatter_demo.py
trunk/matplotlib/examples/pcolor_demo.py
trunk/matplotlib/examples/pcolor_demo2.py
trunk/matplotlib/examples/pcolor_log.py
trunk/matplotlib/examples/pcolor_nonuniform.py
trunk/matplotlib/examples/pcolor_small.py
trunk/matplotlib/examples/pick_event_demo.py
trunk/matplotlib/examples/pick_event_demo2.py
trunk/matplotlib/examples/pie_demo.py
trunk/matplotlib/examples/plotfile_demo.py
trunk/matplotlib/examples/polar_bar.py
trunk/matplotlib/examples/polar_demo.py
trunk/matplotlib/examples/polar_legend.py
trunk/matplotlib/examples/polar_scatter.py
trunk/matplotlib/examples/poly_editor.py
trunk/matplotlib/examples/poormans_contour.py
trunk/matplotlib/examples/print_stdout.py
trunk/matplotlib/examples/printing_in_wx.py
trunk/matplotlib/examples/psd_demo.py
trunk/matplotlib/examples/pstest.py
trunk/matplotlib/examples/pylab_with_gtk.py
trunk/matplotlib/examples/pythonic_matplotlib.py
trunk/matplotlib/examples/quadmesh_demo.py
trunk/matplotlib/examples/quiver_demo.py
trunk/matplotlib/examples/rc_traits.py
trunk/matplotlib/examples/rec_edit_gtk_custom.py
trunk/matplotlib/examples/rec_edit_gtk_simple.py
trunk/matplotlib/examples/rec_groupby_demo.py
trunk/matplotlib/examples/rec_join_demo.py
trunk/matplotlib/examples/scatter_custom_symbol.py
trunk/matplotlib/examples/scatter_demo.py
trunk/matplotlib/examples/scatter_demo2.py
trunk/matplotlib/examples/scatter_masked.py
trunk/matplotlib/examples/scatter_piecharts.py
trunk/matplotlib/examples/scatter_profile.py
trunk/matplotlib/examples/scatter_star_poly.py
trunk/matplotlib/examples/set_and_get.py
trunk/matplotlib/examples/shared_axis_across_figures.py
trunk/matplotlib/examples/shared_axis_demo.py
trunk/matplotlib/examples/simple3d.py
trunk/matplotlib/examples/simple3d_oo.py
trunk/matplotlib/examples/simple_plot.py
trunk/matplotlib/examples/simple_plot_fps.py
trunk/matplotlib/examples/specgram_demo.py
trunk/matplotlib/examples/spy_demos.py
trunk/matplotlib/examples/stem_plot.py
trunk/matplotlib/examples/step_demo.py
trunk/matplotlib/examples/stix_fonts_demo.py
trunk/matplotlib/examples/stock_demo.py
trunk/matplotlib/examples/strip_chart_demo.py
trunk/matplotlib/examples/subplot_demo.py
trunk/matplotlib/examples/subplot_toolbar.py
trunk/matplotlib/examples/subplots_adjust.py
trunk/matplotlib/examples/symlog_demo.py
trunk/matplotlib/examples/system_monitor.py
trunk/matplotlib/examples/table_demo.py
trunk/matplotlib/examples/tex_demo.py
trunk/matplotlib/examples/tex_unicode_demo.py
trunk/matplotlib/examples/text_handles.py
trunk/matplotlib/examples/text_rotation.py
trunk/matplotlib/examples/text_themes.py
trunk/matplotlib/examples/to_numeric.py
trunk/matplotlib/examples/toggle_images.py
trunk/matplotlib/examples/transoffset.py
trunk/matplotlib/examples/two_scales.py
trunk/matplotlib/examples/unicode_demo.py
trunk/matplotlib/examples/vertical_ticklabels.py
trunk/matplotlib/examples/vline_demo.py
trunk/matplotlib/examples/webapp_demo.py
trunk/matplotlib/examples/wxcursor_demo.py
trunk/matplotlib/examples/xcorr_demo.py
trunk/matplotlib/examples/zoom_window.py
trunk/matplotlib/examples/zorder_demo.py
Deleted: trunk/matplotlib/examples/README
===================================================================
--- trunk/matplotlib/examples/README 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/README 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,24 +0,0 @@
-Here are some demos of how to use the matplotlib.
-
-
--- data_helper.py - a convenience module to load some data from the
- data dir
-
--- embedding_in_gtk - The Figure class derives from gtk.DrawingArea,
- so it is easy to embed in larger applications.
-
--- histograms_gauss.py - 2D histograms; requires the jdh.mlab module
-
--- simple_plot.py - the basic 2D line plot
-
--- subplot_demo.py - how to do multiple axes on a single plot
-
--- vline_demo.py - working with straight lines
-
--- stock_demo.py - working with large datasets. Click on the plot and
- launch the navigation tool; wheel mouse over the navigation
- buttons to scroll and zoom. There are 58 days of minute by
- minute stock quotes for two tickers. The plot lib uses
- Numeric's super speedy searchsorted routine to extract the
- clipping indices so only the data in the viewport are handled.
-
Deleted: trunk/matplotlib/examples/README.wx
===================================================================
--- trunk/matplotlib/examples/README.wx 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/README.wx 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,21 +0,0 @@
-You have a few different options available to you for embedding
-matplotlib in a wxPython application
-
-1. Embed one of the wxPython backend widgets (which subclass wx.Panel)
- directly and draw plots on it using matplotlib's object-oriented
- API. This approach is demonstrated by some of the examples
- embedding_in_wx*.py
-
-2. Embed the PlotPanel from Matt Newville's `MPlot' package and draw
- plots on it using its plot() and oplot() methods.
-
- http://cars9.uchicago.edu/~newville/Python/MPlot/
-
-3. Embed the PlotPanel from Ken McIvor wxmpl module and draw plots on
- it using the matplotlib's object-oriented API.
-
- http://agni.phys.iit.edu/~kmcivor/wxmpl/
-
-Each of these approachs has different benefits and drawbacks, so I
-encourage you to evaluate each of them and select the one that best
-meets your needs.
Deleted: trunk/matplotlib/examples/__init__.py
===================================================================
Deleted: trunk/matplotlib/examples/accented_text.py
===================================================================
--- trunk/matplotlib/examples/accented_text.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/accented_text.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,21 +0,0 @@
-#!/usr/bin/env python
-"""
-matplotlib supports accented characters via TeX mathtext
-
-The following accents are provided: \hat, \breve, \grave, \bar,
-\acute, \tilde, \vec, \dot, \ddot. All of them have the same syntax,
-eg to make an overbar you do \bar{o} or to make an o umlaut you do
-\ddot{o}. The shortcuts are also provided, eg: \"o \'e \`e \~n \.x
-\^y
-
-"""
-from pylab import *
-
-plot(range(10))
-
-title(r'$\ddot{o}\acute{e}\grave{e}\hat{O}\breve{i}\bar{A}\tilde{n}\vec{q}$', fontsize=20)
-# shorthand is also supported and curly's are optional
-xlabel(r"""$\"o\ddot o \'e\`e\~n\.x\^y$""", fontsize=20)
-
-
-show()
Deleted: trunk/matplotlib/examples/agg_buffer_to_array.py
===================================================================
--- trunk/matplotlib/examples/agg_buffer_to_array.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/agg_buffer_to_array.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,24 +0,0 @@
-import matplotlib
-matplotlib.use('Agg')
-from pylab import figure, show
-import numpy as npy
-
-# make an agg figure
-fig = figure()
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-ax.set_title('a simple figure')
-fig.canvas.draw()
-
-# grab rhe pixel buffer and dumpy it into a numpy array
-buf = fig.canvas.buffer_rgba(0,0)
-l, b, w, h = fig.bbox.bounds
-X = npy.fromstring(buf, npy.uint8)
-X.shape = h,w,4
-
-# now display the array X as an Axes in a new figure
-fig2 = figure()
-ax2 = fig2.add_subplot(111, frameon=False)
-ax2.imshow(X)
-fig2.savefig('simple.png')
-show()
Deleted: trunk/matplotlib/examples/agg_oo.py
===================================================================
--- trunk/matplotlib/examples/agg_oo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/agg_oo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-"""
-A pure OO (look Ma, no pylab!) example using the agg backend
-"""
-from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
-from matplotlib.figure import Figure
-
-fig = Figure()
-canvas = FigureCanvas(fig)
-ax = fig.add_subplot(111)
-ax.plot([1,2,3])
-ax.set_title('hi mom')
-ax.grid(True)
-ax.set_xlabel('time')
-ax.set_ylabel('volts')
-canvas.print_figure('test')
Deleted: trunk/matplotlib/examples/alignment_test.py
===================================================================
--- trunk/matplotlib/examples/alignment_test.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/alignment_test.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-"""
-You can precisely layout text in data or axes (0,1) coordinates. This
-example shows you some of the alignment and rotation specifications to
-layout text
-"""
-
-from pylab import *
-from matplotlib.lines import Line2D
-from matplotlib.patches import Rectangle
-
-# build a rectangle in axes coords
-left, width = .25, .5
-bottom, height = .25, .5
-right = left + width
-top = bottom + height
-ax = gca()
-p = Rectangle((left, bottom), width, height,
- fill=False,
- )
-p.set_transform(ax.transAxes)
-p.set_clip_on(False)
-ax.add_patch(p)
-
-
-ax.text(left, bottom, 'left top',
- horizontalalignment='left',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(left, bottom, 'left bottom',
- horizontalalignment='left',
- verticalalignment='bottom',
- transform=ax.transAxes)
-
-ax.text(right, top, 'right bottom',
- horizontalalignment='right',
- verticalalignment='bottom',
- transform=ax.transAxes)
-
-ax.text(right, top, 'right top',
- horizontalalignment='right',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(right, bottom, 'center top',
- horizontalalignment='center',
- verticalalignment='top',
- transform=ax.transAxes)
-
-ax.text(left, 0.5*(bottom+top), 'right center',
- horizontalalignment='right',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(left, 0.5*(bottom+top), 'left center',
- horizontalalignment='left',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(0.5*(left+right), 0.5*(bottom+top), 'middle',
- horizontalalignment='center',
- verticalalignment='center',
- transform=ax.transAxes)
-
-ax.text(right, 0.5*(bottom+top), 'centered',
- horizontalalignment='center',
- verticalalignment='center',
- rotation='vertical',
- transform=ax.transAxes)
-
-ax.text(left, top, 'rotated\nwith newlines',
- horizontalalignment='center',
- verticalalignment='center',
- rotation=45,
- transform=ax.transAxes)
-
-axis('off')
-#savefig('alignment_test', dpi=100)
-show()
Deleted: trunk/matplotlib/examples/anim.py
===================================================================
--- trunk/matplotlib/examples/anim.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/anim.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,32 +0,0 @@
-#!/usr/bin/env python
-"""
-A simple example of an animated plot in matplotlib. You can test the
-speed of animation of various backends by running the script with the
-'-dSomeBackend' flag
-
-SC Aug 31 2005 mpl 0.83.2:
-Here are some numbers from my system, where FPS is the frames rendered
-per second
-
- GTK 29 FPS
- GTKAgg 18 FPS
- GTKCairo 15 FPS
- TkAgg 13 FPS
- QkAgg 13 FPS
-"""
-import time
-
-import pylab as p
-
-# turn interactive mode on for dynamic updates. If you aren't in
-# interactive mode, you'll need to use a GUI event handler/timer.
-p.ion()
-
-tstart = time.time() # for profiling
-x = p.arange(0, 2*p.pi, 0.01) # x-array
-line, = p.plot(x, p.sin(x))
-for i in p.arange(1,200):
- line.set_ydata(p.sin(x+i/10.0)) # update the data
- p.draw() # redraw the canvas
-
-print 'FPS:' , 200/(time.time()-tstart)
Copied: trunk/matplotlib/examples/animation/animation_blit.py (from rev 5143, trunk/matplotlib/examples/animation_blit.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+
+# For detailed comments on animation and the techniques used here, see
+# the wiki entry
+# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
+import sys
+import time
+
+import gtk, gobject
+
+import matplotlib
+matplotlib.use('GTKAgg')
+import numpy as npy
+import pylab as p
+
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+# create the initial line
+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()
+
+def update_line(*args):
+ if update_line.background is None:
+ update_line.background = canvas.copy_from_bbox(ax.bbox)
+
+ # restore the clean slate background
+ canvas.restore_region(update_line.background)
+ # update the data
+ line.set_ydata(npy.sin(x+update_line.cnt/10.0))
+ # just draw the animated artist
+ try:
+ ax.draw_artist(line)
+ except AssertionError:
+ return
+ # just redraw the axes rectangle
+ canvas.blit(ax.bbox)
+
+ if update_line.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-tstart)
+ sys.exit()
+
+ update_line.cnt += 1
+ return True
+
+update_line.cnt = 0
+update_line.background = None
+gobject.idle_add(update_line)
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_fltk.py (from rev 5143, trunk/matplotlib/examples/animation_blit_fltk.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_fltk.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_fltk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,54 @@
+import sys
+import fltk
+import matplotlib
+matplotlib.use('FltkAgg')
+import pylab as p
+import numpy as npy
+import time
+
+
+# save the clean slate background -- everything but the animated line
+# is drawn and saved in the pixel buffer background
+class animator:
+ def __init__(self,ax):
+ self.ax=ax
+ self.canvas=ax.figure.canvas
+ self.canvas.mpl_connect('draw_event',self.clear)
+ self.cnt=0
+ self.background=None
+
+ # for profiling
+ self.tstart = time.time()
+
+ def clear(self,event):
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ def update(self,ptr):
+ # restore the clean slate background
+ if self.background is None:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+ self.canvas.restore_region(self.background)
+ # update the data
+ line.set_ydata(npy.sin(x+self.cnt/10.0))
+ # just draw the animated artist
+ self.ax.draw_artist(line)
+ # just redraw the axes rectangle
+ self.canvas.blit(ax.bbox)
+ self.cnt+=1
+ if self.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-self.tstart)
+ sys.exit()
+ return True
+
+ax = p.subplot(111)
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+# create the initial line
+x = npy.arange(0,2*npy.pi,0.01)
+line, = p.plot(x, npy.sin(x), animated=True)
+p.draw()
+anim=animator(ax)
+
+fltk.Fl.add_idle(anim.update)
+fltk.Fl.run()
Copied: trunk/matplotlib/examples/animation/animation_blit_qt.py (from rev 5143, trunk/matplotlib/examples/animation_blit_qt.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_qt.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_qt.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,64 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import os, sys
+import matplotlib
+matplotlib.use('QtAgg') # qt3 example
+
+from qt import *
+# Note: color-intensive applications may require a different color allocation
+# strategy.
+QApplication.setColorSpec(QApplication.NormalColor)
+
+TRUE = 1
+FALSE = 0
+ITERS = 1000
+
+import pylab as p
+import numpy as npy
+import time
+
+class BlitQT(QObject):
+ def __init__(self):
+ QObject.__init__(self, None, "app")
+
+ self.ax = p.subplot(111)
+ self.canvas = self.ax.figure.canvas
+ self.cnt = 0
+
+ # create the initial line
+ 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
+
+ def timerEvent(self, evt):
+ if self.background is None:
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ # restore the clean slate background
+ self.canvas.restore_region(self.background)
+ # update the data
+ 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
+ self.canvas.blit(self.ax.bbox)
+
+ if self.cnt==ITERS:
+ # print the timing info and quit
+ print 'FPS:' , ITERS/(time.time()-self.tstart)
+ sys.exit()
+
+ else:
+ self.cnt += 1
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+app = BlitQT()
+# for profiling
+app.tstart = time.time()
+app.startTimer(0)
+
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_qt4.py (from rev 5143, trunk/matplotlib/examples/animation_blit_qt4.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_qt4.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_qt4.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,68 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import os, sys
+import matplotlib
+matplotlib.use('Qt4Agg') # qt4 example
+
+from PyQt4 import QtCore, QtGui
+
+ITERS = 1000
+
+import pylab as p
+import numpy as npy
+import time
+
+class BlitQT(QtCore.QObject):
+ def __init__(self):
+ self.ax = p.subplot(111)
+ self.canvas = self.ax.figure.canvas
+
+ # By making this a child of the canvas we make sure that it is
+ # destroyed first and avoids a possible exception when the user clicks
+ # on the window's close box.
+ QtCore.QObject.__init__(self, self.canvas)
+
+ self.cnt = 0
+
+ # create the initial line
+ 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
+ self.old_size = 0, 0
+
+ def timerEvent(self, evt):
+ # See if the size has changed since last time round.
+ current_size = self.ax.bbox.width, self.ax.bbox.height
+
+ if self.old_size != current_size:
+ self.old_size = current_size
+ self.background = self.canvas.copy_from_bbox(self.ax.bbox)
+
+ # restore the clean slate background
+ self.canvas.restore_region(self.background)
+ # update the data
+ 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
+ self.canvas.blit(self.ax.bbox)
+
+ if self.cnt==ITERS:
+ # print the timing info and quit
+ print 'FPS:' , ITERS/(time.time()-self.tstart)
+ sys.exit()
+
+ else:
+ self.cnt += 1
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+app = BlitQT()
+# for profiling
+app.tstart = time.time()
+app.startTimer(0)
+
+p.show()
Copied: trunk/matplotlib/examples/animation/animation_blit_tk.py (from rev 5143, trunk/matplotlib/examples/animation_blit_tk.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_tk.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_tk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,52 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
+
+import matplotlib
+matplotlib.use('TkAgg')
+
+import sys
+import pylab as p
+import numpy as npy
+import time
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+
+# create the initial line
+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)
+ # for profiling
+ tstart = time.time()
+
+ while 1:
+ # restore the clean slate background
+ canvas.restore_region(background)
+ # update the data
+ line.set_ydata(npy.sin(x+run.cnt/10.0))
+ # just draw the animated artist
+ ax.draw_artist(line)
+ # just redraw the axes rectangle
+ canvas.blit(ax.bbox)
+
+ if run.cnt==1000:
+ # print the timing info and quit
+ print 'FPS:' , 1000/(time.time()-tstart)
+ sys.exit()
+
+ run.cnt += 1
+run.cnt = 0
+
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+manager = p.get_current_fig_manager()
+manager.window.after(100, run)
+
+p.show()
+
+
+
Copied: trunk/matplotlib/examples/animation/animation_blit_wx.py (from rev 5143, trunk/matplotlib/examples/animation_blit_wx.py)
===================================================================
--- trunk/matplotlib/examples/animation/animation_blit_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/animation_blit_wx.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,76 @@
+# For detailed comments on animation and the techniqes used here, see
+# the wiki entry
+# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
+
+# The number of blits() to make before exiting
+NBLITS = 1000
+
+import matplotlib
+matplotlib.use('WXAgg')
+matplotlib.rcParams['toolbar'] = 'None'
+
+import wx
+import sys
+import pylab as p
+import numpy as npy
+import time
+
+
+# allow the user to disable the WXAgg accelerator from the command line
+if '--no-accel' in sys.argv:
+ import matplotlib.backends.backend_wxagg
+ matplotlib.backends.backend_wxagg._use_accelerator(False)
+
+
+ax = p.subplot(111)
+canvas = ax.figure.canvas
+
+
+p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
+p.grid() # to ensure proper background restore
+
+# create the initial line
+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()
+blit_time = 0.0
+
+def update_line(*args):
+ global blit_time
+
+ if update_line.background is None:
+ update_line.background = canvas.copy_from_bbox(ax.bbox)
+
+ # restore the clean slate background
+ canvas.restore_region(update_line.background)
+ # update the data
+ 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
+
+ t = time.time()
+ canvas.blit(ax.bbox)
+ blit_time += time.time() - t
+
+ if update_line.cnt == NBLITS:
+ # print the timing info and quit
+ frame_time = time.time() - tstart
+ print '%d frames: %.2f seconds' % (NBLITS, frame_time)
+ print '%d blits: %.2f seconds' % (NBLITS, blit_time)
+ print
+ print 'FPS: %.2f' % (NBLITS/frame_time)
+ print 'BPS: %.2f' % (NBLITS/blit_time)
+ sys.exit()
+
+ update_line.cnt += 1
+ wx.WakeUpIdle()
+
+
+
+update_line.cnt = 0
+update_line.background = None
+wx.EVT_IDLE(wx.GetApp(), update_line)
+p.show()
Copied: trunk/matplotlib/examples/animation/dynamic_collection.py (from rev 5143, trunk/matplotlib/examples/dynamic_collection.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_collection.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_collection.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,48 @@
+import random
+from matplotlib.collections import RegularPolyCollection
+import matplotlib.cm as cm
+from matplotlib.pyplot import figure, show
+from numpy.random import rand
+
+fig = figure()
+ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
+ax.set_title("Press 'a' to add a point, 'd' to delete one")
+# a single point
+offsets = [(0.5,0.5)]
+facecolors = [cm.jet(0.5)]
+
+collection = RegularPolyCollection(
+ #fig.dpi,
+ 5, # a pentagon
+ rotation=0,
+ sizes=(50,),
+ facecolors = facecolors,
+ edgecolors = 'black',
+ linewidths = (1,),
+ offsets = offsets,
+ transOffset = ax.transData,
+ )
+
+ax.add_collection(collection)
+
+def onpress(event):
+ """
+ press 'a' to add a random point from the collection, 'd' to delete one
+ """
+ if event.key=='a':
+ x,y = rand(2)
+ color = cm.jet(rand())
+ offsets.append((x,y))
+ facecolors.append(color)
+ fig.canvas.draw()
+ elif event.key=='d':
+ N = len(offsets)
+ if N>0:
+ ind = random.randint(0,N-1)
+ offsets.pop(ind)
+ facecolors.pop(ind)
+ fig.canvas.draw()
+
+fig.canvas.mpl_connect('key_press_event', onpress)
+
+show()
Copied: trunk/matplotlib/examples/animation/dynamic_demo_wx.py (from rev 5143, trunk/matplotlib/examples/dynamic_demo_wx.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_demo_wx.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_demo_wx.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+"""
+Copyright (C) Jeremy O'Donoghue, 2003
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+This is a sample showing how to embed a matplotlib figure in a wxPanel,
+and update the contents whenever a timer event occurs. It is inspired
+by the GTK script dynamic_demo.py, by John Hunter (should be supplied with
+this file) but I have assumed that you may wish to embed a figure inside
+your own arbitrary frame, which makes the code slightly more complicated.
+
+It goes without saying that you can update the display on any event, not
+just a timer...
+
+Should you require a toolbar and navigation, inspire yourself from
+embedding_in_wx.py, which provides these features.
+
+Modification History:
+$Log$
+Revision 1.7 2005/06/15 20:24:56 jdh2358
+syncing for 82
+
+Revision 1.6 2004/10/26 18:08:13 astraw
+Converted to use new NavigationToolbar2 (from old Toolbar).
+
+Revision 1.5 2004/06/26 06:37:20 astraw
+Trivial bugfix to eliminate IndexError
+
+Revision 1.4 2004/05/03 12:12:26 jdh2358
+added bang header to examples
+
+Revision 1.3 2004/03/08 22:17:20 jdh2358
+
+* Fixed embedding_in_wx and dynamic_demo_wx examples
+
+* Ported build to darwin
+
+* Tk:
+
+ removed default figman=None from nav toolbar since it needs the
+ figman
+
+ fixed close bug
+
+ small changes to aid darwin build
+
+Revision 1.2 2004/02/26 20:22:58 jaytmiller
+Added the "numerix" Numeric/numarray selector module enabling matplotlib
+to work with either numarray or Numeric. See matplotlib.numerix.__doc__.
+
+Revision 1.1 2003/12/30 17:22:09 jodonoghue
+First version of dynamic_demo for backend_wx
+"""
+
+
+import matplotlib
+matplotlib.use('WX')
+from matplotlib.backends.backend_wx import FigureCanvasWx,\
+ FigureManager, NavigationToolbar2Wx
+
+from matplotlib.figure import Figure
+import numpy
+from wx import *
+
+
+TIMER_ID = NewId()
+
+class PlotFigure(Frame):
+
+ def __init__(self):
+ Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWx(self, -1, self.fig)
+ self.toolbar = NavigationToolbar2Wx(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(Size(fw, th))
+
+ # Create a figure manager to manage things
+ self.figmgr = FigureManager(self.canvas, 1, self)
+ # Now put all into a sizer
+ sizer = BoxSizer(VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, LEFT|TOP|GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ EVT_TIMER(self, TIMER_ID, self.onTimer)
+
+ def init_plot_data(self):
+ a = self.fig.add_subplot(111)
+ self.ind = numpy.arange(60)
+ tmp = []
+ for i in range(60):
+ tmp.append(numpy.sin((self.ind+i)*numpy.pi/15))
+ self.X = numpy.array(tmp)
+ self.lines = a.plot(self.X[:,0],'o')
+ self.count = 0
+
+ def GetToolBar(self):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ self.count += 1
+ if self.count >= 60: self.count = 0
+ self.lines[0].set_data(self.ind, self.X[:,self.count])
+ self.canvas.draw()
+ self.canvas.gui_repaint()
+
+if __name__ == '__main__':
+ app = PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ # Initialise the timer - wxPython requires this to be connected to the
+ # receivicng event handler
+ t = Timer(frame, TIMER_ID)
+ t.Start(100)
+
+ frame.Show()
+ app.MainLoop()
Copied: trunk/matplotlib/examples/animation/dynamic_image_wxagg.py (from rev 5143, trunk/matplotlib/examples/dynamic_image_wxagg.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_image_wxagg.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_image_wxagg.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2003-2004 Jeremy O'Donoghue and others
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+"""
+import sys, time, os, gc
+
+import matplotlib
+matplotlib.use('WXAgg')
+
+from matplotlib import rcParams
+import matplotlib.cm as cm
+
+from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg
+
+from matplotlib.figure import Figure
+import numpy as npy
+import wx
+
+
+TIMER_ID = wx.NewId()
+
+class PlotFigure(wx.Frame):
+
+ def __init__(self):
+ wx.Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
+ self.toolbar = Toolbar(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(wx.Size(fw, th))
+
+ # Initialise the timer - wxPython requires this to be connected to
+ # the receiving event handler
+ self.t = wx.Timer(self, TIMER_ID)
+ self.t.Start(10)
+
+ # Create a figure manager to manage things
+
+ # Now put all into a sizer
+ sizer = wx.BoxSizer(wx.VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, wx.LEFT|wx.TOP|wx.GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, wx.GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ self.Bind(wx.EVT_TIMER, self.onTimer, id=TIMER_ID)
+ self.Bind(wx.EVT_CLOSE, self.onClose)
+
+ def init_plot_data(self):
+ # jdh you can add a subplot directly from the fig rather than
+ # the fig manager
+ a = self.fig.add_subplot(111)
+ self.x = npy.arange(120.0)*2*npy.pi/120.0
+ self.x.resize((100,120))
+ self.y = npy.arange(100.0)*2*npy.pi/100.0
+ self.y.resize((120,100))
+ 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):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ 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
+
+ def onClose(self, evt):
+ self.t.Stop()
+ evt.Skip()
+
+ def onEraseBackground(self, evt):
+ # this is supposed to prevent redraw flicker on some X servers...
+ pass
+
+if __name__ == '__main__':
+ app = wx.PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ frame.Show()
+ app.MainLoop()
Copied: trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py (from rev 5143, trunk/matplotlib/examples/dynamic_image_wxagg2.py)
===================================================================
--- trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py (rev 0)
+++ trunk/matplotlib/examples/animation/dynamic_image_wxagg2.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+"""
+Copyright (C) 2003-2005 Jeremy O'Donoghue and others
+
+License: This work is licensed under the PSF. A copy should be included
+with this source code, and is also available at
+http://www.python.org/psf/license.html
+
+"""
+import sys, time, os, gc
+
+import matplotlib
+matplotlib.use('WXAgg')
+
+from matplotlib import rcParams
+import numpy as npy
+
+import matplotlib.cm as cm
+
+from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
+from matplotlib.backends.backend_wx import NavigationToolbar2Wx
+
+from matplotlib.figure import Figure
+from wx import *
+
+
+TIMER_ID = NewId()
+
+class PlotFigure(Frame):
+
+ def __init__(self):
+ Frame.__init__(self, None, -1, "Test embedded wxFigure")
+
+ self.fig = Figure((5,4), 75)
+ self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
+ self.toolbar = NavigationToolbar2Wx(self.canvas)
+ self.toolbar.Realize()
+
+ # On Windows, default frame size behaviour is incorrect
+ # you don't need this under Linux
+ tw, th = self.toolbar.GetSizeTuple()
+ fw, fh = self.canvas.GetSizeTuple()
+ self.toolbar.SetSize(Size(fw, th))
+
+ # Create a figure manager to manage things
+
+ # Now put all into a sizer
+ sizer = BoxSizer(VERTICAL)
+ # This way of adding to sizer allows resizing
+ sizer.Add(self.canvas, 1, LEFT|TOP|GROW)
+ # Best to allow the toolbar to resize!
+ sizer.Add(self.toolbar, 0, GROW)
+ self.SetSizer(sizer)
+ self.Fit()
+ EVT_TIMER(self, TIMER_ID, self.onTimer)
+
+ def init_plot_data(self):
+ # jdh you can add a subplot directly from the fig rather than
+ # the fig manager
+ a = self.fig.add_axes([0.075,0.1,0.75,0.85])
+ cax = self.fig.add_axes([0.85,0.1,0.075,0.85])
+ self.x = npy.empty((120,120))
+ self.x.flat = npy.arange(120.0)*2*npy.pi/120.0
+ self.y = npy.empty((120,120))
+ self.y.flat = npy.arange(120.0)*2*npy.pi/100.0
+ 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')
+ self.fig.colorbar(self.im,cax=cax,orientation='vertical')
+
+ def GetToolBar(self):
+ # You will need to override GetToolBar if you are using an
+ # unmanaged toolbar in your frame
+ return self.toolbar
+
+ def onTimer(self, evt):
+ 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
+
+ def onEraseBackground(self, evt):
+ # this is supposed to prevent redraw flicker on some X servers...
+ pass
+
+if __name__ == '__main__':
+ app = PySimpleApp()
+ frame = PlotFigure()
+ frame.init_plot_data()
+
+ # Initialise the timer - wxPython requires this to be connected to
+ # the receiving event handler
+ t = Timer(frame, TIMER_ID)
+ t.Start(200)
+
+ frame.Show()
+ app.MainLoop()
+
Deleted: trunk/matplotlib/examples/animation_blit.py
===================================================================
--- trunk/matplotlib/examples/animation_blit.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-
-# For detailed comments on animation and the techniques used here, see
-# the wiki entry
-# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
-import sys
-import time
-
-import gtk, gobject
-
-import matplotlib
-matplotlib.use('GTKAgg')
-import numpy as npy
-import pylab as p
-
-
-ax = p.subplot(111)
-canvas = ax.figure.canvas
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-
-# create the initial line
-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()
-
-def update_line(*args):
- if update_line.background is None:
- update_line.background = canvas.copy_from_bbox(ax.bbox)
-
- # restore the clean slate background
- canvas.restore_region(update_line.background)
- # update the data
- line.set_ydata(npy.sin(x+update_line.cnt/10.0))
- # just draw the animated artist
- try:
- ax.draw_artist(line)
- except AssertionError:
- return
- # just redraw the axes rectangle
- canvas.blit(ax.bbox)
-
- if update_line.cnt==1000:
- # print the timing info and quit
- print 'FPS:' , 1000/(time.time()-tstart)
- sys.exit()
-
- update_line.cnt += 1
- return True
-
-update_line.cnt = 0
-update_line.background = None
-gobject.idle_add(update_line)
-p.show()
Deleted: trunk/matplotlib/examples/animation_blit_fltk.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_fltk.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_fltk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,54 +0,0 @@
-import sys
-import fltk
-import matplotlib
-matplotlib.use('FltkAgg')
-import pylab as p
-import numpy as npy
-import time
-
-
-# save the clean slate background -- everything but the animated line
-# is drawn and saved in the pixel buffer background
-class animator:
- def __init__(self,ax):
- self.ax=ax
- self.canvas=ax.figure.canvas
- self.canvas.mpl_connect('draw_event',self.clear)
- self.cnt=0
- self.background=None
-
- # for profiling
- self.tstart = time.time()
-
- def clear(self,event):
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
-
- def update(self,ptr):
- # restore the clean slate background
- if self.background is None:
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
- self.canvas.restore_region(self.background)
- # update the data
- line.set_ydata(npy.sin(x+self.cnt/10.0))
- # just draw the animated artist
- self.ax.draw_artist(line)
- # just redraw the axes rectangle
- self.canvas.blit(ax.bbox)
- self.cnt+=1
- if self.cnt==1000:
- # print the timing info and quit
- print 'FPS:' , 1000/(time.time()-self.tstart)
- sys.exit()
- return True
-
-ax = p.subplot(111)
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-# create the initial line
-x = npy.arange(0,2*npy.pi,0.01)
-line, = p.plot(x, npy.sin(x), animated=True)
-p.draw()
-anim=animator(ax)
-
-fltk.Fl.add_idle(anim.update)
-fltk.Fl.run()
Deleted: trunk/matplotlib/examples/animation_blit_qt.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_qt.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_qt.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,64 +0,0 @@
-# For detailed comments on animation and the techniqes used here, see
-# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
-
-import os, sys
-import matplotlib
-matplotlib.use('QtAgg') # qt3 example
-
-from qt import *
-# Note: color-intensive applications may require a different color allocation
-# strategy.
-QApplication.setColorSpec(QApplication.NormalColor)
-
-TRUE = 1
-FALSE = 0
-ITERS = 1000
-
-import pylab as p
-import numpy as npy
-import time
-
-class BlitQT(QObject):
- def __init__(self):
- QObject.__init__(self, None, "app")
-
- self.ax = p.subplot(111)
- self.canvas = self.ax.figure.canvas
- self.cnt = 0
-
- # create the initial line
- 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
-
- def timerEvent(self, evt):
- if self.background is None:
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
-
- # restore the clean slate background
- self.canvas.restore_region(self.background)
- # update the data
- 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
- self.canvas.blit(self.ax.bbox)
-
- if self.cnt==ITERS:
- # print the timing info and quit
- print 'FPS:' , ITERS/(time.time()-self.tstart)
- sys.exit()
-
- else:
- self.cnt += 1
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-
-app = BlitQT()
-# for profiling
-app.tstart = time.time()
-app.startTimer(0)
-
-p.show()
Deleted: trunk/matplotlib/examples/animation_blit_qt4.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_qt4.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_qt4.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,68 +0,0 @@
-# For detailed comments on animation and the techniqes used here, see
-# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
-
-import os, sys
-import matplotlib
-matplotlib.use('Qt4Agg') # qt4 example
-
-from PyQt4 import QtCore, QtGui
-
-ITERS = 1000
-
-import pylab as p
-import numpy as npy
-import time
-
-class BlitQT(QtCore.QObject):
- def __init__(self):
- self.ax = p.subplot(111)
- self.canvas = self.ax.figure.canvas
-
- # By making this a child of the canvas we make sure that it is
- # destroyed first and avoids a possible exception when the user clicks
- # on the window's close box.
- QtCore.QObject.__init__(self, self.canvas)
-
- self.cnt = 0
-
- # create the initial line
- 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
- self.old_size = 0, 0
-
- def timerEvent(self, evt):
- # See if the size has changed since last time round.
- current_size = self.ax.bbox.width, self.ax.bbox.height
-
- if self.old_size != current_size:
- self.old_size = current_size
- self.background = self.canvas.copy_from_bbox(self.ax.bbox)
-
- # restore the clean slate background
- self.canvas.restore_region(self.background)
- # update the data
- 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
- self.canvas.blit(self.ax.bbox)
-
- if self.cnt==ITERS:
- # print the timing info and quit
- print 'FPS:' , ITERS/(time.time()-self.tstart)
- sys.exit()
-
- else:
- self.cnt += 1
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-
-app = BlitQT()
-# for profiling
-app.tstart = time.time()
-app.startTimer(0)
-
-p.show()
Deleted: trunk/matplotlib/examples/animation_blit_tk.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_tk.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_tk.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,52 +0,0 @@
-# For detailed comments on animation and the techniqes used here, see
-# the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations
-
-import matplotlib
-matplotlib.use('TkAgg')
-
-import sys
-import pylab as p
-import numpy as npy
-import time
-
-ax = p.subplot(111)
-canvas = ax.figure.canvas
-
-
-# create the initial line
-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)
- # for profiling
- tstart = time.time()
-
- while 1:
- # restore the clean slate background
- canvas.restore_region(background)
- # update the data
- line.set_ydata(npy.sin(x+run.cnt/10.0))
- # just draw the animated artist
- ax.draw_artist(line)
- # just redraw the axes rectangle
- canvas.blit(ax.bbox)
-
- if run.cnt==1000:
- # print the timing info and quit
- print 'FPS:' , 1000/(time.time()-tstart)
- sys.exit()
-
- run.cnt += 1
-run.cnt = 0
-
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-manager = p.get_current_fig_manager()
-manager.window.after(100, run)
-
-p.show()
-
-
-
Deleted: trunk/matplotlib/examples/animation_blit_wx.py
===================================================================
--- trunk/matplotlib/examples/animation_blit_wx.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/animation_blit_wx.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,76 +0,0 @@
-# For detailed comments on animation and the techniqes used here, see
-# the wiki entry
-# http://www.scipy.org/wikis/topical_software/MatplotlibAnimation
-
-# The number of blits() to make before exiting
-NBLITS = 1000
-
-import matplotlib
-matplotlib.use('WXAgg')
-matplotlib.rcParams['toolbar'] = 'None'
-
-import wx
-import sys
-import pylab as p
-import numpy as npy
-import time
-
-
-# allow the user to disable the WXAgg accelerator from the command line
-if '--no-accel' in sys.argv:
- import matplotlib.backends.backend_wxagg
- matplotlib.backends.backend_wxagg._use_accelerator(False)
-
-
-ax = p.subplot(111)
-canvas = ax.figure.canvas
-
-
-p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
-p.grid() # to ensure proper background restore
-
-# create the initial line
-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()
-blit_time = 0.0
-
-def update_line(*args):
- global blit_time
-
- if update_line.background is None:
- update_line.background = canvas.copy_from_bbox(ax.bbox)
-
- # restore the clean slate background
- canvas.restore_region(update_line.background)
- # update the data
- 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
-
- t = time.time()
- canvas.blit(ax.bbox)
- blit_time += time.time() - t
-
- if update_line.cnt == NBLITS:
- # print the timing info and quit
- frame_time = time.time() - tstart
- print '%d frames: %.2f seconds' % (NBLITS, frame_time)
- print '%d blits: %.2f seconds' % (NBLITS, blit_time)
- print
- print 'FPS: %.2f' % (NBLITS/frame_time)
- print 'BPS: %.2f' % (NBLITS/blit_time)
- sys.exit()
-
- update_line.cnt += 1
- wx.WakeUpIdle()
-
-
-
-update_line.cnt = 0
-update_line.background = None
-wx.EVT_IDLE(wx.GetApp(), update_line)
-p.show()
Deleted: trunk/matplotlib/examples/annotation_demo.py
===================================================================
--- trunk/matplotlib/examples/annotation_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/annotation_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,144 +0,0 @@
-"""
-Some examples of how to annotate points in figures. You specify an
-annotation point xy=(x,y) and a text point xytext=(x,y) for the
-annotated points and text location, respectively. Optionally, you can specify the coordinate system of xy and xytext with one of the following strings for xycoords and textcoords (default is 'data')
-
-
- 'figure points' : points from the lower left corner of the figure
- 'figure pixels' : pixels from the lower left corner of the figure
- 'figure fraction' : 0,0 is lower left of figure and 1,1 is upper, right
- 'axes points' : points from lower left corner of axes
- 'axes pixels' : pixels from lower left corner of axes
- 'axes fraction' : 0,1 is lower left of axes and 1,1 is upper right
- 'offset points' : Specify an offset (in points) from the xy value
- 'data' : use the axes data coordinate system
-
-Optionally, you can specify arrow properties which draws and arrow
-from the text to the annotated point by giving a dictionary of arrow
-properties
-
-Valid keys are
-
- width : the width of the arrow in points
- frac : the fraction of the arrow length occupied by the head
- headwidth : the width of the base of the arrow head in points
- shrink : move the tip and base some percent away from the
- annotated point and text
- any key for matplotlib.patches.polygon (eg facecolor)
-
-For physical coordinate systems (points or pixels) the origin is the
-(bottom, left) of the figure or axes. If the value is negative,
-however, the origin is from the (right, top) of the figure or axes,
-analogous to negative indexing of sequences.
-"""
-
-
-from matplotlib.pyplot import figure, show
-from matplotlib.patches import Ellipse
-import numpy as npy
-
-
-if 1:
- # if only one location is given, the text and xypoint being
- # annotated are assumed to be the same
- fig = figure()
- ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1,5), ylim=(-3,5))
-
- t = npy.arange(0.0, 5.0, 0.01)
- s = npy.cos(2*npy.pi*t)
- line, = ax.plot(t, s, lw=3, color='purple')
-
- ax.annotate('axes center', xy=(.5, .5), xycoords='axes fraction',
- horizontalalignment='center', verticalalignment='center')
-
- ax.annotate('pixels', xy=(20, 20), xycoords='figure pixels')
-
- ax.annotate('points', xy=(100, 300), xycoords='figure points')
-
- ax.annotate('offset', xy=(1, 1), xycoords='data',
- xytext=(-15, 10), textcoords='offset points',
- arrowprops=dict(facecolor='black', shrink=0.05),
- horizontalalignment='right', verticalalignment='bottom',
- )
-
- ax.annotate('local max', xy=(3, 1), xycoords='data',
- xytext=(0.8, 0.95), textcoords='axes fraction',
- arrowprops=dict(facecolor='black', shrink=0.05),
- horizontalalignment='right', verticalalignment='top',
- )
-
- ax.annotate('a fractional title', xy=(.025, .975),
- xycoords='figure fraction',
- horizontalalignment='left', verticalalignment='top',
- fontsize=20)
-
- # use negative points or pixels to specify from right, top -10, 10
- # is 10 points to the left of the right side of the axes and 10
- # points above the bottom
- ax.annotate('bottom right (points)', xy=(-10, 10),
- xycoords='axes points',
- horizontalalignment='right', verticalalignment='bottom',
- fontsize=20)
-
- fig.savefig('annotation_coords')
-
-if 1:
- # you can specify the xypoint and the xytext in different
- # positions and coordinate systems, and optionally turn on a
- # connecting line and mark the point with a marker. Annotations
- # work on polar axes too. In the example below, the xy point is
- # in native coordinates (xycoords defaults to 'data'). For a
- # polar axes, this is in (theta, radius) space. The text in this
- # example is placed in the fractional figure coordinate system.
- # Text keyword args like horizontal and vertical alignment are
- # respected
- fig = figure()
- ax = fig.add_subplot(111, polar=True)
- r = npy.arange(0,1,0.001)
- theta = 2*2*npy.pi*r
- line, = ax.plot(theta, r, color='#ee8d18', lw=3)
-
- ind = 800
- thisr, thistheta = r[ind], theta[ind]
- ax.plot([thistheta], [thisr], 'o')
- ax.annotate('a polar annotation',
- xy=(thistheta, thisr), # theta, radius
- xytext=(0.05, 0.05), # fraction, fraction
- textcoords='figure fraction',
- arrowprops=dict(facecolor='black', shrink=0.05),
- horizontalalignment='left',
- verticalalignment='bottom',
- )
- fig.savefig('annotation_polar')
-
-if 1:
- # You can also use polar notation on a catesian axes. Here the
- # native coordinate system ('data') is cartesian, so you need to
- # specify the xycoords and textcoords as 'polar' if you want to
- # use (theta, radius)
-
- el = Ellipse((0,0), 10, 20, facecolor='r', alpha=0.5)
-
- fig = figure()
- ax = fig.add_subplot(111, aspect='equal')
- ax.add_artist(el)
- el.set_clip_box(ax.bbox)
- ax.annotate('the top',
- xy=(npy.pi/2., 10.), # theta, radius
- xytext=(npy.pi/3, 20.), # theta, radius
- xycoords='polar',
- textcoords='polar',
- arrowprops=dict(facecolor='black', shrink=0.05),
- horizontalalignment='left',
- verticalalignment='bottom',
- clip_on=True, # clip to the axes bounding box
- )
-
- ax.set_xlim(-20, 20)
- ax.set_ylim(-20, 20)
- fig.savefig('annotation_ellipse')
-
-
-
-#fig.savefig('annotation_demo.png')
-show()
Deleted: trunk/matplotlib/examples/anscombe.py
===================================================================
--- trunk/matplotlib/examples/anscombe.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/anscombe.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,57 +0,0 @@
-#!/usr/bin/env python
-"""
-Edward Tufte uses this example from Anscombe to show 4 datasets of x
-and y that have the same mean, standard deviation, and regression
-line, but which are qualitatively different.
-
-matplotlib fun for a rainy day
-"""
-
-from pylab import *
-
-x = array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5])
-y1 = array([8.04, 6.95, 7.58, 8.81, 8.33, 9.96, 7.24, 4.26, 10.84, 4.82, 5.68])
-y2 = array([9.14, 8.14, 8.74, 8.77, 9.26, 8.10, 6.13, 3.10, 9.13, 7.26, 4.74])
-y3 = array([7.46, 6.77, 12.74, 7.11, 7.81, 8.84, 6.08, 5.39, 8.15, 6.42, 5.73])
-x4 = array([8,8,8,8,8,8,8,19,8,8,8])
-y4 = array([6.58,5.76,7.71,8.84,8.47,7.04,5.25,12.50,5.56,7.91,6.89])
-
-def fit(x):
- return 3+0.5*x
-
-
-
-xfit = array( [amin(x), amax(x) ] )
-
-subplot(221)
-plot(x,y1,'ks', xfit, fit(xfit), 'r-', lw=2)
-axis([2,20,2,14])
-setp(gca(), xticklabels=[], yticks=(4,8,12), xticks=(0,10,20))
-text(3,12, 'I', fontsize=20)
-
-subplot(222)
-plot(x,y2,'ks', xfit, fit(xfit), 'r-', lw=2)
-axis([2,20,2,14])
-setp(gca(), xticklabels=[], yticks=(4,8,12), yticklabels=[], xticks=(0,10,20))
-text(3,12, 'II', fontsize=20)
-
-subplot(223)
-plot(x,y3,'ks', xfit, fit(xfit), 'r-', lw=2)
-axis([2,20,2,14])
-text(3,12, 'IIII', fontsize=20)
-setp(gca(), yticks=(4,8,12), xticks=(0,10,20))
-
-subplot(224)
-
-xfit = array([amin(x4),amax(x4)])
-plot(x4,y4,'ks', xfit, fit(xfit), 'r-', lw=2)
-axis([2,20,2,14])
-setp(gca(), yticklabels=[], yticks=(4,8,12), xticks=(0,10,20))
-text(3,12, 'IV', fontsize=20)
-
-#verify the stats
-pairs = (x,y1), (x,y2), (x,y3), (x4,y4)
-for x,y in pairs:
- print 'mean=%1.2f, std=%1.2f, r=%1.2f'%(mean(y), std(y), corrcoef(x,y)[0][1])
-
-show()
Deleted: trunk/matplotlib/examples/arctest.py
===================================================================
--- trunk/matplotlib/examples/arctest.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/arctest.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,18 +0,0 @@
-#!/usr/bin/env python
-from pylab import *
-
-def f(t):
- 'a damped exponential'
- s1 = cos(2*pi*t)
- e1 = exp(-t)
- return multiply(s1,e1)
-
-t1 = arange(0.0, 5.0, .2)
-
-
-l = plot(t1, f(t1), 'ro')
-setp(l, 'markersize', 30)
-setp(l, 'markerfacecolor', 'b')
-#savefig('arctest', dpi=150)
-show()
-
Deleted: trunk/matplotlib/examples/arrow_demo.py
===================================================================
--- trunk/matplotlib/examples/arrow_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/arrow_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,313 +0,0 @@
-#!/usr/bin/env python
-"""Arrow drawing example for the new fancy_arrow facilities.
-
-Code contributed by: Rob Knight <rob@...>
-
-usage:
-
- python arrow_demo.py realistic|full|sample|extreme
-
-
-"""
-from pylab import *
-
-rates_to_bases={'r1':'AT', 'r2':'TA', 'r3':'GA','r4':'AG','r5':'CA','r6':'AC', \
- 'r7':'GT', 'r8':'TG', 'r9':'CT','r10':'TC','r11':'GC','r12':'CG'}
-numbered_bases_to_rates = dict([(v,k) for k, v in rates_to_bases.items()])
-lettered_bases_to_rates = dict([(v, 'r'+v) for k, v in rates_to_bases.items()])
-def add_dicts(d1, d2):
- """Adds two dicts and returns the result."""
- result = d1.copy()
- result.update(d2)
- return result
-
-def make_arrow_plot(data, size=4, display='length', shape='right', \
- max_arrow_width=0.03, arrow_sep = 0.02, alpha=0.5, \
- normalize_data=False, ec=None, labelcolor=None, \
- head_starts_at_zero=True, rate_labels=lettered_bases_to_rates,\
- **kwargs):
- """Makes an arrow plot.
-
- Parameters:
-
- data: dict with probabilities for the bases and pair transitions.
- size: size of the graph in inches.
- display: 'length', 'width', or 'alpha' for arrow property to change.
- shape: 'full', 'left', or 'right' for full or half arrows.
- max_arrow_width: maximum width of an arrow, data coordinates.
- arrow_sep: separation between arrows in a pair, data coordinates.
- alpha: maximum opacity of arrows, default 0.8.
-
- **kwargs can be anything allowed by a Arrow object, e.g.
- linewidth and edgecolor.
- """
-
- xlim(-0.5,1.5)
- ylim(-0.5,1.5)
- gcf().set_size_inches(size,size)
- xticks([])
- yticks([])
- max_text_size = size*12
- min_text_size = size
- label_text_size = size*2.5
- text_params={'ha':'center', 'va':'center', 'family':'sans-serif',\
- 'fontweight':'bold'}
- r2 = sqrt(2)
-
- deltas = {\
- 'AT':(1,0),
- 'TA':(-1,0),
- 'GA':(0,1),
- 'AG':(0,-1),
- 'CA':(-1/r2, 1/r2),
- 'AC':(1/r2, -1/r2),
- 'GT':(1/r2, 1/r2),
- 'TG':(-1/r2,-1/r2),
- 'CT':(0,1),
- 'TC':(0,-1),
- 'GC':(1,0),
- 'CG':(-1,0)
- }
-
- colors = {\
- 'AT':'r',
- 'TA':'k',
- 'GA':'g',
- 'AG':'r',
- 'CA':'b',
- 'AC':'r',
- 'GT':'g',
- 'TG':'k',
- 'CT':'b',
- 'TC':'k',
- 'GC':'g',
- 'CG':'b'
- }
-
- label_positions = {\
- 'AT':'center',
- 'TA':'center',
- 'GA':'center',
- 'AG':'center',
- 'CA':'left',
- 'AC':'left',
- 'GT':'left',
- 'TG':'left',
- 'CT':'center',
- 'TC':'center',
- 'GC':'center',
- 'CG':'center'
- }
-
-
- def do_fontsize(k):
- return float(clip(max_text_size*sqrt(data[k]),\
- min_text_size,max_text_size))
-
- A = text(0,1, '$A_3$', color='r', size=do_fontsize('A'), **text_params)
- T = text(1,1, '$T_3$', color='k', size=do_fontsize('T'), **text_params)
- G = text(0,0, '$G_3$', color='g', size=do_fontsize('G'), **text_params)
- C = text(1,0, '$C_3$', color='b', size=do_fontsize('C'), **text_params)
-
- arrow_h_offset = 0.25 #data coordinates, empirically determined
- max_arrow_length = 1 - 2*arrow_h_offset
-
- max_arrow_width = max_arrow_width
- max_head_width = 2.5*max_arrow_width
- max_head_length = 2*max_arrow_width
- arrow_params={'length_includes_head':True, 'shape':shape, \
- 'head_starts_at_zero':head_starts_at_zero}
- ax = gca()
- sf = 0.6 #max arrow size represents this in data coords
-
- d = (r2/2 + arrow_h_offset - 0.5)/r2 #distance for diags
- r2v = arrow_sep/r2 #offset for diags
-
- #tuple of x, y for start position
- positions = {\
- 'AT': (arrow_h_offset, 1+arrow_sep),
- 'TA': (1-arrow_h_offset, 1-arrow_sep),
- 'GA': (-arrow_sep, arrow_h_offset),
- 'AG': (arrow_sep, 1-arrow_h_offset),
- 'CA': (1-d-r2v, d-r2v),
- 'AC': (d+r2v, 1-d+r2v),
- 'GT': (d-r2v, d+r2v),
- 'TG': (1-d+r2v, 1-d-r2v),
- 'CT': (1-arrow_sep, arrow_h_offset),
- 'TC': (1+arrow_sep, 1-arrow_h_offset),
- 'GC': (arrow_h_offset, arrow_sep),
- 'CG': (1-arrow_h_offset, -arrow_sep),
- }
-
- if normalize_data:
- #find maximum value for rates, i.e. where keys are 2 chars long
- max_val = 0
- for k, v in data.items():
- if len(k) == 2:
- max_val = max(max_val, v)
- #divide rates by max val, multiply by arrow scale factor
- for k, v in data.items():
- data[k] = v/max_val*sf
-
- def draw_arrow(pair, alpha=alpha, ec=ec, labelcolor=labelcolor):
- #set the length of the arrow
- if display == 'length':
- length = max_head_length+(max_arrow_length-max_head_length)*\
- data[pair]/sf
- else:
- length = max_arrow_length
- #set the transparency of the arrow
- if display == 'alph':
- alpha = min(data[pair]/sf, alpha)
- else:
- alpha=alpha
- #set the width of the arrow
- if display == 'width':
- scale = data[pair]/sf
- width = max_arrow_width*scale
- head_width = max_head_width*scale
- head_length = max_head_length*scale
- else:
- width = max_arrow_width
- head_width = max_head_width
- head_length = max_head_length
-
- fc = colors[pair]
- ec = ec or fc
-
- x_scale, y_scale = deltas[pair]
- x_pos, y_pos = positions[pair]
- arrow(x_pos, y_pos, x_scale*length, y_scale*length, \
- fc=fc, ec=ec, alpha=alpha, width=width, head_width=head_width, \
- head_length=head_length, **arrow_params)
-
- #figure out coordinates for text
- #if drawing relative to base: x and y are same as for arrow
- #dx and dy are one arrow width left and up
- #need to rotate based on direction of arrow, use x_scale and y_scale
- #as sin x and cos x?
- sx, cx = y_scale, x_scale
-
- where = label_positions[pair]
- if where == 'left':
- orig_position = 3*array([[max_arrow_width, max_arrow_width]])
- elif where == 'absolute':
- orig_position = array([[max_arrow_length/2.0, 3*max_arrow_width]])
- elif where == 'right':
- orig_position = array([[length-3*max_arrow_width,\
- 3*max_arrow_width]])
- elif where == 'center':
- orig_position = array([[length/2.0, 3*max_arrow_width]])
- else:
- raise ValueError, "Got unknown position parameter %s" % where
-
-
-
- M = array([[cx, sx],[-sx,cx]])
- coords = dot(orig_position, M) + [[x_pos, y_pos]]
- x, y = ravel(coords)
- orig_label = rate_labels[pair]
- label = '$%s_{_{\mathrm{%s}}}$' % (orig_label[0], orig_label[1:])
-
- text(x, y, label, size=label_text_size, ha='center', va='center', \
- color=labelcolor or fc)
-
- for p in positions.keys():
- draw_arrow(p)
-
- #test data
-all_on_max = dict([(i, 1) for i in 'TCAG'] + \
- [(i+j, 0.6) for i in 'TCAG' for j in 'TCAG'])
-
-realistic_data = {
- 'A':0.4,
- 'T':0.3,
- 'G':0.5,
- 'C':0.2,
- 'AT':0.4,
- 'AC':0.3,
- 'AG':0.2,
- 'TA':0.2,
- 'TC':0.3,
- 'TG':0.4,
- 'CT':0.2,
- 'CG':0.3,
- 'CA':0.2,
- 'GA':0.1,
- 'GT':0.4,
- 'GC':0.1,
- }
-
-extreme_data = {
- 'A':0.75,
- 'T':0.10,
- 'G':0.10,
- 'C':0.05,
- 'AT':0.6,
- 'AC':0.3,
- 'AG':0.1,
- 'TA':0.02,
- 'TC':0.3,
- 'TG':0.01,
- 'CT':0.2,
- 'CG':0.5,
- 'CA':0.2,
- 'GA':0.1,
- 'GT':0.4,
- 'GC':0.2,
- }
-
-sample_data = {
- 'A':0.2137,
- 'T':0.3541,
- 'G':0.1946,
- 'C':0.2376,
- 'AT':0.0228,
- 'AC':0.0684,
- 'AG':0.2056,
- 'TA':0.0315,
- 'TC':0.0629,
- 'TG':0.0315,
- 'CT':0.1355,
- 'CG':0.0401,
- 'CA':0.0703,
- 'GA':0.1824,
- 'GT':0.0387,
- 'GC':0.1106,
- }
-
-
-if __name__ == '__main__':
- from sys import argv
- d = None
- if len(argv) > 1:
- if argv[1] == 'full':
- d = all_on_max
- scaled = False
- elif argv[1] == 'extreme':
- d = extreme_data
- scaled = False
- elif argv[1] == 'realistic':
- d = realistic_data
- scaled = False
- elif argv[1] == 'sample':
- d = sample_data
- scaled = True
- if d is None:
- d = all_on_max
- scaled=False
- if len(argv) > 2:
- display = argv[2]
- else:
- display = 'length'
-
- size = 4
- figure(figsize=(size,size))
-
- make_arrow_plot(d, display=display, linewidth=0.001, edgecolor=None,
- normalize_data=scaled, head_starts_at_zero=True, size=size)
-
- draw()
- #savefig('arrows.png')
- #print 'Example saved to file "arrows.png"'
- show()
Deleted: trunk/matplotlib/examples/auto_layout.py
===================================================================
--- trunk/matplotlib/examples/auto_layout.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/auto_layout.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-"""
-Example: simple line plot.
-Show how to make and save a simple line plot with labels, title and grid
-"""
-from pylab import *
-
-t = arange(0.0, 1.0+0.01, 0.01)
-s = cos(2*2*pi*t)
-ax1 = subplot(211)
-plot(t, s, '-', lw=2)
-
-xlabel('xlabel for top axes')
-ylabel('ylabel on the right')
-title('About as simple as it gets, folks')
-grid(True)
-ax1.yaxis.set_label_position('right')
-ax1.xaxis.set_ticklabels(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'])
-for label in ax1.get_xticklabels():
- label.set_rotation(45)
-
-ax2 = subplot(212)
-plot(t, s, '-', lw=2)
-grid(True)
-xlabel('xlabel for bottom axes (the ticks are on the top for no good reason)')
-ylabel('I\'m a lefty')
-ax2.xaxis.set_label_position('bottom')
-ax2.xaxis.set_ticks_position('top')
-
-
-#savefig('simple_plot.png')
-savefig('simple_plot')
-
-show()
Deleted: trunk/matplotlib/examples/axes_demo.py
===================================================================
--- trunk/matplotlib/examples/axes_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/axes_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-from pylab import *
-
-# create some data to use for the plot
-dt = 0.001
-t = arange(0.0, 10.0, dt)
-r = exp(-t[:1000]/0.05) # impulse response
-x = randn(len(t))
-s = convolve(x,r)[:len(x)]*dt # colored noise
-
-# the main axes is subplot(111) by default
-plot(t, s)
-axis([0, 1, 1.1*amin(s), 2*amax(s) ])
-xlabel('time (s)')
-ylabel('current (nA)')
-title('Gaussian colored noise')
-
-# this is an inset axes over the main axes
-a = axes([.65, .6, .2, .2], axisbg='y')
-n, bins, patches = hist(s, 400, normed=1)
-title('Probability')
-setp(a, xticks=[], yticks=[])
-
-# this is another inset axes over the main axes
-a = axes([0.2, 0.6, .2, .2], axisbg='y')
-plot(t[:len(r)], r)
-title('Impulse response')
-setp(a, xlim=(0,.2), xticks=[], yticks=[])
-
-#savefig('../figures/axes_demo.eps')
-#savefig('../figures/axes_demo.png')
-show()
Deleted: trunk/matplotlib/examples/axes_props.py
===================================================================
--- trunk/matplotlib/examples/axes_props.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/axes_props.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-"""
-You can control the axis tick and grid properties
-"""
-
-from pylab import *
-
-t = arange(0.0, 2.0, 0.01)
-s = sin(2*pi*t)
-plot(t, s)
-grid(True)
-
-# matlab handle graphics style
-xticklines = getp(gca(), 'xticklines')
-yticklines = getp(gca(), 'yticklines')
-xgridlines = getp(gca(), 'xgridlines')
-ygridlines = getp(gca(), 'ygridlines')
-xticklabels = getp(gca(), 'xticklabels')
-yticklabels = getp(gca(), 'yticklabels')
-
-setp(xticklines, 'linewidth', 3)
-setp(yticklines, 'linewidth', 3)
-setp(xgridlines, 'linestyle', '-')
-setp(ygridlines, 'linestyle', '-')
-setp(yticklabels, 'color', 'r', fontsize='medium')
-setp(xticklabels, 'color', 'r', fontsize='medium')
-
-
-#savefig('axprops_demo')
-show()
-
-
-"""
-# the same script, python style
-from pylab import *
-
-t = arange(0.0, 2.0, 0.01)
-s = sin(2*pi*t)
-ax = subplot(111)
-ax.plot(t, s)
-ax.grid(True)
-
-ticklines = ax.get_xticklines()
-ticklines.extend( ax.get_yticklines() )
-gridlines = ax.get_xgridlines()
-gridlines.extend( ax.get_ygridlines() )
-ticklabels = ax.get_xticklabels()
-ticklabels.extend( ax.get_yticklabels() )
-
-for line in ticklines:
- line.set_linewidth(3)
-
-for line in gridlines:
- line.set_linestyle('-')
-
-for label in ticklabels:
- label.set_color('r')
- label.set_fontsize('medium')
-
-#savefig('axprops_demo')
-show()
-
-"""
Deleted: trunk/matplotlib/examples/axhspan_demo.py
===================================================================
--- trunk/matplotlib/examples/axhspan_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/axhspan_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,40 +0,0 @@
-#!/usr/bin/env python
-
-from pylab import *
-figure(1)
-plot(10*rand(12), 'o')
-xlim(0,15)
-xticks([2, 4, 8, 12], ('John', 'Hunter', 'Was', 'Here'))
-
-ylim(-1,10)
-yticks(range(8))
-
-figure(2)
-t = arange(-1,2, .01)
-s = sin(2*pi*t)
-plot(t,s)
-# draw a thick red hline at y=0 that spans the xrange
-l = axhline(linewidth=4, color='r')
-
-# draw a default hline at y=1 that spans the xrange
-l = axhline(y=1)
-
-# draw a default vline at x=1 that spans the xrange
-l = axvline(x=1)
-
-# draw a thick blue vline at x=0 that spans the the upper quadrant of
-# the yrange
-l = axvline(x=0, ymin=0.75, linewidth=4, color='b')
-
-# draw a default hline at y=.5 that spans the the middle half of
-# the axes
-l = axhline(y=.5, xmin=0.25, xmax=0.75)
-
-p = axhspan(0.25, 0.75, facecolor='0.5', alpha=0.5)
-
-p = axvspan(1.25, 1.55, facecolor='g', alpha=0.5)
-
-axis([-1,2,-1,2])
-
-
-show()
Deleted: trunk/matplotlib/examples/axis_equal_demo.py
===================================================================
--- trunk/matplotlib/examples/axis_equal_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/axis_equal_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,36 +0,0 @@
-'''This example is only interesting when ran in interactive mode'''
-
-from pylab import *
-
-# Plot circle or radius 3
-
-an = linspace(0,2*pi,100)
-
-subplot(221)
-plot( 3*cos(an), 3*sin(an) )
-title('not equal, looks like ellipse',fontsize=10)
-
-subplot(222)
-plot( 3*cos(an), 3*sin(an) )
-axis('equal')
-title('equal, looks like circle',fontsize=10)
-
-subplot(223)
-plot( 3*cos(an), 3*sin(an) )
-axis('equal')
-axis([-3,3,-3,3])
-title('looks like circle, even after changing limits',fontsize=10)
-
-subplot(224)
-plot( 3*cos(an), 3*sin(an) )
-axis('equal')
-axis([-3,3,-3,3])
-plot([0,4],[0,4])
-title('still equal after adding line',fontsize=10)
-
-show()
-
-
-
-
-
Deleted: trunk/matplotlib/examples/backend_driver.py
===================================================================
--- trunk/matplotlib/examples/backend_driver.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/backend_driver.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,223 +0,0 @@
-#!/usr/bin/env python
-"""
-This is used to drive many of the examples across the backends, for
-regression testing, and comparing backend efficiency.
-
-The script takes one or more arguments specifying backends
-to be tested, e.g.
-
- python backend_driver.py agg ps cairo.png cairo.ps
-
-would test the agg and ps backends, and the cairo backend with
-output to png and ps files.
-
-If no arguments are given, a default list of backends will be
-tested.
-"""
-
-from __future__ import division
-import os, time, sys
-import matplotlib.backends as mplbe
-
-files = (
- 'alignment_test.py',
- 'arctest.py',
- 'arrow_demo.py',
- 'auto_layout.py',
- 'axes_demo.py',
- 'axhspan_demo.py',
- 'bar_stacked.py',
- 'barchart_demo.py',
- 'boxplot_demo.py',
- 'broken_barh.py',
- 'barh_demo.py',
- 'color_demo.py',
- 'colorbar_only.py',
- 'cohere_demo.py',
- 'contour_demo.py',
- 'contourf_demo.py',
- 'csd_demo.py',
- 'custom_ticker1.py',
- 'customize_rc.py',
- 'date_demo1.py',
- 'date_demo2.py',
- 'equal_aspect_ratio.py',
- 'errorbar_limits.py',
- 'figimage_demo.py',
- 'figlegend_demo.py',
- 'figtext.py',
- 'fill_demo.py',
- 'finance_demo.py',
- 'fonts_demo_kw.py',
- 'hexbin_demo.py',
- 'histogram_demo.py',
- 'hline_demo.py',
- 'image_demo.py',
- 'image_demo2.py',
- 'image_masked.py',
- 'image_origin.py',
- 'invert_axes.py',
- 'layer_images.py',
- 'legend_auto.py',
- 'legend_demo.py',
- 'legend_demo2.py',
- 'line_collection.py',
- 'line_collection2.py',
- 'line_styles.py',
- 'log_demo.py',
- 'log_test.py',
- 'major_minor_demo1.py',
- 'major_minor_demo2.py',
- 'masked_demo.py',
- 'mathtext_demo.py',
- 'mri_with_eeg.py',
- 'multiple_figs_demo.py',
- 'nan_test.py',
- 'pcolor_demo.py',
- 'pcolor_demo2.py',
- 'pcolor_small.py',
- 'pie_demo.py',
- 'polar_demo.py',
- 'polar_scatter.py',
- 'psd_demo.py',
- 'quadmesh_demo.py',
- 'quiver_demo.py',
- 'scatter_demo.py',
- 'scatter_demo2.py',
- 'scatter_star_poly.py',
- 'shared_axis_demo.py',
- 'shared_axis_across_figures.py',
- 'simple_plot.py',
- 'specgram_demo.py',
- 'spy_demos.py',
- 'stem_plot.py',
- 'step_demo.py',
- 'stock_demo.py',
- 'subplot_demo.py',
-# 'set_and_get.py',
- 'table_demo.py',
- 'text_handles.py',
- 'text_rotation.py',
- 'text_themes.py',
-# 'tex_demo.py',
- 'two_scales.py',
- 'unicode_demo.py',
- 'vline_demo.py',
- 'xcorr_demo.py',
- 'zorder_demo.py',
- )
-
-
-# tests known to fail on a given backend
-
-failbackend = dict(
- SVG = ('tex_demo.py,'),
- )
-
-try:
- import subprocess
- def run(arglist):
- try:
- subprocess.call(arglist)
- except KeyboardInterrupt:
- sys.exit()
-except ImportError:
- def run(arglist):
- os.system(' '.join(arglist))
-
-def drive(backend, python=['python'], switches = []):
- exclude = failbackend.get(backend, [])
-
- # Clear the destination directory for the examples
- path = backend
- if os.path.exists(path):
- import glob
- for fname in os.listdir(path):
- os.unlink(os.path.join(path,fname))
- else:
- os.mkdir(backend)
-
- for fname in files:
- if fname in exclude:
- print '\tSkipping %s, known to fail on backend: %s'%backend
- continue
-
- print ('\tdriving %-40s' % (fname)),
- sys.stdout.flush()
- basename, ext = os.path.splitext(fname)
- outfile = os.path.join(path,basename)
- tmpfile_name = '_tmp_%s.py' % basename
- tmpfile = file(tmpfile_name, 'w')
-
- for line in file(fname):
- line_lstrip = line.lstrip()
- if line_lstrip.startswith("#"):
- tmpfile.write(line)
- else:
- break
-
- tmpfile.writelines((
- 'from __future__ import division\n',
- 'import matplotlib\n',
- 'matplotlib.use("%s")\n' % backend,
- 'from pylab import savefig\n',
- ))
- for line in file(fname):
- line_lstrip = line.lstrip()
- if (line_lstrip.startswith('from __future__ import division') or
- line_lstrip.startswith('matplotlib.use') or
- line_lstrip.startswith('savefig') or
- line_lstrip.startswith('show')):
- continue
- tmpfile.write(line)
- if backend in mplbe.interactive_bk:
- tmpfile.write('show()')
- else:
- tmpfile.write('savefig("%s", dpi=150)' % outfile)
-
- tmpfile.close()
- start_time = time.time()
- program = [x % {'name': basename} for x in python]
- run(program + [tmpfile_name, switchstring])
- end_time = time.time()
- print (end_time - start_time)
- #os.system('%s %s %s' % (python, tmpfile_name, switchstring))
- os.remove(tmpfile_name)
-
-if __name__ == '__main__':
- times = {}
- default_backends = ['Agg', 'PS', 'SVG', 'PDF', 'Template']
- if '--coverage' in sys.argv:
- python = ['coverage.py', '-x']
- sys.argv.remove('--coverage')
- elif '--valgrind' in sys.argv:
- python = ['valgrind', '--tool=memcheck', '--leak-check=yes',
- '--log-file=%(name)s', 'python']
- sys.argv.remove('--valgrind')
- elif sys.platform == 'win32':
- python = [r'c:\Python24\python.exe']
- else:
- python = ['python']
- all_backends = [b.lower() for b in mplbe.all_backends]
- all_backends.extend(['cairo.png', 'cairo.ps', 'cairo.pdf', 'cairo.svg'])
- backends = []
- switches = []
- if sys.argv[1:]:
- backends = [b.lower() for b in sys.argv[1:] if b.lower() in all_backends]
- switches = [s for s in sys.argv[1:] if s.startswith('--')]
- if not backends:
- backends = default_backends
- for backend in backends:
- switchstring = ' '.join(switches)
- print 'testing %s %s' % (backend, switchstring)
- t0 = time.time()
- drive(backend, python, switches)
- t1 = time.time()
- times[backend] = (t1-t0)/60.0
-
- # print times
- for backend, elapsed in times.items():
- print 'Backend %s took %1.2f minutes to complete' % ( backend, elapsed)
- if 'Template' in times:
- print '\ttemplate ratio %1.3f, template residual %1.3f' % (
- elapsed/times['Template'], elapsed-times['Template'])
Deleted: trunk/matplotlib/examples/bar_stacked.py
===================================================================
--- trunk/matplotlib/examples/bar_stacked.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/bar_stacked.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-# a stacked bar plot with errorbars
-from pylab import *
-
-N = 5
-menMeans = (20, 35, 30, 35, 27)
-womenMeans = (25, 32, 34, 20, 25)
-menStd = (2, 3, 4, 1, 2)
-womenStd = (3, 5, 2, 3, 3)
-ind = arange(N) # the x locations for the groups
-width = 0.35 # the width of the bars: can also be len(x) sequence
-
-p1 = bar(ind, menMeans, width, color='r', yerr=womenStd)
-p2 = bar(ind, womenMeans, width, color='y',
- bottom=menMeans, yerr=menStd)
-
-ylabel('Scores')
-title('Scores by group and gender')
-xticks(ind+width/2., ('G1', 'G2', 'G3', 'G4', 'G5') )
-yticks(arange(0,81,10))
-legend( (p1[0], p2[0]), ('Men', 'Women') )
-
-show()
Deleted: trunk/matplotlib/examples/barchart_demo.py
===================================================================
--- trunk/matplotlib/examples/barchart_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/barchart_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,39 +0,0 @@
-
-#!/usr/bin/env python
-# a bar plot with errorbars
-import numpy as np
-import matplotlib.pyplot as plt
-
-N = 5
-menMeans = (20, 35, 30, 35, 27)
-menStd = (2, 3, 4, 1, 2)
-
-ind = np.arange(N) # the x locations for the groups
-width = 0.35 # the width of the bars
-
-fig = plt.figure()
-ax = fig.add_subplot(111)
-rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)
-
-womenMeans = (25, 32, 34, 20, 25)
-womenStd = (3, 5, 2, 3, 3)
-rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)
-
-# add some
-ax.set_ylabel('Scores')
-ax.set_title('Scores by group and gender')
-ax.set_xticks(ind+width, ('G1', 'G2', 'G3', 'G4', 'G5') )
-
-ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') )
-
-def autolabel(rects):
- # attach some text labels
- for rect in rects:
- height = rect.get_height()
- ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
- ha='center', va='bottom')
-
-autolabel(rects1)
-autolabel(rects2)
-#fig.savefig('barchart_demo')
-plt.show()
Deleted: trunk/matplotlib/examples/barcode_demo.py
===================================================================
--- trunk/matplotlib/examples/barcode_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/barcode_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,25 +0,0 @@
-from matplotlib.pyplot import figure, show, cm
-from numpy import where
-from numpy.random import rand
-
-# the bar
-x = where(rand(500)>0.7, 1.0, 0.0)
-
-axprops = dict(xticks=[], yticks=[])
-barprops = dict(aspect='auto', cmap=cm.binary, interpolation='nearest')
-
-fig = figure()
-
-# a vertical barcode -- this is broken at present
-x.shape = len(x), 1
-ax = fig.add_axes([0.1, 0.3, 0.1, 0.6], **axprops)
-ax.imshow(x, **barprops)
-
-# a horizontal barcode
-x.shape = 1, len(x)
-ax = fig.add_axes([0.3, 0.1, 0.6, 0.1], **axprops)
-ax.imshow(x, **barprops)
-
-fig.savefig('barcode.png', dpi=100)
-show()
-
Deleted: trunk/matplotlib/examples/barh_demo.py
===================================================================
--- trunk/matplotlib/examples/barh_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/barh_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-# make a horizontal bar chart
-
-from pylab import *
-val = 3+10*rand(5) # the bar lengths
-pos = arange(5)+.5 # the bar centers on the y axis
-
-figure(1)
-barh(pos,val, align='center')
-yticks(pos, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
-xlabel('Perfomance')
-title('How fast do you want to go today?')
-grid(True)
-
-figure(2)
-barh(pos,val, xerr=rand(5), ecolor='r', align='center')
-yticks(pos, ('Tom', 'Dick', 'Harry', 'Slim', 'Jim'))
-xlabel('Perfomance')
-
-show()
Deleted: trunk/matplotlib/examples/boxplot_demo.py
===================================================================
--- trunk/matplotlib/examples/boxplot_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/boxplot_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,65 +0,0 @@
-#!/usr/bin/python
-
-#
-# Example boxplot code
-#
-
-from pylab import *
-
-# fake up some data
-spread= rand(50) * 100
-center = ones(25) * 50
-flier_high = rand(10) * 100 + 100
-flier_low = rand(10) * -100
-data =concatenate((spread, center, flier_high, flier_low), 0)
-
-# basic plot
-boxplot(data)
-#savefig('box1')
-
-# notched plot
-figure()
-boxplot(data,1)
-#savefig('box2')
-
-# change outlier point symbols
-figure()
-boxplot(data,0,'gD')
-#savefig('box3')
-
-# don't show outlier points
-figure()
-boxplot(data,0,'')
-#savefig('box4')
-
-# horizontal boxes
-figure()
-boxplot(data,0,'rs',0)
-#savefig('box5')
-
-# change whisker length
-figure()
-boxplot(data,0,'rs',0,0.75)
-#savefig('box6')
-
-# fake up some more data
-spread= rand(50) * 100
-center = ones(25) * 40
-flier_high = rand(10) * 100 + 100
-flier_low = rand(10) * -100
-d2 = concatenate( (spread, center, flier_high, flier_low), 0 )
-data.shape = (-1, 1)
-d2.shape = (-1, 1)
-#data = concatenate( (data, d2), 1 )
-# Making a 2-D array only works if all the columns are the
-# same length. If they are not, then use a list instead.
-# This is actually more efficient because boxplot converts
-# a 2-D array into a list of vectors internally anyway.
-data = [data, d2, d2[::2,0]]
-# multiple box plots on one figure
-figure()
-boxplot(data)
-#savefig('box7')
-
-show()
-
Deleted: trunk/matplotlib/examples/break.py
===================================================================
--- trunk/matplotlib/examples/break.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/break.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-from pylab import *
-
-
-gcf().text(0.5, 0.95,
- 'Distance Histograms by Category is a really long title')
-
-show()
Deleted: trunk/matplotlib/examples/broken_barh.py
===================================================================
--- trunk/matplotlib/examples/broken_barh.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/broken_barh.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,25 +0,0 @@
-
-"""
-Make a "broken" horizontal bar plot, ie one with gaps
-"""
-from matplotlib.pyplot import figure, show
-
-fig = figure()
-ax = fig.add_subplot(111)
-ax.broken_barh([ (110, 30), (150, 10) ] , (10, 9), facecolors='blue')
-ax.broken_barh([ (10, 50), (100, 20), (130, 10)] , (20, 9),
- facecolors=('red', 'yellow', 'green'))
-ax.set_ylim(5,35)
-ax.set_xlim(0,200)
-ax.set_xlabel('seconds since start')
-ax.set_yticks([15,25])
-ax.set_yticklabels(['Bill', 'Jim'])
-ax.grid(True)
-ax.annotate('race interrupted', (61, 25),
- xytext=(0.8, 0.9), textcoords='axes fraction',
- arrowprops=dict(facecolor='black', shrink=0.05),
- fontsize=16,
- horizontalalignment='right', verticalalignment='top')
-
-fig.savefig('broken_barh', dpi=100)
-show()
Deleted: trunk/matplotlib/examples/clippedline.py
===================================================================
--- trunk/matplotlib/examples/clippedline.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/clippedline.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,54 +0,0 @@
-"""
-Clip a line according to the current xlimits, and change the marker
-style when zoomed in
-"""
-
-from matplotlib.lines import Line2D
-import numpy as npy
-from pylab import figure, show
-
-class ClippedLine(Line2D):
- """
- Clip the xlimits to the axes view limits -- this example assumes x is sorted
- """
-
- def __init__(self, ax, *args, **kwargs):
- Line2D.__init__(self, *args, **kwargs)
- self.ax = ax
-
-
- def set_data(self, *args, **kwargs):
- Line2D.set_data(self, *args, **kwargs)
- self.xorig = npy.array(self._x)
- self.yorig = npy.array(self._y)
-
- def draw(self, renderer):
- xlim = self.ax.get_xlim()
-
- ind0, ind1 = npy.searchsorted(self.xorig, xlim)
- self._x = self.xorig[ind0:ind1]
- self._y = self.yorig[ind0:ind1]
- N = len(self._x)
- if N<1000:
- self._marker = 's'
- self._linestyle = '-'
- else:
- self._marker = None
- self._linestyle = '-'
-
-
- Line2D.draw(self, renderer)
-
-
-fig = figure()
-ax = fig.add_subplot(111, autoscale_on=False)
-
-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)
-ax.set_ylim(-1.1,1.1)
-show()
-
-
Deleted: trunk/matplotlib/examples/cohere_demo.py
===================================================================
--- trunk/matplotlib/examples/cohere_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/cohere_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-"""
-Compute the coherence of two signals
-"""
-import numpy as n
-
-from pylab import figure, show
-
-dt = 0.01
-t = n.arange(0, 30, dt)
-Nt = len(t)
-nse1 = n.random.randn(Nt) # white noise 1
-nse2 = n.random.randn(Nt) # white noise 2
-r = n.exp(-t/0.05)
-
-cnse1 = n.convolve(nse1, r)*dt # colored noise 1
-cnse1 = cnse1[:Nt]
-cnse2 = n.convolve(nse2, r)*dt # colored noise 2
-cnse2 = cnse2[:Nt]
-
-# two signals with a coherent part and a random part
-s1 = 0.01*n.sin(2*n.pi*10*t) + cnse1
-s2 = 0.01*n.sin(2*n.pi*10*t) + cnse2
-
-fig = figure()
-ax = fig.add_subplot(211)
-ax.plot(t, s1, 'b-', t, s2, 'g-')
-ax.set_xlim(0,5)
-ax.set_xlabel('time')
-ax.set_ylabel('s1 and s2')
-
-ax = fig.add_subplot(212)
-cxy, f = ax.cohere(s1, s2, 256, 1./dt)
-
-show()
-
-
Deleted: trunk/matplotlib/examples/collections_demo.py
===================================================================
--- trunk/matplotlib/examples/collections_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/collections_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,132 +0,0 @@
-#!/usr/bin/env python
-'''Demonstration of LineCollection, PolyCollection, and
-RegularPolyCollection with autoscaling.
-
-For the first two subplots, we will use spirals. Their
-size will be set in plot units, not data units. Their positions
-will be set in data units by using the "offsets" and "transOffset"
-kwargs of the LineCollection and PolyCollection.
-
-The third subplot will make regular polygons, with the same
-type of scaling and positioning as in the first two.
-
-The last subplot illustrates the use of "offsets=(xo,yo)",
-that is, a single tuple instead of a list of tuples, to generate
-successively offset curves, with the offset given in data
-units. This behavior is available only for the LineCollection.
-
-'''
-
-import matplotlib.pyplot as P
-from matplotlib import collections, axes, transforms
-from matplotlib.colors import colorConverter
-import numpy as N
-
-nverts = 50
-npts = 100
-
-# Make some spirals
-r = N.array(range(nverts))
-theta = N.array(range(nverts)) * (2*N.pi)/(nverts-1)
-xx = r * N.sin(theta)
-yy = r * N.cos(theta)
-spiral = zip(xx,yy)
-
-# Make some offsets
-xo = N.random.randn(npts)
-yo = N.random.randn(npts)
-xyo = zip(xo, yo)
-
-# Make a list of colors cycling through the rgbcmyk series.
-colors = [colorConverter.to_rgba(c) for c in ('r','g','b','c','y','m','k')]
-
-fig = P.figure()
-
-a = fig.add_subplot(2,2,1)
-col = collections.LineCollection([spiral], offsets=xyo,
- transOffset=a.transData)
-trans = transforms.Affine2D().scale(fig.dpi/72.0)
-col.set_transform(trans) # the points to pixels transform
- # Note: the first argument to the collection initializer
- # must be a list of sequences of x,y tuples; we have only
- # one sequence, but we still have to put it in a list.
-a.add_collection(col, autolim=True)
- # autolim=True enables autoscaling. For collections with
- # offsets like this, it is neither efficient nor accurate,
- # but it is good enough to generate a plot that you can use
- # as a starting point. If you know beforehand the range of
- # x and y that you want to show, it is better to set them
- # explicitly, leave out the autolim kwarg (or set it to False),
- # and omit the 'a.autoscale_view()' call below.
-
-# Make a transform for the line segments such that their size is
-# given in points:
-col.set_color(colors)
-
-a.autoscale_view() # See comment above, after a.add_collection.
-a.set_title('LineCollection using offsets')
-
-
-# The same data as above, but fill the curves.
-
-a = fig.add_subplot(2,2,2)
-
-col = collections.PolyCollection([spiral], offsets=xyo,
- transOffset=a.transData)
-trans = transforms.Affine2D().scale(fig.dpi/72.0)
-col.set_transform(trans) # the points to pixels transform
-a.add_collection(col, autolim=True)
-col.set_color(colors)
-
-
-a.autoscale_view()
-a.set_title('PolyCollection using offsets')
-
-# 7-sided regular polygons
-
-a = fig.add_subplot(2,2,3)
-
-col = collections.RegularPolyCollection(fig.dpi, 7,
- sizes = N.fabs(xx)*10.0, offsets=xyo,
- transOffset=a.transData)
-trans = transforms.Affine2D().scale(fig.dpi/72.0)
-col.set_transform(trans) # the points to pixels transform
-a.add_collection(col, autolim=True)
-col.set_color(colors)
-a.autoscale_view()
-a.set_title('RegularPolyCollection using offsets')
-
-
-# Simulate a series of ocean current profiles, successively
-# offset by 0.1 m/s so that they form what is sometimes called
-# a "waterfall" plot or a "stagger" plot.
-
-a = fig.add_subplot(2,2,4)
-
-nverts = 60
-ncurves = 20
-offs = (0.1, 0.0)
-
-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*N.random.randn(nverts)
- curve = zip(xxx, yy*100)
- segs.append(curve)
-
-col = collections.LineCollection(segs, offsets=offs)
-a.add_collection(col, autolim=True)
-col.set_color(colors)
-a.autoscale_view()
-a.set_title('Successive data offsets')
-a.set_xlabel('Zonal velocity component (m/s)')
-a.set_ylabel('Depth (m)')
-# Reverse the y-axis so depth increases downward
-a.set_ylim(a.get_ylim()[::-1])
-
-
-P.show()
-
-
Deleted: trunk/matplotlib/examples/color_by_yvalue.py
===================================================================
--- trunk/matplotlib/examples/color_by_yvalue.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/color_by_yvalue.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,18 +0,0 @@
-# use masked arrays to plot a line with different colors by y-value
-from numpy import logical_or, arange, sin, pi
-from numpy import ma
-from matplotlib.pyplot import plot, show
-
-t = arange(0.0, 2.0, 0.01)
-s = sin(2*pi*t)
-
-upper = 0.77
-lower = -0.77
-
-
-supper = ma.masked_where(s < upper, s)
-slower = ma.masked_where(s > lower, s)
-smiddle = ma.masked_where(logical_or(s<lower, s>upper), s)
-
-plot(t, slower, 'r', t, smiddle, 'b', t, supper, 'g')
-show()
Deleted: trunk/matplotlib/examples/color_demo.py
===================================================================
--- trunk/matplotlib/examples/color_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/color_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-"""
-matplotlib gives you 4 ways to specify colors,
-
- 1) as a single letter string, ala matlab
-
- 2) as an html style hex string or html color name
-
- 3) as an R,G,B tuple, where R,G,B, range from 0-1
-
- 4) as a string representing a floating point number
- from 0 to 1, corresponding to shades of gray.
-
-See help(colors) for more info.
-"""
-from pylab import *
-
-subplot(111, axisbg='darkslategray')
-#subplot(111, axisbg='#ababab')
-t = arange(0.0, 2.0, 0.01)
-s = sin(2*pi*t)
-plot(t, s, 'y')
-xlabel('time (s)', color='r')
-ylabel('voltage (mV)', color='0.5') # grayscale color
-title('About as silly as it gets, folks', color='#afeeee')
-show()
Deleted: trunk/matplotlib/examples/colorbar_only.py
===================================================================
--- trunk/matplotlib/examples/colorbar_only.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/colorbar_only.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,51 +0,0 @@
-'''
-Make a colorbar as a separate figure.
-'''
-
-from matplotlib import pyplot, mpl
-
-# Make a figure and axes with dimensions as desired.
-fig = pyplot.figure(figsize=(8,3))
-ax1 = fig.add_axes([0.05, 0.65, 0.9, 0.15])
-ax2 = fig.add_axes([0.05, 0.25, 0.9, 0.15])
-
-# Set the colormap and norm to correspond to the data for which
-# the colorbar will be used.
-cmap = mpl.cm.cool
-norm = mpl.colors.Normalize(vmin=5, vmax=10)
-
-# ColorbarBase derives from ScalarMappable and puts a colorbar
-# in a specified axes, so it has everything needed for a
-# standalone colorbar. There are many more kwargs, but the
-# following gives a basic continuous colorbar with ticks
-# and labels.
-cb1 = mpl.colorbar.ColorbarBase(ax1, cmap=cmap,
- norm=norm,
- orientation='horizontal')
-cb1.set_label('Some Units')
-
-# The second example illustrates the use of a ListedColormap, a
-# BoundaryNorm, and extended ends to show the "over" and "under"
-# value colors.
-cmap = mpl.colors.ListedColormap(['r', 'g', 'b', 'c'])
-cmap.set_over('0.25')
-cmap.set_under('0.75')
-
-# If a ListedColormap is used, the length of the bounds array must be
-# one greater than the length of the color list. The bounds must be
-# monotonically increasing.
-bounds = [1, 2, 4, 7, 8]
-norm = mpl.colors.BoundaryNorm(bounds, cmap.N)
-cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=cmap,
- norm=norm,
- # to use 'extend', you must
- # specify two extra boundaries:
- boundaries=[0]+bounds+[13],
- extend='both',
- ticks=bounds, # optional
- spacing='proportional',
- orientation='horizontal')
-cb2.set_label('Discrete intervals, some other units')
-
-pyplot.show()
-
Deleted: trunk/matplotlib/examples/colours.py
===================================================================
--- trunk/matplotlib/examples/colours.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/colours.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-"""
-Some simple functions to generate colours.
-"""
-import numpy as npy
-from matplotlib.colors import colorConverter
-
-def pastel(colour, weight=2.4):
- """ Convert colour into a nice pastel shade"""
- rgb = npy.asarray(colorConverter.to_rgb(colour))
- # scale colour
- maxc = max(rgb)
- if maxc < 1.0 and maxc > 0:
- # scale colour
- scale = 1.0 / maxc
- rgb = rgb * scale
- # now decrease saturation
- total = rgb.sum()
- slack = 0
- for x in rgb:
- slack += 1.0 - x
-
- # want to increase weight from total to weight
- # pick x s.t. slack * x == weight - total
- # x = (weight - total) / slack
- x = (weight - total) / slack
-
- rgb = [c + (x * (1.0-c)) for c in rgb]
-
- return rgb
-
-def get_colours(n):
- """ Return n pastel colours. """
- base = npy.asarray([[1,0,0], [0,1,0], [0,0,1]])
-
- if n <= 3:
- return base[0:n]
-
- # how many new colours to we need to insert between
- # red and green and between green and blue?
- needed = (((n - 3) + 1) / 2, (n - 3) / 2)
-
- colours = []
- for start in (0, 1):
- for x in npy.linspace(0, 1, needed[start]+2):
- colours.append((base[start] * (1.0 - x)) +
- (base[start+1] * x))
-
- return [pastel(c) for c in colours[0:n]]
-
Deleted: trunk/matplotlib/examples/contour_demo.py
===================================================================
--- trunk/matplotlib/examples/contour_demo.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/contour_demo.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,101 +0,0 @@
-#!/usr/bin/env python
-'''
-Illustrate simple contour plotting, contours on an image with
-a colorbar for the contours, and labelled contours.
-
-See also contour_image.py.
-'''
-from pylab import *
-
-rcParams['xtick.direction'] = 'out'
-rcParams['ytick.direction'] = 'out'
-
-delta = 0.025
-x = arange(-3.0, 3.0, delta)
-y = arange(-2.0, 2.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
-Z = 10.0 * (Z2 - Z1)
-
-
-
-# Create a simple contour plot with labels using default colors. The
-# inline argument to clabel will control whether the labels are draw
-# over the line segments of the contour, removing the lines beneath
-# the label
-figure()
-CS = contour(X, Y, Z)
-clabel(CS, inline=1, fontsize=10)
-title('Simplest default with labels')
-
-
-# You can force all the contours to be the same color.
-figure()
-CS = contour(X, Y, Z, 6,
- colors='k', # negative contours will be dashed by default
- )
-clabel(CS, fontsize=9, inline=1)
-title('Single color - negative contours dashed')
-
-# You can set negative contours to be solid instead of dashed:
-rcParams['contour.negative_linestyle'] = 'solid'
-figure()
-CS = contour(X, Y, Z, 6,
- colors='k', # negative contours will be dashed by default
- )
-clabel(CS, fontsize=9, inline=1)
-title('Single color - negative contours solid')
-
-
-# And you can manually specify the colors of the contour
-figure()
-CS = contour(X, Y, Z, 6,
- linewidths=arange(.5, 4, .5),
- colors=('r', 'green', 'blue', (1,1,0), '#afeeee', '0.5')
- )
-clabel(CS, fontsize=9, inline=1)
-title('Crazy lines')
-
-
-# Or you can use a colormap to specify the colors; the default
-# colormap will be used for the contour lines
-figure()
-im = imshow(Z, interpolation='bilinear', origin='lower',
- cmap=cm.gray, extent=(-3,3,-2,2))
-levels = arange(-1.2, 1.6, 0.2)
-CS = contour(Z, levels,
- origin='lower',
- linewidths=2,
- extent=(-3,3,-2,2))
-
-#Thicken the zero contour.
-zc = CS.collections[6]
-setp(zc, linewidth=4)
-
-clabel(CS, levels[1::2], # label every second level
- inline=1,
- fmt='%1.1f',
- fontsize=14)
-
-# make a colorbar for the contour lines
-CB = colorbar(CS, shrink=0.8, extend='both')
-
-title('Lines with colorbar')
-hot() # Now change the colormap for the contour lines and colorbar
-flag()
-
-# We can still add a colorbar for the image, too.
-CBI = colorbar(im, orientation='horizontal', shrink=0.8)
-
-# This makes the original colorbar look a bit out of place,
-# so let's improve its position.
-
-l,b,w,h = gca().get_position().bounds
-ll,bb,ww,hh = CB.ax.get_position().bounds
-CB.ax.set_position([ll, b+0.1*h, ww, h*0.8])
-
-
-#savefig('contour_demo')
-show()
Deleted: trunk/matplotlib/examples/contour_image.py
===================================================================
--- trunk/matplotlib/examples/contour_image.py 2008-05-16 19:20:04 UTC (rev 5150)
+++ trunk/matplotlib/examples/contour_image.py 2008-05-16 19:47:10 UTC (rev 5151)
@@ -1,103 +0,0 @@
-#!/usr/bin/env python
-'''
-Test combinations of contouring, filled contouring, and image plotting.
-For contour labelling, see contour_demo.py.
-
-The emphasis in this demo is on showing how to make contours register
-correctly on images, and on how to get both of them oriented as
-desired. In particular, note the usage of the "origin" and "extent"
-keyword arguments to imshow and contour.
-'''
-from pylab import *
-
-#Default delta is large because that makes it fast, and it illustrates
-# the correct registration between image and contours.
-delta = 0.5
-
-extent = (-3,4,-4,3)
-
-x = arange(-3.0, 4.001, delta)
-y = arange(-4.0, 3.001, 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)
-Z = (Z1 - Z2) * 10
-
-levels = arange(-2.0, 1.601, 0.4) # Boost the upper limit to avoid truncation
- # errors.
-
-figure()
-
-
-subplot(2,2,1)
-
-cset1 = contourf(X, Y, Z, levels,
- cmap=cm.get_cmap('jet', len(levels)-1),
- )
-# It is not necessary, but for the colormap, we need only the
-# number of levels minus 1. To avoid discretization error, use
-# either this number or a large number such as the default (256).
-
-#If we want lines as well as filled regions, we need to call
-# contour separately; don't try to change the edgecolor or edgewidth
-# of the polygons in the collections returned by contourf.
-# Use levels output from previous call to guarantee they are the same.
-cset2 = contour(X, Y, Z, cset1.levels,
- colors = 'k',
- hold='on')
-# We don't really need dashed contour lines to indicate negative
-# regions, so let's turn them off.
-for c in cset2.collections:
- c.set_linestyle('solid')
-
-# It is easier here to make a separate call to contour than
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|