├── .gitattributes ├── .gitignore ├── Readme.md ├── attachments ├── ASTER.Pnw ├── A_Numerical_Agnostic_Pyrex_Class.Pnw ├── A_Pyrex_Agnostic_Class.Pnw ├── AccumarrayLike.Pnw ├── ApplyFIRFilter.Pnw ├── ArrayStruct_and_Pyrex.Pnw ├── Autovectorize.Pnw ├── BrownianMotion.Pnw ├── BuildingArrays.Pnw ├── ButterworthBandpass.Pnw ├── C_Extensions(2f)NumPy_arrays.Pnw ├── C_Extensions.Pnw ├── CommTheory.Pnw ├── CompilingExtensionsOnWindowsWithMinGW.Pnw ├── CorrelatedRandomSamples.Pnw ├── CoupledSpringMassSystem.Pnw ├── Ctypes.Pnw ├── DataFrame.Pnw ├── Data_Acquisition_with_NIDAQmx.Pnw ├── Data_Acquisition_with_PyUL.Pnw ├── EmbeddingInTraitsGUI.Pnw ├── EyeDiagram.Pnw ├── F2Py.Pnw ├── FIRFilter.Pnw ├── FiltFilt.Pnw ├── Finding_Convex_Hull.Pnw ├── Finding_Convex_Hull_Minimum_Point.Pnw ├── FittingData.Pnw ├── FortranIO(2f)FortranFile(2e).Pnw ├── FortranIO(2f)FortranFile.Pnw ├── FortranIO.Pnw ├── FrequencySweptDemo.Pnw ├── GMailPM.Pnw ├── GameOfLifeStrides.Pnw ├── Histograms.Pnw ├── Indexing.Pnw ├── InputOutput.Pnw ├── Interpolation.Pnw ├── Intersection.Pnw ├── KDTree.Pnw ├── KalmanFiltering.Pnw ├── KdV.Pnw ├── LASReader.Pnw ├── Least_Squares_Circle.Pnw ├── LineIntegralConvolution.Pnw ├── LinearClassification.Pnw ├── LinearRegression.Pnw ├── LoktaVolterraTutorial.Pnw ├── Matplotlib(2f)AdjustingImageSize.Pnw ├── Matplotlib(2f)Animations.Pnw ├── Matplotlib(2f)Arrows.Pnw ├── Matplotlib(2f)BarCharts.Pnw ├── Matplotlib(2f)ColormapTransformations.Pnw ├── Matplotlib(2f)Common_Errors.Pnw ├── Matplotlib(2f)CompilingMatPlotLibOnSolaris10.Pnw ├── Matplotlib(2f)CustomLogLabels.Pnw ├── Matplotlib(2f)DeletingAnExistingDataSeries.Pnw ├── Matplotlib(2f)Django.Pnw ├── Matplotlib(2f)Drag_n_Drop_Text_Example.Pnw ├── Matplotlib(2f)EmbeddingInWx.Pnw ├── Matplotlib(2f)Gridding_irregularly_spaced_data.Pnw ├── Matplotlib(2f)HintonDiagrams.Pnw ├── Matplotlib(2f)Interactive_Plotting.Pnw ├── Matplotlib(2f)LaTeX_Examples.Pnw ├── Matplotlib(2f)Legend.Pnw ├── Matplotlib(2f)LoadImage.Pnw ├── Matplotlib(2f)Loading_a_colormap_dynamically.Pnw ├── Matplotlib(2f)Maps.Pnw ├── Matplotlib(2f)Matplotlib_and_Zope.Pnw ├── Matplotlib(2f)MulticoloredLine.Pnw ├── Matplotlib(2f)MultilinePlots.Pnw ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label.Pnw ├── Matplotlib(2f)Plotting_Images_with_Special_Values.Pnw ├── Matplotlib(2f)Plotting_values_with_masked_arrays.Pnw ├── Matplotlib(2f)PySide.Pnw ├── Matplotlib(2f)Qt_with_IPython_and_Designer.Pnw ├── Matplotlib(2f)ScrollingPlot.Pnw ├── Matplotlib(2f)ShadedRegions.Pnw ├── Matplotlib(2f)Show_colormaps.Pnw ├── Matplotlib(2f)SigmoidalFunctions.Pnw ├── Matplotlib(2f)ThickAxes.Pnw ├── Matplotlib(2f)Transformations.Pnw ├── Matplotlib(2f)TreeMap.Pnw ├── Matplotlib(2f)UnfilledHistograms.Pnw ├── Matplotlib(2f)UsingTex.Pnw ├── Matplotlib(2f)Using_MatPlotLib_in_a_CGI_script.Pnw ├── Matplotlib(2f)VTK_Integration.Pnw ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image.Pnw ├── Matplotlib(2f)mplot3D.Pnw ├── Matplotlib.Pnw ├── MayaVi(2f)InstallPythonStuffFromSource.Pnw ├── MayaVi(2f)Installation.Pnw ├── MayaVi(2f)RunningMayavi2.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)Filters.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules.Pnw ├── MayaVi(2f)ScriptingMayavi2.Pnw ├── MayaVi(2f)Surf.Pnw ├── MayaVi(2f)Tips.Pnw ├── MayaVi(2f)examples.Pnw ├── MayaVi(2f)mlab.Pnw ├── MayaVi(2f)tvtk.Pnw ├── MayaVi.Pnw ├── MetaArray.Pnw ├── MultiDot.Pnw ├── Multithreading.Pnw ├── OLS.Pnw ├── Obarray.Pnw ├── OldMatplotlib.Pnw ├── OptimizationAndFitDemo1.Pnw ├── OptimizationDemo1.Pnw ├── PIL.Pnw ├── ParticleFilter.Pnw ├── Pyrex_and_NumPy.Pnw ├── RANSAC.Pnw ├── RadialBasisFunctions.Pnw ├── RankNullspace.Pnw ├── Reading_Custom_Text_Files_with_Pyparsing.Pnw ├── Reading_SPE_files.Pnw ├── Reading_mat_files.Pnw ├── Rebinning.Pnw ├── Recarray.Pnw ├── SWIG_Memory_Deallocation.Pnw ├── SWIG_NumPy_examples.Pnw ├── SWIG_and_NumPy.Pnw ├── SavitzkyGolay.Pnw ├── SchrodingerFDTD.Pnw ├── SegmentAxis.Pnw ├── SignalSmooth.Pnw ├── Solving_Large_Markov_Chains.Pnw ├── SphericalBesselZeros.Pnw ├── Theoretical_Ecology(2f)Hastings_and_Powell.Pnw ├── Theoretical_Ecology.Pnw ├── TimeSeries(2f)FAQ.Pnw ├── TimeSeries.Pnw ├── ViewsVsCopies.Pnw ├── Watershed.Pnw ├── Weave.Pnw ├── Zombie_Apocalypse_ODEINT.Pnw ├── dbase.Pnw ├── f2py_and_NumPy.Pnw ├── hdf5_in_Matlab.Pnw ├── mplot3D.Pnw ├── multiprocessing.Pnw ├── vtkVolumeRendering.Pnw ├── wxPython_dialogs.Pnw └── xplt.Pnw ├── convert_attachments.py ├── convert_attachments_markdown.py ├── convert_to_pweave.py ├── converted ├── ASTER.Pnw ├── A_Numerical_Agnostic_Pyrex_Class.Pnw ├── A_Pyrex_Agnostic_Class.Pnw ├── AccumarrayLike.Pnw ├── ApplyFIRFilter.Pnw ├── ArrayStruct_and_Pyrex.Pnw ├── Autovectorize.Pnw ├── BrownianMotion.Pnw ├── BuildingArrays.Pnw ├── ButterworthBandpass.Pnw ├── C_Extensions(2f)NumPy_arrays.Pnw ├── C_Extensions.Pnw ├── CommTheory.Pnw ├── CompilingExtensionsOnWindowsWithMinGW.Pnw ├── CorrelatedRandomSamples.Pnw ├── CoupledSpringMassSystem.Pnw ├── Ctypes.Pnw ├── DataFrame.Pnw ├── Data_Acquisition_with_NIDAQmx.Pnw ├── Data_Acquisition_with_PyUL.Pnw ├── EmbeddingInTraitsGUI.Pnw ├── EyeDiagram.Pnw ├── F2Py.Pnw ├── FIRFilter.Pnw ├── FiltFilt.Pnw ├── Finding_Convex_Hull.Pnw ├── Finding_Convex_Hull_Minimum_Point.Pnw ├── FittingData.Pnw ├── FortranIO(2f)FortranFile(2e).Pnw ├── FortranIO(2f)FortranFile.Pnw ├── FortranIO.Pnw ├── FrequencySweptDemo.Pnw ├── GMailPM.Pnw ├── GameOfLifeStrides.Pnw ├── Histograms.Pnw ├── Indexing.Pnw ├── InputOutput.Pnw ├── Interpolation.Pnw ├── Intersection.Pnw ├── KDTree.Pnw ├── KalmanFiltering.Pnw ├── KdV.Pnw ├── LASReader.Pnw ├── Least_Squares_Circle.Pnw ├── LineIntegralConvolution.Pnw ├── LinearClassification.Pnw ├── LinearRegression.Pnw ├── LoktaVolterraTutorial.Pnw ├── Matplotlib(2f)AdjustingImageSize.Pnw ├── Matplotlib(2f)Animations.Pnw ├── Matplotlib(2f)Arrows.Pnw ├── Matplotlib(2f)BarCharts.Pnw ├── Matplotlib(2f)ColormapTransformations.Pnw ├── Matplotlib(2f)Common_Errors.Pnw ├── Matplotlib(2f)CompilingMatPlotLibOnSolaris10.Pnw ├── Matplotlib(2f)CustomLogLabels.Pnw ├── Matplotlib(2f)DeletingAnExistingDataSeries.Pnw ├── Matplotlib(2f)Django.Pnw ├── Matplotlib(2f)Drag_n_Drop_Text_Example.Pnw ├── Matplotlib(2f)EmbeddingInWx.Pnw ├── Matplotlib(2f)Gridding_irregularly_spaced_data.Pnw ├── Matplotlib(2f)HintonDiagrams.Pnw ├── Matplotlib(2f)Interactive_Plotting.Pnw ├── Matplotlib(2f)LaTeX_Examples.Pnw ├── Matplotlib(2f)Legend.Pnw ├── Matplotlib(2f)LoadImage.Pnw ├── Matplotlib(2f)Loading_a_colormap_dynamically.Pnw ├── Matplotlib(2f)Maps.Pnw ├── Matplotlib(2f)Matplotlib_and_Zope.Pnw ├── Matplotlib(2f)MulticoloredLine.Pnw ├── Matplotlib(2f)MultilinePlots.Pnw ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label.Pnw ├── Matplotlib(2f)Plotting_Images_with_Special_Values.Pnw ├── Matplotlib(2f)Plotting_values_with_masked_arrays.Pnw ├── Matplotlib(2f)PySide.Pnw ├── Matplotlib(2f)Qt_with_IPython_and_Designer.Pnw ├── Matplotlib(2f)ScrollingPlot.Pnw ├── Matplotlib(2f)ShadedRegions.Pnw ├── Matplotlib(2f)Show_colormaps.Pnw ├── Matplotlib(2f)SigmoidalFunctions.Pnw ├── Matplotlib(2f)ThickAxes.Pnw ├── Matplotlib(2f)Transformations.Pnw ├── Matplotlib(2f)TreeMap.Pnw ├── Matplotlib(2f)UnfilledHistograms.Pnw ├── Matplotlib(2f)UsingTex.Pnw ├── Matplotlib(2f)Using_MatPlotLib_in_a_CGI_script.Pnw ├── Matplotlib(2f)VTK_Integration.Pnw ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image.Pnw ├── Matplotlib(2f)mplot3D.Pnw ├── Matplotlib.Pnw ├── MayaVi(2f)InstallPythonStuffFromSource.Pnw ├── MayaVi(2f)Installation.Pnw ├── MayaVi(2f)RunningMayavi2.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)Filters.Pnw ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules.Pnw ├── MayaVi(2f)ScriptingMayavi2.Pnw ├── MayaVi(2f)Surf.Pnw ├── MayaVi(2f)Tips.Pnw ├── MayaVi(2f)examples.Pnw ├── MayaVi(2f)mlab.Pnw ├── MayaVi(2f)tvtk.Pnw ├── MayaVi.Pnw ├── MetaArray.Pnw ├── MultiDot.Pnw ├── Multithreading.Pnw ├── OLS.Pnw ├── Obarray.Pnw ├── OldMatplotlib.Pnw ├── OptimizationAndFitDemo1.Pnw ├── OptimizationDemo1.Pnw ├── PIL.Pnw ├── ParticleFilter.Pnw ├── Pyrex_and_NumPy.Pnw ├── RANSAC.Pnw ├── RadialBasisFunctions.Pnw ├── RankNullspace.Pnw ├── Reading_Custom_Text_Files_with_Pyparsing.Pnw ├── Reading_SPE_files.Pnw ├── Reading_mat_files.Pnw ├── Rebinning.Pnw ├── Recarray.Pnw ├── SWIG_Memory_Deallocation.Pnw ├── SWIG_NumPy_examples.Pnw ├── SWIG_and_NumPy.Pnw ├── SavitzkyGolay.Pnw ├── SchrodingerFDTD.Pnw ├── SegmentAxis.Pnw ├── SignalSmooth.Pnw ├── Solving_Large_Markov_Chains.Pnw ├── SphericalBesselZeros.Pnw ├── Theoretical_Ecology(2f)Hastings_and_Powell.Pnw ├── Theoretical_Ecology.Pnw ├── TimeSeries(2f)FAQ.Pnw ├── TimeSeries.Pnw ├── ViewsVsCopies.Pnw ├── Watershed.Pnw ├── Weave.Pnw ├── Zombie_Apocalypse_ODEINT.Pnw ├── dbase.Pnw ├── f2py_and_NumPy.Pnw ├── hdf5_in_Matlab.Pnw ├── mplot3D.Pnw ├── multiprocessing.Pnw ├── vtkVolumeRendering.Pnw ├── wxPython_dialogs.Pnw └── xplt.Pnw ├── ipython ├── ASTER.py ├── A_Numerical_Agnostic_Pyrex_Class.py ├── A_Pyrex_Agnostic_Class.py ├── AccumarrayLike.py ├── ApplyFIRFilter.py ├── ArrayStruct_and_Pyrex.py ├── Autovectorize.py ├── BrownianMotion.py ├── BuildingArrays.py ├── ButterworthBandpass.py ├── C_Extensions(2f)NumPy_arrays.py ├── C_Extensions.py ├── CommTheory.py ├── CompilingExtensionsOnWindowsWithMinGW.py ├── CorrelatedRandomSamples.py ├── CoupledSpringMassSystem.py ├── Ctypes.py ├── DataFrame.py ├── Data_Acquisition_with_NIDAQmx.py ├── Data_Acquisition_with_PyUL.py ├── EmbeddingInTraitsGUI.py ├── EyeDiagram.py ├── F2Py.py ├── FIRFilter.py ├── FiltFilt.py ├── Finding_Convex_Hull.py ├── Finding_Convex_Hull_Minimum_Point.py ├── FittingData.py ├── FortranIO(2f)FortranFile(2e).py ├── FortranIO(2f)FortranFile.py ├── FortranIO.py ├── FrequencySweptDemo.py ├── GMailPM.py ├── GameOfLifeStrides.py ├── Histograms.py ├── Indexing.py ├── InputOutput.py ├── Interpolation.py ├── Intersection.py ├── KDTree.py ├── KalmanFiltering.py ├── KdV.py ├── LASReader.py ├── Least_Squares_Circle.py ├── LineIntegralConvolution.py ├── LinearClassification.py ├── LinearRegression.py ├── LoktaVolterraTutorial.py ├── Matplotlib(2f)AdjustingImageSize.py ├── Matplotlib(2f)Animations.py ├── Matplotlib(2f)Arrows.py ├── Matplotlib(2f)BarCharts.py ├── Matplotlib(2f)ColormapTransformations.py ├── Matplotlib(2f)Common_Errors.py ├── Matplotlib(2f)CompilingMatPlotLibOnSolaris10.py ├── Matplotlib(2f)CustomLogLabels.py ├── Matplotlib(2f)DeletingAnExistingDataSeries.py ├── Matplotlib(2f)Django.py ├── Matplotlib(2f)Drag_n_Drop_Text_Example.py ├── Matplotlib(2f)EmbeddingInWx.py ├── Matplotlib(2f)Gridding_irregularly_spaced_data.py ├── Matplotlib(2f)HintonDiagrams.py ├── Matplotlib(2f)Interactive_Plotting.py ├── Matplotlib(2f)LaTeX_Examples.py ├── Matplotlib(2f)Legend.py ├── Matplotlib(2f)LoadImage.py ├── Matplotlib(2f)Loading_a_colormap_dynamically.py ├── Matplotlib(2f)Maps.py ├── Matplotlib(2f)Matplotlib_and_Zope.py ├── Matplotlib(2f)MulticoloredLine.py ├── Matplotlib(2f)MultilinePlots.py ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label.py ├── Matplotlib(2f)Plotting_Images_with_Special_Values.py ├── Matplotlib(2f)Plotting_values_with_masked_arrays.py ├── Matplotlib(2f)PySide.py ├── Matplotlib(2f)Qt_with_IPython_and_Designer.py ├── Matplotlib(2f)ScrollingPlot.py ├── Matplotlib(2f)ShadedRegions.py ├── Matplotlib(2f)Show_colormaps.py ├── Matplotlib(2f)SigmoidalFunctions.py ├── Matplotlib(2f)ThickAxes.py ├── Matplotlib(2f)Transformations.py ├── Matplotlib(2f)TreeMap.py ├── Matplotlib(2f)UnfilledHistograms.py ├── Matplotlib(2f)UsingTex.py ├── Matplotlib(2f)Using_MatPlotLib_in_a_CGI_script.py ├── Matplotlib(2f)VTK_Integration.py ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image.py ├── Matplotlib(2f)mplot3D.py ├── Matplotlib.py ├── MayaVi(2f)InstallPythonStuffFromSource.py ├── MayaVi(2f)Installation.py ├── MayaVi(2f)RunningMayavi2.py ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules.py ├── MayaVi(2f)ScriptingMayavi2(2f)Filters.py ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules.py ├── MayaVi(2f)ScriptingMayavi2.py ├── MayaVi(2f)Surf.py ├── MayaVi(2f)Tips.py ├── MayaVi(2f)examples.py ├── MayaVi(2f)mlab.py ├── MayaVi(2f)tvtk.py ├── MayaVi.py ├── MetaArray.py ├── MultiDot.py ├── Multithreading.py ├── OLS.py ├── Obarray.py ├── OldMatplotlib.py ├── OptimizationAndFitDemo1.py ├── OptimizationDemo1.py ├── PIL.py ├── ParticleFilter.py ├── Pyrex_and_NumPy.py ├── RANSAC.py ├── RadialBasisFunctions.py ├── RankNullspace.py ├── Reading_Custom_Text_Files_with_Pyparsing.py ├── Reading_SPE_files.py ├── Reading_mat_files.py ├── Rebinning.py ├── Recarray.py ├── SWIG_Memory_Deallocation.py ├── SWIG_NumPy_examples.py ├── SWIG_and_NumPy.py ├── SavitzkyGolay.py ├── SchrodingerFDTD.py ├── SegmentAxis.py ├── SignalSmooth.py ├── Solving_Large_Markov_Chains.py ├── SphericalBesselZeros.py ├── Theoretical_Ecology(2f)Hastings_and_Powell.py ├── Theoretical_Ecology.py ├── TimeSeries(2f)FAQ.py ├── TimeSeries.py ├── ViewsVsCopies.py ├── Watershed.py ├── Weave.py ├── Zombie_Apocalypse_ODEINT.py ├── dbase.py ├── f2py_and_NumPy.py ├── hdf5_in_Matlab.py ├── mplot3D.py ├── multiprocessing.py ├── vtkVolumeRendering.py ├── wxPython_dialogs.py └── xplt.py ├── originals ├── ASTER.txt ├── A_Numerical_Agnostic_Pyrex_Class.txt ├── A_Numerical_Agnostic_Pyrex_Class_attachments │ └── test_output.txt ├── A_Pyrex_Agnostic_Class.txt ├── A_Pyrex_Agnostic_Class_attachments │ └── test_output.txt ├── AccumarrayLike.txt ├── ApplyFIRFilter.txt ├── ApplyFIRFilter_attachments │ ├── fir_time_comparison.png │ ├── fir_time_comparison2.png │ └── fir_time_comparison3.png ├── ArrayStruct_and_Pyrex.txt ├── Autovectorize.txt ├── BrownianMotion.txt ├── BrownianMotion_attachments │ ├── brownian_demo.png │ └── brownian_demo_2d.png ├── BuildingArrays.txt ├── ButterworthBandpass.txt ├── ButterworthBandpass_attachments │ ├── butterworth_bandpass_example.png │ └── butterworth_bandpass_frequency_response.png ├── C_Extensions(2f)NumPy_arrays.txt ├── C_Extensions(2f)NumPy_arrays_attachments │ ├── C_arraytest.c │ ├── C_arraytest.c_v2 │ ├── C_arraytest.h │ ├── C_arraytest.h_v2 │ └── Cext_v2.tar.gz ├── C_Extensions.txt ├── CommTheory.txt ├── CommTheory_attachments │ └── BPSK_BER.PNG ├── CompilingExtensionsOnWindowsWithMinGW.txt ├── CorrelatedRandomSamples.txt ├── CorrelatedRandomSamples_attachments │ └── correlated_random_vars.png ├── CoupledSpringMassSystem.txt ├── CoupledSpringMassSystem_attachments │ ├── two_springs.png │ ├── two_springs2.png │ └── two_springs_diagram.png ├── Ctypes.txt ├── DataFrame.txt ├── DataFrame_attachments │ ├── CSVSample.csv │ ├── DataFrame.py │ └── SampleCSV.csv ├── Data_Acquisition_with_NIDAQmx.txt ├── Data_Acquisition_with_PyUL.txt ├── Data_Acquisition_with_PyUL_attachments │ ├── example1.png │ ├── example2.png │ ├── example3.png │ └── example4.png ├── EmbeddingInTraitsGUI.txt ├── EmbeddingInTraitsGUI_attachments │ ├── mpl_editor.py │ └── mpl_in_traits_view.png ├── EyeDiagram.txt ├── EyeDiagram_attachments │ ├── eye-diagram.png │ ├── eye-diagram2.png │ └── eye-diagram3.png ├── F2Py.txt ├── FIRFilter.txt ├── FIRFilter_attachments │ ├── fir_demo_freq_resp.png │ ├── fir_demo_signals.png │ └── fir_demo_taps.png ├── FiltFilt.txt ├── FiltFilt_attachments │ ├── filfilt.jpg │ └── filfilt2.jpg ├── Finding_Convex_Hull.txt ├── Finding_Convex_Hull_Minimum_Point.txt ├── Finding_Convex_Hull_attachments │ └── convex_hull.png ├── FittingData.txt ├── FittingData_attachments │ ├── datafit.png │ ├── fitgaussian.png │ ├── gaussfitter.py │ ├── gaussfitter2.py │ ├── gaussianfit.png │ └── power_law_fit.png ├── FortranIO(2f)FortranFile(2e).txt ├── FortranIO(2f)FortranFile.txt ├── FortranIO.txt ├── FrequencySweptDemo.txt ├── FrequencySweptDemo_attachments │ ├── chirp_hyperbolic.png │ ├── chirp_linear.png │ ├── chirp_logarithmic.png │ ├── chirp_plot.py │ ├── chirp_quadratic.png │ ├── chirp_quadratic_v0false.png │ └── sweep_poly.png ├── GMailPM.txt ├── GameOfLifeStrides.txt ├── Histograms.txt ├── Histograms_attachments │ └── histogram2d.png ├── Indexing.txt ├── InputOutput.txt ├── Interpolation.txt ├── Interpolation_attachments │ ├── interpolate_figure1.png │ ├── interpolate_figure2.png │ └── splprep_demo.png ├── Intersection.txt ├── KDTree.txt ├── KalmanFiltering.txt ├── KalmanFiltering_attachments │ ├── error_vs_iteration.png │ └── estimate_vs_iteration.png ├── KdV.txt ├── KdV_attachments │ ├── kdv.png │ └── kdv2.png ├── LASReader.txt ├── LASReader_attachments │ ├── las.py │ ├── sample3.las │ └── sample3plot.png ├── Least_Squares_Circle.txt ├── Least_Squares_Circle_attachments │ ├── arc_residu2_v1.png │ ├── arc_residu2_v2.png │ ├── arc_residu2_v3.png │ ├── arc_residu2_v4.png │ ├── arc_residu2_v5.png │ ├── arc_residu2_v6.png │ ├── arc_v1.png │ ├── arc_v2.png │ ├── arc_v3.png │ ├── arc_v4.png │ ├── arc_v5.png │ ├── full_cercle_residu2_v1.png │ ├── full_cercle_residu2_v2.png │ ├── full_cercle_residu2_v3.png │ ├── full_cercle_residu2_v4.png │ ├── full_cercle_residu2_v5.png │ ├── full_cercle_v1.png │ ├── full_cercle_v2.png │ ├── full_cercle_v3.png │ ├── full_cercle_v4.png │ ├── full_cercle_v5.png │ ├── least_squares_circle.py │ ├── least_squares_circle_v1.py │ ├── least_squares_circle_v1b.py │ ├── least_squares_circle_v1c.py │ ├── least_squares_circle_v1d.py │ ├── least_squares_circle_v2.py │ └── least_squares_circle_v3.py ├── LineIntegralConvolution.txt ├── LineIntegralConvolution_attachments │ ├── flow-image.png │ ├── lic.py │ ├── lic_demo.py │ ├── lic_internal.pyx │ └── setup.py ├── LinearClassification.txt ├── LinearClassification_attachments │ ├── Fisher_discriminant.png │ ├── Fisher_disrciminant.JPG │ ├── Fisher_disrciminant.PNG │ ├── Probabilistic_model.PNG │ ├── bezdekIris.data.txt │ ├── fisher │ └── prob_gen_model.png ├── LinearRegression.txt ├── LinearRegression_attachments │ └── linregress.png ├── LoktaVolterraTutorial.txt ├── LoktaVolterraTutorial_attachments │ ├── rabbits_and_foxes_1.png │ ├── rabbits_and_foxes_1v2.png │ ├── rabbits_and_foxes_2.png │ ├── rabbits_and_foxes_2v2.png │ ├── rabbits_and_foxes_2v3.png │ ├── rabbits_and_foxes_3.png │ ├── rabbits_and_foxes_3v2.png │ ├── tutorial_lokta-voltera.py │ ├── tutorial_lokta-voltera_v2.py │ ├── tutorial_lokta-voltera_v3.py │ ├── tutorial_lokta-voltera_v4.py │ ├── zombie_nodead_nobirths.png │ ├── zombie_somedead_10births.png │ ├── zombie_somedead_nobirths.png │ └── zombie_somedeaddead_nobirths.png ├── Matplotlib(2f)AdjustingImageSize.txt ├── Matplotlib(2f)AdjustingImageSize_attachments │ └── MPL_size_test.py ├── Matplotlib(2f)Animations.txt ├── Matplotlib(2f)Arrows.txt ├── Matplotlib(2f)Arrows_attachments │ └── plot_arrow.png ├── Matplotlib(2f)BarCharts.txt ├── Matplotlib(2f)BarCharts_attachments │ └── barchart.png ├── Matplotlib(2f)ColormapTransformations.txt ├── Matplotlib(2f)ColormapTransformations_attachments │ ├── dicrete_jet1.png │ ├── discrete_jet.png │ ├── jet.png │ ├── light_jet.png │ ├── light_jet2.png │ ├── light_jet3.png │ └── light_jet4.png ├── Matplotlib(2f)Common_Errors.txt ├── Matplotlib(2f)CompilingMatPlotLibOnSolaris10.txt ├── Matplotlib(2f)CustomLogLabels.txt ├── Matplotlib(2f)CustomLogLabels_attachments │ └── log_labels.png ├── Matplotlib(2f)DeletingAnExistingDataSeries.txt ├── Matplotlib(2f)Django.txt ├── Matplotlib(2f)Drag_n_Drop_Text_Example.txt ├── Matplotlib(2f)Drag_n_Drop_Text_Example_attachments │ ├── Text_DragnDrop.py │ ├── Text_DragnDrop_v0.1.py │ └── Text_DragnDrop_v2.py ├── Matplotlib(2f)EmbeddingInWx.txt ├── Matplotlib(2f)Gridding_irregularly_spaced_data.txt ├── Matplotlib(2f)Gridding_irregularly_spaced_data_attachments │ ├── bin.png │ ├── bin_small │ ├── bin_small.png │ ├── binned_data.png │ ├── griddataexample1.png │ ├── ppb.png │ ├── ppb_raw.png │ ├── raw.png │ ├── raw_small │ ├── raw_small.png │ └── unbinned_data.png ├── Matplotlib(2f)HintonDiagrams.txt ├── Matplotlib(2f)HintonDiagrams_attachments │ └── hinton.png ├── Matplotlib(2f)Interactive_Plotting.txt ├── Matplotlib(2f)LaTeX_Examples.txt ├── Matplotlib(2f)LaTeX_Examples_attachments │ ├── fig.png │ ├── fig1.png │ ├── naka-rushton.png │ └── psfrag_example.png ├── Matplotlib(2f)Legend.txt ├── Matplotlib(2f)LoadImage.txt ├── Matplotlib(2f)Loading_a_colormap_dynamically.txt ├── Matplotlib(2f)Maps.txt ├── Matplotlib(2f)Maps_attachments │ ├── basemap0.png │ ├── basemap1.png │ ├── basemap1b.png │ ├── basemap2.png │ ├── basemap2b.png │ ├── basemap3.png │ ├── basemap3b.png │ └── basemap3c.png ├── Matplotlib(2f)Matplotlib_and_Zope.txt ├── Matplotlib(2f)MulticoloredLine.txt ├── Matplotlib(2f)MulticoloredLine_attachments │ ├── colored_line.png │ ├── colored_line.py │ └── colored_line2.png ├── Matplotlib(2f)MultilinePlots.txt ├── Matplotlib(2f)MultilinePlots_attachments │ ├── multiline.png │ └── multipleaxes.png ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label.txt ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label_attachments │ └── Same_ylabel_subplots.png ├── Matplotlib(2f)Plotting_Images_with_Special_Values.txt ├── Matplotlib(2f)Plotting_Images_with_Special_Values_attachments │ ├── sentinel.png │ └── sentinel_pristine.png ├── Matplotlib(2f)Plotting_values_with_masked_arrays.txt ├── Matplotlib(2f)Plotting_values_with_masked_arrays_attachments │ └── masked_test.png ├── Matplotlib(2f)PySide.txt ├── Matplotlib(2f)Qt_with_IPython_and_Designer.txt ├── Matplotlib(2f)Qt_with_IPython_and_Designer_attachments │ ├── designer_edit_custom_widgets.png │ ├── designer_form_settings_comment.png │ ├── designer_full_workspace.png │ ├── designer_new_widget.png │ ├── designer_newopen.png │ ├── designer_wizard.png │ ├── ipython_interacted.png │ ├── ipython_invoked.png │ ├── main_mpl_tutorial.py │ ├── mplwidget.py │ ├── mplwidget_tutorial.py │ └── mplwidget_tutorial.ui ├── Matplotlib(2f)ScrollingPlot.txt ├── Matplotlib(2f)ShadedRegions.txt ├── Matplotlib(2f)ShadedRegions_attachments │ └── shaded.png ├── Matplotlib(2f)Show_colormaps.txt ├── Matplotlib(2f)Show_colormaps_attachments │ ├── cmap_example.png │ └── colormaps3.png ├── Matplotlib(2f)SigmoidalFunctions.txt ├── Matplotlib(2f)SigmoidalFunctions_attachments │ ├── sigmoids.png │ └── sigmoids2.png ├── Matplotlib(2f)ThickAxes.txt ├── Matplotlib(2f)ThickAxes_attachments │ └── thick_axes.png ├── Matplotlib(2f)Transformations.txt ├── Matplotlib(2f)TreeMap.txt ├── Matplotlib(2f)TreeMap_attachments │ └── TreeMap.png ├── Matplotlib(2f)UnfilledHistograms.txt ├── Matplotlib(2f)UnfilledHistograms_attachments │ ├── histNofill.py │ ├── histOutline.py │ └── hist_outline.png ├── Matplotlib(2f)UsingTex.txt ├── Matplotlib(2f)UsingTex_attachments │ └── tex_demo.png ├── Matplotlib(2f)Using_MatPlotLib_in_a_CGI_script.txt ├── Matplotlib(2f)VTK_Integration.txt ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image.txt ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments │ ├── imsave.jpg │ └── imsave.png ├── Matplotlib(2f)mplot3D.txt ├── Matplotlib(2f)mplot3D_attachments │ ├── contour.jpg │ ├── contour.png │ ├── contour3D.jpg │ ├── contour3D.png │ ├── contourf.jpg │ ├── contourf.png │ ├── contourf3D.jpg │ ├── contourf3D.png │ ├── plot.jpg │ ├── plot.png │ ├── scatter.jpg │ ├── scatter.png │ ├── surface.jpg │ ├── surface.png │ ├── test1.jpg │ ├── test1.png │ ├── test2.jpg │ ├── test2.png │ ├── test3.jpg │ ├── test3.png │ ├── wireframe.jpg │ └── wireframe.png ├── Matplotlib.txt ├── Matplotlib_attachments │ ├── barchart.png │ ├── barchartscaled.png │ ├── basemap1.png │ ├── chart_scaled.png │ ├── colored_line.png │ ├── contourf3D.jpg │ ├── hinton-small.png │ ├── hist_outline.png │ ├── hist_outline_small.png │ ├── log_labels.png │ ├── log_labels_small.png │ ├── mpl_vtk.png │ ├── multiline.png │ ├── plot_arrow.png │ ├── plot_arrow_small.png │ ├── sentinel.png │ ├── shaded.png │ ├── shaded_small.png │ ├── sigmoids_small.png │ ├── tex_demo.png │ └── thick_axes.png ├── MayaVi(2f)InstallPythonStuffFromSource.txt ├── MayaVi(2f)Installation.txt ├── MayaVi(2f)RunningMayavi2.txt ├── MayaVi(2f)RunningMayavi2_attachments │ ├── mv2.png │ └── mv2_cmdline.png ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules.txt ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments │ ├── basic_axes.png │ ├── basic_colorbar.png │ ├── basic_orientationaxes.png │ ├── basic_outline.png │ ├── basic_scene_parall.png │ ├── basic_scene_persp.png │ └── basic_title.png ├── MayaVi(2f)ScriptingMayavi2(2f)Filters.txt ├── MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments │ ├── filter_eg.png │ ├── filter_eug1.png │ ├── filter_eug2.png │ ├── filter_p2c.png │ ├── filter_thrld1.png │ └── filter_thrld2.png ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules.txt ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments │ ├── module_isosurface.png │ ├── module_scp.png │ ├── module_scp2.png │ ├── module_scp_warp.png │ ├── module_scp_widg_en.png │ ├── module_sgo_gp.png │ ├── module_streamline.png │ ├── module_sug.png │ ├── module_surface.png │ ├── module_vcp.png │ ├── module_vectors.png │ ├── module_volume.png │ └── module_warpvcp.png ├── MayaVi(2f)ScriptingMayavi2.txt ├── MayaVi(2f)Surf.txt ├── MayaVi(2f)Surf_attachments │ └── surf.png ├── MayaVi(2f)Tips.txt ├── MayaVi(2f)Tips_attachments │ ├── ps1.png │ ├── ps2.png │ ├── ps3.png │ ├── ps4.png │ ├── ps5.png │ ├── ps6.png │ ├── ps7.png │ ├── ps8.png │ └── setcolors.png ├── MayaVi(2f)examples.txt ├── MayaVi(2f)examples_attachments │ ├── contour.png │ ├── glyph.png │ ├── nongui.png │ ├── numeric_source.png │ ├── streamline.png │ ├── surf_regular_mlab.png │ └── test.png ├── MayaVi(2f)mlab.txt ├── MayaVi(2f)mlab_attachments │ ├── simple_example.png │ ├── simpleexample.png │ └── tvtk.mlab_example.png ├── MayaVi(2f)tvtk.txt ├── MayaVi(2f)tvtk_attachments │ ├── ivtk_example.png │ ├── simple_tvtk_cone.py │ ├── vis_quad.png │ └── vis_quad.py ├── MayaVi.txt ├── MayaVi_attachments │ ├── 5_2_1.png │ ├── mayavi.png │ ├── mayavi2.png │ └── mlab.png ├── MetaArray.txt ├── MetaArray_attachments │ ├── MetaArray.py │ └── example.png ├── MultiDot.txt ├── Multithreading.txt ├── Multithreading_attachments │ ├── handythread.py │ └── test_handythread.py ├── OLS.txt ├── OLS_attachments │ ├── ols.0.1.py │ └── ols.0.2.py ├── Obarray.txt ├── Obarray_attachments │ ├── obarray.py │ └── test_obarray.py ├── OldMatplotlib.txt ├── OptimizationAndFitDemo1.txt ├── OptimizationAndFitDemo1_attachments │ └── chacoscreenshot.png ├── OptimizationDemo1.txt ├── OptimizationDemo1_attachments │ ├── NumPyOptimization.png │ ├── NumPyOptimizationSmall.png │ └── mplscreenshot.png ├── PIL.txt ├── ParticleFilter.txt ├── ParticleFilter_attachments │ ├── pftrack.jpg │ ├── pftrack.png │ ├── pftracking.jpg │ └── track.jpg ├── Pyrex_and_NumPy.txt ├── RANSAC.txt ├── RANSAC_attachments │ ├── ransac.png │ └── ransac.py ├── RadialBasisFunctions.txt ├── RadialBasisFunctions_attachments │ ├── rbf1d.png │ ├── rbf1dnew.png │ ├── rbf2d.png │ └── rbf2dnew.png ├── RankNullspace.txt ├── Reading_Custom_Text_Files_with_Pyparsing.txt ├── Reading_Custom_Text_Files_with_Pyparsing_attachments │ ├── ConfigNumParser_v0.1.1.py │ ├── ConfigNumParser_v0.1.py │ ├── data.txt │ └── data3.txt ├── Reading_SPE_files.txt ├── Reading_SPE_files_attachments │ ├── lampe_dt.png │ └── read_spe.zip ├── Reading_mat_files.txt ├── Rebinning.txt ├── Recarray.txt ├── SWIG_Memory_Deallocation.txt ├── SWIG_NumPy_examples.txt ├── SWIG_and_NumPy.txt ├── SWIG_and_NumPy_attachments │ └── umfpack.i ├── SavitzkyGolay.txt ├── SavitzkyGolay_attachments │ ├── Original+noise+filtered.pdf │ ├── Original+noise.pdf │ ├── Original.pdf │ └── cd_spec.png ├── SchrodingerFDTD.txt ├── SchrodingerFDTD_attachments │ ├── Schrodinger_FDTD.pdf │ ├── Schrodinger_FDTD_new.pdf │ ├── schrod_barrier_hi_sm.png │ ├── schrod_barrier_hi_sm2.png │ ├── schrod_barrier_lo_sm.png │ ├── schrod_barrier_lo_sm2.png │ ├── schrod_step_hi_sm.png │ ├── schrod_step_hi_sm2.png │ ├── schrod_step_init_sm.png │ ├── schrod_step_init_sm2.png │ ├── schrod_step_lo_sm.png │ └── schrod_step_lo_sm2.png ├── SegmentAxis.txt ├── SegmentAxis_attachments │ └── segmentaxis.py ├── SignalSmooth.txt ├── SignalSmooth_attachments │ ├── convolved.png │ ├── cookb_signalsmooth.py │ ├── noisy.png │ └── smoothsignal.jpg ├── Solving_Large_Markov_Chains.txt ├── Solving_Large_Markov_Chains_attachments │ ├── pi.png │ └── tandemqueue.py ├── SphericalBesselZeros.txt ├── SphericalBesselZeros_attachments │ └── snapshot.png ├── Theoretical_Ecology(2f)Hastings_and_Powell.txt ├── Theoretical_Ecology.txt ├── TimeSeries(2f)FAQ.txt ├── TimeSeries.txt ├── ViewsVsCopies.txt ├── Watershed.txt ├── Watershed_attachments │ └── watershed.png ├── Weave.txt ├── Weave_attachments │ ├── fftmod.tar.gz │ ├── iterators.py │ └── iterators_example.py ├── Zombie_Apocalypse_ODEINT.txt ├── Zombie_Apocalypse_ODEINT_attachments │ ├── zombie_nodead_nobirths.png │ ├── zombie_somedead_10birth.png │ └── zombie_somedead_nobirth.png ├── dbase.txt ├── dbase_attachments │ ├── data.0.3.csv │ ├── data.csv │ ├── dbase.0.1.py │ ├── dbase.0.2.py │ ├── dbase.0.3.py │ ├── dbase.0.4.py │ ├── dbase.0.5.py │ ├── dbase.0.6.py │ ├── dbase.0.7.py │ ├── dbase.py │ ├── dbase.pydoc │ ├── dbase_pydoc.0.1.txt │ ├── dbase_pydoc.0.2.txt │ ├── ex_plot.0.1.png │ ├── ex_plot.png │ ├── ex_plot1.png │ ├── example_plot.png │ └── pydoc ├── f2py_and_NumPy.txt ├── hdf5_in_Matlab.txt ├── hdf5_in_Matlab_attachments │ ├── h5load.m │ └── hdf5matlab.zip ├── mplot3D.txt ├── multiprocessing.txt ├── vtkVolumeRendering.txt ├── wxPython_dialogs.txt ├── xplt.txt └── xplt_attachments │ └── surface.png ├── pweave_all.py ├── rst ├── ASTER.rst ├── A_Numerical_Agnostic_Pyrex_Class.rst ├── A_Pyrex_Agnostic_Class.rst ├── AccumarrayLike.rst ├── ApplyFIRFilter.rst ├── ArrayStruct_and_Pyrex.rst ├── Autovectorize.rst ├── BrownianMotion.rst ├── BuildingArrays.rst ├── ButterworthBandpass.rst ├── C_Extensions(2f)NumPy_arrays.rst ├── C_Extensions.rst ├── CommTheory.rst ├── CompilingExtensionsOnWindowsWithMinGW.rst ├── CorrelatedRandomSamples.rst ├── CoupledSpringMassSystem.rst ├── Ctypes.rst ├── DataFrame.rst ├── Data_Acquisition_with_NIDAQmx.rst ├── Data_Acquisition_with_PyUL.rst ├── EmbeddingInTraitsGUI.rst ├── EyeDiagram.rst ├── F2Py.rst ├── FIRFilter.rst ├── FiltFilt.rst ├── Finding_Convex_Hull.rst ├── Finding_Convex_Hull_Minimum_Point.rst ├── FittingData.rst ├── FortranIO(2f)FortranFile(2e).rst ├── FortranIO(2f)FortranFile.rst ├── FortranIO.rst ├── FrequencySweptDemo.rst ├── GMailPM.rst ├── GameOfLifeStrides.rst ├── Histograms.rst ├── Indexing.rst ├── InputOutput.rst ├── Interpolation.rst ├── Intersection.rst ├── KDTree.rst ├── KalmanFiltering.rst ├── KdV.rst ├── LASReader.rst ├── Least_Squares_Circle.rst ├── LineIntegralConvolution.rst ├── LinearClassification.rst ├── LinearRegression.rst ├── LoktaVolterraTutorial.rst ├── Matplotlib(2f)AdjustingImageSize.rst ├── Matplotlib(2f)Animations.rst ├── Matplotlib(2f)Arrows.rst ├── Matplotlib(2f)BarCharts.rst ├── Matplotlib(2f)ColormapTransformations.rst ├── Matplotlib(2f)Common_Errors.rst ├── Matplotlib(2f)CompilingMatPlotLibOnSolaris10.rst ├── Matplotlib(2f)CustomLogLabels.rst ├── Matplotlib(2f)DeletingAnExistingDataSeries.rst ├── Matplotlib(2f)Django.rst ├── Matplotlib(2f)Drag_n_Drop_Text_Example.rst ├── Matplotlib(2f)EmbeddingInWx.rst ├── Matplotlib(2f)Gridding_irregularly_spaced_data.rst ├── Matplotlib(2f)HintonDiagrams.rst ├── Matplotlib(2f)Interactive_Plotting.rst ├── Matplotlib(2f)LaTeX_Examples.rst ├── Matplotlib(2f)Legend.rst ├── Matplotlib(2f)LoadImage.rst ├── Matplotlib(2f)Loading_a_colormap_dynamically.rst ├── Matplotlib(2f)Maps.rst ├── Matplotlib(2f)Matplotlib_and_Zope.rst ├── Matplotlib(2f)MulticoloredLine.rst ├── Matplotlib(2f)MultilinePlots.rst ├── Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label.rst ├── Matplotlib(2f)Plotting_Images_with_Special_Values.rst ├── Matplotlib(2f)Plotting_values_with_masked_arrays.rst ├── Matplotlib(2f)PySide.rst ├── Matplotlib(2f)Qt_with_IPython_and_Designer.rst ├── Matplotlib(2f)ScrollingPlot.rst ├── Matplotlib(2f)ShadedRegions.rst ├── Matplotlib(2f)Show_colormaps.rst ├── Matplotlib(2f)SigmoidalFunctions.rst ├── Matplotlib(2f)ThickAxes.rst ├── Matplotlib(2f)Transformations.rst ├── Matplotlib(2f)TreeMap.rst ├── Matplotlib(2f)UnfilledHistograms.rst ├── Matplotlib(2f)UsingTex.rst ├── Matplotlib(2f)Using_MatPlotLib_in_a_CGI_script.rst ├── Matplotlib(2f)VTK_Integration.rst ├── Matplotlib(2f)converting_a_matrix_to_a_raster_image.rst ├── Matplotlib(2f)mplot3D.rst ├── Matplotlib.rst ├── MayaVi(2f)InstallPythonStuffFromSource.rst ├── MayaVi(2f)Installation.rst ├── MayaVi(2f)RunningMayavi2.rst ├── MayaVi(2f)ScriptingMayavi2(2f)BasicModules.rst ├── MayaVi(2f)ScriptingMayavi2(2f)Filters.rst ├── MayaVi(2f)ScriptingMayavi2(2f)MainModules.rst ├── MayaVi(2f)ScriptingMayavi2.rst ├── MayaVi(2f)Surf.rst ├── MayaVi(2f)Tips.rst ├── MayaVi(2f)examples.rst ├── MayaVi(2f)mlab.rst ├── MayaVi(2f)tvtk.rst ├── MayaVi.rst ├── MetaArray.rst ├── MultiDot.rst ├── Multithreading.rst ├── OLS.rst ├── Obarray.rst ├── OldMatplotlib.rst ├── OptimizationAndFitDemo1.rst ├── OptimizationDemo1.rst ├── PIL.rst ├── ParticleFilter.rst ├── Pyrex_and_NumPy.rst ├── RANSAC.rst ├── RadialBasisFunctions.rst ├── RankNullspace.rst ├── Reading_Custom_Text_Files_with_Pyparsing.rst ├── Reading_SPE_files.rst ├── Reading_mat_files.rst ├── Rebinning.rst ├── Recarray.rst ├── SWIG_Memory_Deallocation.rst ├── SWIG_NumPy_examples.rst ├── SWIG_and_NumPy.rst ├── SavitzkyGolay.rst ├── SchrodingerFDTD.rst ├── SegmentAxis.rst ├── SignalSmooth.rst ├── Solving_Large_Markov_Chains.rst ├── SphericalBesselZeros.rst ├── Theoretical_Ecology(2f)Hastings_and_Powell.rst ├── Theoretical_Ecology.rst ├── TimeSeries(2f)FAQ.rst ├── TimeSeries.rst ├── ViewsVsCopies.rst ├── Watershed.rst ├── Weave.rst ├── Zombie_Apocalypse_ODEINT.rst ├── dbase.rst ├── f2py_and_NumPy.rst ├── hdf5_in_Matlab.rst ├── mplot3D.rst ├── multiprocessing.rst ├── vtkVolumeRendering.rst ├── wxPython_dialogs.rst └── xplt.rst └── scrape_cookbook.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Converting Scipy Cookbook 2 | 3 | This repo contains Scipy cookbook partially converted to sphinx format 4 | 5 | The folders contain various stages of conversion: 6 | 7 | * **originals** contains the wiki source and attachments scraped from 8 | wiki dump posted by Robert Kern 9 | http://mail.scipy.org/pipermail/scipy-dev/2013-May/018792.html. using 10 | scrape_cookbook.py 11 | 12 | * **converted** Contains files converted to 13 | [Pweave](http://mpastell.com) rst+noweb file format converted with Pandoc. 14 | 15 | * **attachments** is Pweave files with fixed attachment formatting 16 | that wasn't handled by Pandoc. 17 | 18 | * **rst** Has the files converted to rst format using Pweave, notice 19 | that the code is not run so Pweave just formats code for Sphinx 20 | documents. ~30% of the examples can be run with Pweave to produce 21 | meaningful output with captured figures and code. 22 | 23 | * **Ipython** Cookbook pages converted to IPython notebook script format, these 24 | can be directly imported to IPython notebooks. 25 | 26 | You can see the result of conversion in [here](http://mpastell.github.io) 27 | -------------------------------------------------------------------------------- /attachments/ASTER.Pnw: -------------------------------------------------------------------------------- 1 | Describe Cookbook/ASTER here. ... 2 | 3 | -------------------------------------------------------------------------------- /attachments/A_Pyrex_Agnostic_Class.Pnw: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/A\_Numerical\_Agnostic\_Pyrex\_Class 2 | 3 | 4 | -------------------------------------------------------------------------------- /attachments/FortranIO(2f)FortranFile(2e).Pnw: -------------------------------------------------------------------------------- 1 | This page should be removed. It's content is now available at 2 | Cookbook/FortranIO/FortranFile 3 | 4 | -------------------------------------------------------------------------------- /attachments/GMailPM.Pnw: -------------------------------------------------------------------------------- 1 | Note to the administrators of scipy/cookbook 2 | ============================================ 3 | 4 | I'm planning to describe a method that could help other people to keep 5 | track of their simulations and provide simple framework. It is available 6 | as `pypi `__ package. A tutorial can be found 7 | `here `__. 8 | In the recipe I would just describe what I did in the python code. 9 | 10 | Do you think this is appropriate here? The script does not make use of 11 | scipy or numpy but I think the audience of scipy.org might like the 12 | idea! Please let me know if this is an inappropriate recipe, otherwise I 13 | will just start writing next week. 14 | 15 | Basics 16 | ====== 17 | 18 | The idea is to use python in combination with gmail as a powerful but 19 | yet simple tool to document runs of computer simulations, their 20 | parameters, starting times, progress and results. 21 | 22 | 23 | <>= 24 | #!python numbers=disable 25 | import numpy as np 26 | #test 27 | @ 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /attachments/Intersection.Pnw: -------------------------------------------------------------------------------- 1 | Find the points at which two given functions intersect 2 | ------------------------------------------------------ 3 | 4 | Consider the example of finding the intersection of a polynomial and a 5 | line: 6 | 7 | 8 | <>= 9 | y1=x1^2 10 | y2=x2+1 11 | @ 12 | 13 | 14 | 15 | 16 | <>= 17 | from scipy.optimize import fsolve 18 | 19 | import numpy as np 20 | 21 | def f(xy): 22 | x, y = xy 23 | z = np.array([y - x**2, y - x - 1.0]) 24 | return z 25 | 26 | fsolve(f, [1.0, 2.0]) 27 | @ 28 | 29 | The result of this should be: 30 | 31 | 32 | <>= 33 | array([ 1.61803399, 2.61803399]) 34 | @ 35 | 36 | See also: 37 | http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fsolve.html#scipy.optimize.fsolve 38 | 39 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)Arrows.Pnw: -------------------------------------------------------------------------------- 1 | Some example code for how to plot an arrow using the Arrow function. 2 | 3 | 4 | <>= 5 | from pylab import * 6 | from numarray import * 7 | 8 | x = arange(10) 9 | y = x 10 | 11 | # Plot junk and then a filled region 12 | plot(x, y) 13 | 14 | # Now lets make an arrow object 15 | arr = Arrow(2, 2, 1, 1, edgecolor='white') 16 | 17 | # Get the subplot that we are currently working on 18 | ax = gca() 19 | 20 | # Now add the arrow 21 | ax.add_patch(arr) 22 | 23 | # We should be able to make modifications to the arrow. 24 | # Lets make it green. 25 | arr.set_facecolor('g') 26 | @ 27 | 28 | .. image:: Matplotlib(2f)Arrows_attachments/plot_arrow.png 29 | 30 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)BarCharts.Pnw: -------------------------------------------------------------------------------- 1 | Use the bar function to make bar charts: 2 | http://matplotlib.sourceforge.net/matplotlib.pylab.html\ #-bar 3 | 4 | Here's an example script that makes a bar char with error bars and 5 | labels centered under the bars. 6 | 7 | 8 | <>= 9 | #!/usr/bin/env python 10 | import numpy.numarray as na 11 | 12 | from pylab import * 13 | 14 | labels = ["Baseline", "System"] 15 | data = [3.75 , 4.75] 16 | error = [0.3497 , 0.3108] 17 | 18 | xlocations = na.array(range(len(data)))+0.5 19 | width = 0.5 20 | bar(xlocations, data, yerr=error, width=width) 21 | yticks(range(0, 8)) 22 | xticks(xlocations+ width/2, labels) 23 | xlim(0, xlocations[-1]+width*2) 24 | title("Average Ratings on the Training Set") 25 | gca().get_xaxis().tick_bottom() 26 | gca().get_yaxis().tick_left() 27 | 28 | show() 29 | @ 30 | 31 | `` .. image:: Matplotlib(2f)BarCharts_attachments/barchart.png`` 32 | 33 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)Common_Errors.Pnw: -------------------------------------------------------------------------------- 1 | ``* imshow - You can get seemingly quirky behavior if you do not set vmin and vmax manually. If they are left unset, then !AxisImage will attempt to automatically scale the values of the elements in order to keep the luminance constant. However, if you are doing something like an animation, or want to compare two images against each other, this can cause problems. For example, if you know your values will range between 0 and 1, you can do: imshow(img, vmin=0, vmax=1, cmap=cm.gray, interpolation=``\ \ ``). This also sets the color map to grays, and to use square blocks for the elements.`` 2 | 3 | -------------- 4 | 5 | CategoryCookbookMatplotlib 6 | 7 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)DeletingAnExistingDataSeries.Pnw: -------------------------------------------------------------------------------- 1 | Each axes instance contains a lines attribute, which is a list of the 2 | data series in the plot, added in chronological order. To delete a 3 | particular data series, one must simply delete the appropriate element 4 | of the lines list and redraw if necessary. 5 | 6 | The is illustrated in the following example from an interactive session: 7 | 8 | 9 | <>= 10 | >>> x = N.arange(10) 11 | 12 | >>> fig = P.figure() 13 | >>> ax = fig.add_subplot(111) 14 | >>> ax.plot(x) 15 | [] 16 | 17 | >>> ax.plot(x+10) 18 | [] 19 | 20 | >>> ax.plot(x+20) 21 | [] 22 | 23 | >>> P.show() 24 | >>> ax.lines 25 | [, 26 | , 27 | ] 28 | 29 | >>> del ax.lines[1] 30 | >>> P.show() 31 | @ 32 | 33 | which will plot three lines, and then delete the second. 34 | 35 | -------------- 36 | 37 | CategoryCookbookMatplotlib 38 | 39 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)LoadImage.Pnw: -------------------------------------------------------------------------------- 1 | Image processing often works on gray scale images that were stored as 2 | PNG files. How do we import / export that file into ? 3 | 4 | ``* Here is a recipy to do this with Matplotlib using the ``\ \ `` function (your image is called ``\ \ ``). ``\ 5 | 6 | This permits to do some processing for further exporting such as for 7 | [:Cookbook/Matplotlib/converting\_a\_matrix\_to\_a\_raster\_image:converting 8 | a matrix to a raster image]. In the newest version of pylab (check that 9 | your is superior to ) you get directly a 2D numpy array if the image is 10 | grayscale. 11 | 12 | ``* to write an image, do ``\ 13 | 14 | ``* this kind of functions live also under ``\ \ ``, see for instance ``\ \ `` to create a color image:``\ 15 | 16 | ``* to define the range, use:``\ \ `` (adapted from ``\ ```http://telin.ugent.be/~slippens/drupal/scipy_unscaledimsave`` `__\ `` )`` 17 | 18 | ``* there was another (more direct) method suggested by ``\ ```http://jehiah.cz/archive/creating-images-with-numpy`` `__ 19 | 20 | -------------- 21 | 22 | CategoryCookbookMatplotlib 23 | 24 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)PySide.Pnw: -------------------------------------------------------------------------------- 1 | This is a very basic example showing how to display a matplotlib plot 2 | within a Qt application using PySide. In case of problems try to change 3 | the rcParam entry “backend.qt4” to "PySide" (e.g. by in the matplotlibrc 4 | file). 5 | 6 | 7 | <>= 8 | #!/usr/bin/env python 9 | import sys 10 | import matplotlib 11 | matplotlib.use('Qt4Agg') 12 | import pylab 13 | 14 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 15 | from matplotlib.figure import Figure 16 | 17 | from PySide import QtCore, QtGui 18 | 19 | if __name__ == '__main__': 20 | app = QtGui.QApplication(sys.argv) 21 | 22 | # generate the plot 23 | fig = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0)) 24 | ax = fig.add_subplot(111) 25 | ax.plot([0,1]) 26 | # generate the canvas to display the plot 27 | canvas = FigureCanvas(fig) 28 | 29 | win = QtGui.QMainWindow() 30 | # add the plot canvas to a window 31 | win.setCentralWidget(canvas) 32 | 33 | win.show() 34 | 35 | sys.exit(app.exec_()) 36 | @ 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)ShadedRegions.Pnw: -------------------------------------------------------------------------------- 1 | Use the fill function to make shaded regions of any color tint. Here is 2 | an example. 3 | 4 | 5 | <>= 6 | 7 | from pylab import * 8 | 9 | x = arange(10) 10 | y = x 11 | 12 | # Plot junk and then a filled region 13 | plot(x, y) 14 | 15 | # Make a blue box that is somewhat see-through 16 | # and has a red border. 17 | # WARNING: alpha doesn't work in postscript output.... 18 | fill([3,4,4,3], [2,2,4,4], 'b', alpha=0.2, edgecolor='r') 19 | @ 20 | 21 | .. image:: Matplotlib(2f)ShadedRegions_attachments/shaded.png 22 | 23 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)ThickAxes.Pnw: -------------------------------------------------------------------------------- 1 | Example of how to thicken the lines around your plot (axes lines) and to 2 | get big bold fonts on the tick and axis labels. 3 | 4 | 5 | <>= 6 | from pylab import * 7 | 8 | # Thicken the axes lines and labels 9 | # 10 | # Comment by J. R. Lu: 11 | # I couldn't figure out a way to do this on the 12 | # individual plot and have it work with all backends 13 | # and in interactive mode. So, used rc instead. 14 | # 15 | rc('axes', linewidth=2) 16 | 17 | # Make a dummy plot 18 | plot([0, 1], [0, 1]) 19 | 20 | # Change size and font of tick labels 21 | # Again, this doesn't work in interactive mode. 22 | fontsize = 14 23 | ax = gca() 24 | 25 | for tick in ax.xaxis.get_major_ticks(): 26 | tick.label1.set_fontsize(fontsize) 27 | tick.label1.set_fontweight('bold') 28 | for tick in ax.yaxis.get_major_ticks(): 29 | tick.label1.set_fontsize(fontsize) 30 | tick.label1.set_fontweight('bold') 31 | 32 | xlabel('X Axis', fontsize=16, fontweight='bold') 33 | ylabel('Y Axis', fontsize=16, fontweight='bold') 34 | 35 | # Save figure 36 | savefig('thick_axes.png') 37 | @ 38 | 39 | .. image:: Matplotlib(2f)ThickAxes_attachments/thick_axes.png 40 | 41 | -------------------------------------------------------------------------------- /attachments/Matplotlib(2f)converting_a_matrix_to_a_raster_image.Pnw: -------------------------------------------------------------------------------- 1 | Scipy provides a command (imsave) to make a raster (png, jpg...) image 2 | from a 2D array, each pixel corresponding to one value of the array. Yet 3 | the image is black and white. 4 | 5 | Here is a recipy to do this with Matplotlib, and use a colormap to give 6 | color to the image. 7 | 8 | 9 | <>= 10 | from pylab import * 11 | from scipy import mgrid 12 | 13 | def imsave(filename, X, **kwargs): 14 | """ Homebrewed imsave to have nice colors... """ 15 | figsize=(array(X.shape)/100.0)[::-1] 16 | rcParams.update({'figure.figsize':figsize}) 17 | fig = figure(figsize=figsize) 18 | axes([0,0,1,1]) # Make the plot occupy the whole canvas 19 | axis('off') 20 | fig.set_size_inches(figsize) 21 | imshow(X,origin='lower', **kwargs) 22 | savefig(filename, facecolor='black', edgecolor='black', dpi=100) 23 | close(fig) 24 | 25 | 26 | X,Y=mgrid[-5:5:0.1,-5:5:0.1] 27 | Z=sin(X**2+Y**2+1e-4)/(X**2+Y**2+1e-4) # Create the data to be plotted 28 | imsave('imsave.png', Z, cmap=cm.hot ) 29 | @ 30 | 31 | .. image:: Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.png 32 | 33 | -------------------------------------------------------------------------------- /attachments/MayaVi(2f)Installation.Pnw: -------------------------------------------------------------------------------- 1 | TableOfContents 2 | 3 | !MayaVi2 and TVTK are part of the `enthought tool 4 | suite `__. 5 | 6 | **These instructions are out of date**, see the `Mayavi2 7 | homepage `__ 8 | 9 | -------------- 10 | 11 | CategoryInstallation 12 | 13 | -------------------------------------------------------------------------------- /attachments/Obarray.Pnw: -------------------------------------------------------------------------------- 1 | Object arrays using record arrays 2 | ================================= 3 | 4 | numpy supports working with arrays of python objects, but these arrays 5 | lack the type-uniformity of normal numpy arrays, so they can be quite 6 | inefficient in terms of space and time, and they can be quite cumbersome 7 | to work with. However, it would often be useful to be able to store a 8 | user-defined class in an array. 9 | 10 | One approach is to take advantage of numpy's record arrays. These are 11 | arrays in which each element can be large, as it has named and typed 12 | fields; essentially they are numpy's equivalent to arrays of C 13 | structures. Thus if one had a class consisting of some data - named 14 | fields, each of a numpy type - and some methods, one could represent the 15 | data for an array of these objects as a record array. Getting the 16 | methods is more tricky. 17 | 18 | One approach is to create a custom subclass of the numpy array which 19 | handles conversion to and from your object type. The idea is to store 20 | the data for each instance internally in a record array, but when 21 | indexing returns a scalar, construct a new instance from the data in the 22 | records. Similarly, when assigning to a particular element, the array 23 | subclass would convert an instance to its representation as a record. 24 | 25 | Attached is an implementation of the above scheme. 26 | 27 | -------------------------------------------------------------------------------- /attachments/OldMatplotlib.Pnw: -------------------------------------------------------------------------------- 1 | Recipes listed here still exist on the Wiki, but are being contributed 2 | to Matplotlib and will eventually be deleted. 3 | 4 | ``* ["Plotting Tutorial"].`` 5 | 6 | #. 7 | 8 | #. THIS IS A BROKEN LINK! Anyone have the page? 9 | #. See also the `old 10 | version `__. 11 | 12 | ``* [:Cookbook/Matplotlib/mplot3D:3D Plotting with Matplotlib]. Simple 3D plots using matplotlib and its now-included 3D capabilities.`` 13 | 14 | -------------------------------------------------------------------------------- /attachments/RANSAC.Pnw: -------------------------------------------------------------------------------- 1 | The attached file ( .. image:: RANSAC_attachments/ransac.py ) implements the `RANSAC 2 | algorithm `__. An example image: 3 | 4 | .. image:: RANSAC_attachments/ransac.png 5 | 6 | To run the file, save it to your computer, start IPython 7 | 8 | 9 | <>= 10 | ipython -wthread 11 | @ 12 | 13 | Import the module and run the test program 14 | 15 | 16 | <>= 17 | import ransac 18 | ransac.test() 19 | @ 20 | 21 | To use the module you need to create a model class with two methods 22 | 23 | 24 | <>= 25 | def fit(self, data): 26 | """Given the data fit the data with your model and return the model (a vector)""" 27 | def get_error(self, data, model): 28 | """Given a set of data and a model, what is the error of using this model to estimate the data """ 29 | @ 30 | 31 | An example of such model is the class LinearLeastSquaresModel as seen 32 | the file source (below) 33 | 34 | .. image:: RANSAC_attachments/ransac.py 35 | 36 | -------------- 37 | 38 | ``CategoryCookbook`` 39 | 40 | -------------------------------------------------------------------------------- /attachments/Theoretical_Ecology.Pnw: -------------------------------------------------------------------------------- 1 | - [:Cookbook/Theoretical Ecology/Hastings and Powell: Chaos in a 2 | 3-Species Food-Chain] 3 | 4 | -------------------------------------------------------------------------------- /attachments/TimeSeries.Pnw: -------------------------------------------------------------------------------- 1 | For the offical documentation created by the developers of the 2 | timeseries scikit `click here `__. 3 | 4 | Here on the [:Cookbook] you may find some useful and complementary 5 | information: 6 | 7 | | ``* [:Cookbook/TimeSeries/FAQ:FAQ]`` 8 | | ``*Recipies`` 9 | 10 | -------------------------------------------------------------------------------- /attachments/mplot3D.Pnw: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/Matplotlib/mplot3D 2 | 3 | 4 | -------------------------------------------------------------------------------- /attachments/multiprocessing.Pnw: -------------------------------------------------------------------------------- 1 | The multiprocessing standard module 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | This page was obsolete as multiprocessing's internals have changed. More 5 | information will come shortly; a link to this page will then be added 6 | back to the Cookbook. 7 | 8 | -------------- 9 | 10 | CategoryCookbook 11 | 12 | -------------------------------------------------------------------------------- /attachments/xplt.Pnw: -------------------------------------------------------------------------------- 1 | This shows a simple example of how to create a quick 3-d surface 2 | visualization using xplt. 3 | 4 | 5 | <>= 6 | 7 | from scipy.sandbox import xplt 8 | from numpy import * 9 | from scipy import special 10 | 11 | x,y = ogrid[-12:12:50j,-12:12:50j] 12 | r = sqrt(x**2+y**2) 13 | z = special.j0(r) 14 | xplt.surf(z,x,y,shade=1,palette='heat') 15 | @ 16 | 17 | .. image:: xplt_attachments/surface.png 18 | 19 | -------------------------------------------------------------------------------- /convert_attachments.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | 4 | ext = ".Pnw" 5 | target = 'ipython/' 6 | 7 | os.chdir('ipython') 8 | docs = glob.glob('*' + ext) 9 | 10 | 11 | def convert_attachments(lines, path): 12 | n = len(lines) 13 | new = [] 14 | for i in range(n): 15 | line = lines[i] 16 | if "attachment:" in line: 17 | r = line.replace("attachment:", ".. image:: " + path) 18 | r = r.replace("\\_", "_") 19 | elif "inline:" in line: 20 | r = line.replace(" ", "\n\n") 21 | r = r.replace("inline:", ".. image:: " + path) 22 | r = r.replace("\\_", "_") 23 | else: 24 | r = line 25 | new.append(r) 26 | return("".join(new)) 27 | 28 | 29 | for doc in docs[:]: 30 | lines = open(doc).readlines() 31 | impath = doc.replace(ext, "") + "_attachments/" 32 | converted = convert_attachments(lines, impath) 33 | new = open('../' + target + doc, "w") 34 | new.write(converted) 35 | new.close() -------------------------------------------------------------------------------- /convert_attachments_markdown.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | 4 | ext = ".py" 5 | target = 'ipython/' 6 | 7 | os.chdir('tmp') 8 | docs = glob.glob('*' + ext) 9 | 10 | 11 | def convert_attachments(lines, path): 12 | n = len(lines) 13 | new = [] 14 | for i in range(n): 15 | line = lines[i] 16 | if "attachment:" in line: 17 | r = line.replace("attachment:", "![](" + path) + ")" 18 | r = r.replace("\\_", "_") 19 | elif "inline:" in line: 20 | r = line.replace("# ", "") 21 | r = r.replace(" ", ") ", 1) 22 | r = r.replace("inline:", "![](" + path ) 23 | r = "# " + r.replace("\\_", "_") 24 | else: 25 | r = line 26 | new.append(r) 27 | return("".join(new)) 28 | 29 | 30 | for doc in docs[:]: 31 | lines = open(doc).readlines() 32 | impath = "files/" + doc.replace(ext, "") + "_attachments/" 33 | converted = convert_attachments(lines, impath) 34 | new = open('../' + target + doc, "w") 35 | new.write(converted) 36 | new.close() -------------------------------------------------------------------------------- /convert_to_pweave.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | import pweave 4 | import shutil 5 | 6 | os.chdir('originals') 7 | docs = glob.glob('*.txt') 8 | 9 | for doc in docs: 10 | pweave.convert(doc, "wiki", "noweb", "-f mediawiki -t rst") 11 | new = "../converted/" + doc.replace(".txt", ".Pnw") 12 | shutil.move(doc.replace(".txt", '.Pnw'), new) 13 | pweave.convert(doc, "wiki", "ipython", "-f mediawiki -t markdown") 14 | new = "../tmp/" + doc.replace(".txt", ".py") 15 | shutil.move(doc.replace(".txt", '.py'), new) -------------------------------------------------------------------------------- /converted/ASTER.Pnw: -------------------------------------------------------------------------------- 1 | Describe Cookbook/ASTER here. ... 2 | 3 | -------------------------------------------------------------------------------- /converted/A_Pyrex_Agnostic_Class.Pnw: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/A\_Numerical\_Agnostic\_Pyrex\_Class 2 | 3 | 4 | -------------------------------------------------------------------------------- /converted/FortranIO(2f)FortranFile(2e).Pnw: -------------------------------------------------------------------------------- 1 | This page should be removed. It's content is now available at 2 | Cookbook/FortranIO/FortranFile 3 | 4 | -------------------------------------------------------------------------------- /converted/GMailPM.Pnw: -------------------------------------------------------------------------------- 1 | Note to the administrators of scipy/cookbook 2 | ============================================ 3 | 4 | I'm planning to describe a method that could help other people to keep 5 | track of their simulations and provide simple framework. It is available 6 | as `pypi `__ package. A tutorial can be found 7 | `here `__. 8 | In the recipe I would just describe what I did in the python code. 9 | 10 | Do you think this is appropriate here? The script does not make use of 11 | scipy or numpy but I think the audience of scipy.org might like the 12 | idea! Please let me know if this is an inappropriate recipe, otherwise I 13 | will just start writing next week. 14 | 15 | Basics 16 | ====== 17 | 18 | The idea is to use python in combination with gmail as a powerful but 19 | yet simple tool to document runs of computer simulations, their 20 | parameters, starting times, progress and results. 21 | 22 | 23 | <>= 24 | #!python numbers=disable 25 | import numpy as np 26 | #test 27 | @ 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /converted/Intersection.Pnw: -------------------------------------------------------------------------------- 1 | Find the points at which two given functions intersect 2 | ------------------------------------------------------ 3 | 4 | Consider the example of finding the intersection of a polynomial and a 5 | line: 6 | 7 | 8 | <>= 9 | y1=x1^2 10 | y2=x2+1 11 | @ 12 | 13 | 14 | 15 | 16 | <>= 17 | from scipy.optimize import fsolve 18 | 19 | import numpy as np 20 | 21 | def f(xy): 22 | x, y = xy 23 | z = np.array([y - x**2, y - x - 1.0]) 24 | return z 25 | 26 | fsolve(f, [1.0, 2.0]) 27 | @ 28 | 29 | The result of this should be: 30 | 31 | 32 | <>= 33 | array([ 1.61803399, 2.61803399]) 34 | @ 35 | 36 | See also: 37 | http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fsolve.html#scipy.optimize.fsolve 38 | 39 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)Arrows.Pnw: -------------------------------------------------------------------------------- 1 | Some example code for how to plot an arrow using the Arrow function. 2 | 3 | 4 | <>= 5 | from pylab import * 6 | from numarray import * 7 | 8 | x = arange(10) 9 | y = x 10 | 11 | # Plot junk and then a filled region 12 | plot(x, y) 13 | 14 | # Now lets make an arrow object 15 | arr = Arrow(2, 2, 1, 1, edgecolor='white') 16 | 17 | # Get the subplot that we are currently working on 18 | ax = gca() 19 | 20 | # Now add the arrow 21 | ax.add_patch(arr) 22 | 23 | # We should be able to make modifications to the arrow. 24 | # Lets make it green. 25 | arr.set_facecolor('g') 26 | @ 27 | 28 | inline:plot\_arrow.png 29 | 30 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)BarCharts.Pnw: -------------------------------------------------------------------------------- 1 | Use the bar function to make bar charts: 2 | http://matplotlib.sourceforge.net/matplotlib.pylab.html\ #-bar 3 | 4 | Here's an example script that makes a bar char with error bars and 5 | labels centered under the bars. 6 | 7 | 8 | <>= 9 | #!/usr/bin/env python 10 | import numpy.numarray as na 11 | 12 | from pylab import * 13 | 14 | labels = ["Baseline", "System"] 15 | data = [3.75 , 4.75] 16 | error = [0.3497 , 0.3108] 17 | 18 | xlocations = na.array(range(len(data)))+0.5 19 | width = 0.5 20 | bar(xlocations, data, yerr=error, width=width) 21 | yticks(range(0, 8)) 22 | xticks(xlocations+ width/2, labels) 23 | xlim(0, xlocations[-1]+width*2) 24 | title("Average Ratings on the Training Set") 25 | gca().get_xaxis().tick_bottom() 26 | gca().get_yaxis().tick_left() 27 | 28 | show() 29 | @ 30 | 31 | `` inline:barchart.png`` 32 | 33 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)Common_Errors.Pnw: -------------------------------------------------------------------------------- 1 | ``* imshow - You can get seemingly quirky behavior if you do not set vmin and vmax manually. If they are left unset, then !AxisImage will attempt to automatically scale the values of the elements in order to keep the luminance constant. However, if you are doing something like an animation, or want to compare two images against each other, this can cause problems. For example, if you know your values will range between 0 and 1, you can do: imshow(img, vmin=0, vmax=1, cmap=cm.gray, interpolation=``\ \ ``). This also sets the color map to grays, and to use square blocks for the elements.`` 2 | 3 | -------------- 4 | 5 | CategoryCookbookMatplotlib 6 | 7 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)DeletingAnExistingDataSeries.Pnw: -------------------------------------------------------------------------------- 1 | Each axes instance contains a lines attribute, which is a list of the 2 | data series in the plot, added in chronological order. To delete a 3 | particular data series, one must simply delete the appropriate element 4 | of the lines list and redraw if necessary. 5 | 6 | The is illustrated in the following example from an interactive session: 7 | 8 | 9 | <>= 10 | >>> x = N.arange(10) 11 | 12 | >>> fig = P.figure() 13 | >>> ax = fig.add_subplot(111) 14 | >>> ax.plot(x) 15 | [] 16 | 17 | >>> ax.plot(x+10) 18 | [] 19 | 20 | >>> ax.plot(x+20) 21 | [] 22 | 23 | >>> P.show() 24 | >>> ax.lines 25 | [, 26 | , 27 | ] 28 | 29 | >>> del ax.lines[1] 30 | >>> P.show() 31 | @ 32 | 33 | which will plot three lines, and then delete the second. 34 | 35 | -------------- 36 | 37 | CategoryCookbookMatplotlib 38 | 39 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)LoadImage.Pnw: -------------------------------------------------------------------------------- 1 | Image processing often works on gray scale images that were stored as 2 | PNG files. How do we import / export that file into ? 3 | 4 | ``* Here is a recipy to do this with Matplotlib using the ``\ \ `` function (your image is called ``\ \ ``). ``\ 5 | 6 | This permits to do some processing for further exporting such as for 7 | [:Cookbook/Matplotlib/converting\_a\_matrix\_to\_a\_raster\_image:converting 8 | a matrix to a raster image]. In the newest version of pylab (check that 9 | your is superior to ) you get directly a 2D numpy array if the image is 10 | grayscale. 11 | 12 | ``* to write an image, do ``\ 13 | 14 | ``* this kind of functions live also under ``\ \ ``, see for instance ``\ \ `` to create a color image:``\ 15 | 16 | ``* to define the range, use:``\ \ `` (adapted from ``\ ```http://telin.ugent.be/~slippens/drupal/scipy_unscaledimsave`` `__\ `` )`` 17 | 18 | ``* there was another (more direct) method suggested by ``\ ```http://jehiah.cz/archive/creating-images-with-numpy`` `__ 19 | 20 | -------------- 21 | 22 | CategoryCookbookMatplotlib 23 | 24 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)PySide.Pnw: -------------------------------------------------------------------------------- 1 | This is a very basic example showing how to display a matplotlib plot 2 | within a Qt application using PySide. In case of problems try to change 3 | the rcParam entry “backend.qt4” to "PySide" (e.g. by in the matplotlibrc 4 | file). 5 | 6 | 7 | <>= 8 | #!/usr/bin/env python 9 | import sys 10 | import matplotlib 11 | matplotlib.use('Qt4Agg') 12 | import pylab 13 | 14 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 15 | from matplotlib.figure import Figure 16 | 17 | from PySide import QtCore, QtGui 18 | 19 | if __name__ == '__main__': 20 | app = QtGui.QApplication(sys.argv) 21 | 22 | # generate the plot 23 | fig = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0)) 24 | ax = fig.add_subplot(111) 25 | ax.plot([0,1]) 26 | # generate the canvas to display the plot 27 | canvas = FigureCanvas(fig) 28 | 29 | win = QtGui.QMainWindow() 30 | # add the plot canvas to a window 31 | win.setCentralWidget(canvas) 32 | 33 | win.show() 34 | 35 | sys.exit(app.exec_()) 36 | @ 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)ShadedRegions.Pnw: -------------------------------------------------------------------------------- 1 | Use the fill function to make shaded regions of any color tint. Here is 2 | an example. 3 | 4 | 5 | <>= 6 | 7 | from pylab import * 8 | 9 | x = arange(10) 10 | y = x 11 | 12 | # Plot junk and then a filled region 13 | plot(x, y) 14 | 15 | # Make a blue box that is somewhat see-through 16 | # and has a red border. 17 | # WARNING: alpha doesn't work in postscript output.... 18 | fill([3,4,4,3], [2,2,4,4], 'b', alpha=0.2, edgecolor='r') 19 | @ 20 | 21 | inline:shaded.png 22 | 23 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)ThickAxes.Pnw: -------------------------------------------------------------------------------- 1 | Example of how to thicken the lines around your plot (axes lines) and to 2 | get big bold fonts on the tick and axis labels. 3 | 4 | 5 | <>= 6 | from pylab import * 7 | 8 | # Thicken the axes lines and labels 9 | # 10 | # Comment by J. R. Lu: 11 | # I couldn't figure out a way to do this on the 12 | # individual plot and have it work with all backends 13 | # and in interactive mode. So, used rc instead. 14 | # 15 | rc('axes', linewidth=2) 16 | 17 | # Make a dummy plot 18 | plot([0, 1], [0, 1]) 19 | 20 | # Change size and font of tick labels 21 | # Again, this doesn't work in interactive mode. 22 | fontsize = 14 23 | ax = gca() 24 | 25 | for tick in ax.xaxis.get_major_ticks(): 26 | tick.label1.set_fontsize(fontsize) 27 | tick.label1.set_fontweight('bold') 28 | for tick in ax.yaxis.get_major_ticks(): 29 | tick.label1.set_fontsize(fontsize) 30 | tick.label1.set_fontweight('bold') 31 | 32 | xlabel('X Axis', fontsize=16, fontweight='bold') 33 | ylabel('Y Axis', fontsize=16, fontweight='bold') 34 | 35 | # Save figure 36 | savefig('thick_axes.png') 37 | @ 38 | 39 | inline:thick\_axes.png 40 | 41 | -------------------------------------------------------------------------------- /converted/Matplotlib(2f)converting_a_matrix_to_a_raster_image.Pnw: -------------------------------------------------------------------------------- 1 | Scipy provides a command (imsave) to make a raster (png, jpg...) image 2 | from a 2D array, each pixel corresponding to one value of the array. Yet 3 | the image is black and white. 4 | 5 | Here is a recipy to do this with Matplotlib, and use a colormap to give 6 | color to the image. 7 | 8 | 9 | <>= 10 | from pylab import * 11 | from scipy import mgrid 12 | 13 | def imsave(filename, X, **kwargs): 14 | """ Homebrewed imsave to have nice colors... """ 15 | figsize=(array(X.shape)/100.0)[::-1] 16 | rcParams.update({'figure.figsize':figsize}) 17 | fig = figure(figsize=figsize) 18 | axes([0,0,1,1]) # Make the plot occupy the whole canvas 19 | axis('off') 20 | fig.set_size_inches(figsize) 21 | imshow(X,origin='lower', **kwargs) 22 | savefig(filename, facecolor='black', edgecolor='black', dpi=100) 23 | close(fig) 24 | 25 | 26 | X,Y=mgrid[-5:5:0.1,-5:5:0.1] 27 | Z=sin(X**2+Y**2+1e-4)/(X**2+Y**2+1e-4) # Create the data to be plotted 28 | imsave('imsave.png', Z, cmap=cm.hot ) 29 | @ 30 | 31 | inline:imsave.png 32 | 33 | -------------------------------------------------------------------------------- /converted/MayaVi(2f)Installation.Pnw: -------------------------------------------------------------------------------- 1 | TableOfContents 2 | 3 | !MayaVi2 and TVTK are part of the `enthought tool 4 | suite `__. 5 | 6 | **These instructions are out of date**, see the `Mayavi2 7 | homepage `__ 8 | 9 | -------------- 10 | 11 | CategoryInstallation 12 | 13 | -------------------------------------------------------------------------------- /converted/MayaVi(2f)Surf.Pnw: -------------------------------------------------------------------------------- 1 | If you want to plot a surface representing a matrix by elevation and 2 | colour of its points you have to transform the matrix data in a 3D data 3 | that !MayaVi2 can understand. [:Cookbook/MayaVi/mlab:mlab] knows how to 4 | do this, but it does not have the nice user interface of !MayaVi2. Here 5 | is a script that create a !SurfRegular object using mlab, and then loads 6 | it in !MayaVi2. A more detailed version of this script is given in the 7 | examples pages [:Cookbook/MayaVi/Examples]. 8 | 9 | 10 | <>= 11 | import numpy 12 | def f(x, y): 13 | return numpy.sin(x*y)/(x*y) 14 | x = numpy.arange(-7., 7.05, 0.1) 15 | y = numpy.arange(-5., 5.05, 0.05) 16 | from enthought.tvtk.tools import mlab 17 | s = mlab.SurfRegular(x, y, f) 18 | from enthought.mayavi.sources.vtk_data_source import VTKDataSource 19 | d = VTKDataSource() 20 | d.data = s.data 21 | mayavi.add_source(d) 22 | from enthought.mayavi.filters.warp_scalar import WarpScalar 23 | w = WarpScalar() 24 | mayavi.add_filter(w) 25 | from enthought.mayavi.modules.outline import Outline 26 | from enthought.mayavi.modules.surface import Surface 27 | o = Outline() 28 | s = Surface() 29 | mayavi.add_module(o) 30 | mayavi.add_module(s) 31 | @ 32 | 33 | You can run this script by running "mayavi2 -n -x script.py", loading it 34 | through the menu (File -> Open File), and pressing Ctrl+R, or entering 35 | "execfile('script.py') in the python shell. 36 | 37 | inline:surf.png 38 | 39 | -------------------------------------------------------------------------------- /converted/Obarray.Pnw: -------------------------------------------------------------------------------- 1 | Object arrays using record arrays 2 | ================================= 3 | 4 | numpy supports working with arrays of python objects, but these arrays 5 | lack the type-uniformity of normal numpy arrays, so they can be quite 6 | inefficient in terms of space and time, and they can be quite cumbersome 7 | to work with. However, it would often be useful to be able to store a 8 | user-defined class in an array. 9 | 10 | One approach is to take advantage of numpy's record arrays. These are 11 | arrays in which each element can be large, as it has named and typed 12 | fields; essentially they are numpy's equivalent to arrays of C 13 | structures. Thus if one had a class consisting of some data - named 14 | fields, each of a numpy type - and some methods, one could represent the 15 | data for an array of these objects as a record array. Getting the 16 | methods is more tricky. 17 | 18 | One approach is to create a custom subclass of the numpy array which 19 | handles conversion to and from your object type. The idea is to store 20 | the data for each instance internally in a record array, but when 21 | indexing returns a scalar, construct a new instance from the data in the 22 | records. Similarly, when assigning to a particular element, the array 23 | subclass would convert an instance to its representation as a record. 24 | 25 | Attached is an implementation of the above scheme. 26 | 27 | -------------------------------------------------------------------------------- /converted/OldMatplotlib.Pnw: -------------------------------------------------------------------------------- 1 | Recipes listed here still exist on the Wiki, but are being contributed 2 | to Matplotlib and will eventually be deleted. 3 | 4 | ``* ["Plotting Tutorial"].`` 5 | 6 | #. 7 | 8 | #. THIS IS A BROKEN LINK! Anyone have the page? 9 | #. See also the `old 10 | version `__. 11 | 12 | ``* [:Cookbook/Matplotlib/mplot3D:3D Plotting with Matplotlib]. Simple 3D plots using matplotlib and its now-included 3D capabilities.`` 13 | 14 | -------------------------------------------------------------------------------- /converted/OptimizationAndFitDemo1.Pnw: -------------------------------------------------------------------------------- 1 | This is a quick example of creating data from several `Bessel 2 | functions `__ 3 | and finding local maxima, then fitting a curve using some spline 4 | functions from the 5 | `scipy.interpolate `__ 6 | module. The `enthought.chaco `__ 7 | package and `wxpython `__ are used for 8 | creating the plot. 9 | `PyCrust `__ (which comes 10 | with wxpython) was used as the python shell. 11 | 12 | 13 | <>= 14 | from enthought.chaco.wx import plt 15 | from scipy import arange, optimize, special 16 | 17 | plt.figure() 18 | plt.hold() 19 | w = [] 20 | z = [] 21 | x = arange(0,10,.01) 22 | 23 | for k in arange(1,5,.5): 24 | y = special.jv(k,x) 25 | plt.plot(x,y) 26 | f = lambda x: -special.jv(k,x) 27 | x_max = optimize.fminbound(f,0,6) 28 | w.append(x_max) 29 | z.append(special.jv(k,x_max)) 30 | 31 | plt.plot(w,z, 'ro') 32 | from scipy import interpolate 33 | t = interpolate.splrep(w, z, k=3) 34 | s_fit3 = interpolate.splev(x,t) 35 | plt.plot(x,s_fit3, 'g-') 36 | t5 = interpolate.splrep(w, z, k=5) 37 | s_fit5 = interpolate.splev(x,t5) 38 | plt.plot(x,s_fit5, 'y-') 39 | @ 40 | 41 | 42 | 43 | 44 | <>= 45 | #class left 46 | 47 | inline:chacoscreenshot.png 48 | Optimization Example 49 | @ 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /converted/RANSAC.Pnw: -------------------------------------------------------------------------------- 1 | The attached file ( attachment:ransac.py ) implements the `RANSAC 2 | algorithm `__. An example image: 3 | 4 | attachment:ransac.png 5 | 6 | To run the file, save it to your computer, start IPython 7 | 8 | 9 | <>= 10 | ipython -wthread 11 | @ 12 | 13 | Import the module and run the test program 14 | 15 | 16 | <>= 17 | import ransac 18 | ransac.test() 19 | @ 20 | 21 | To use the module you need to create a model class with two methods 22 | 23 | 24 | <>= 25 | def fit(self, data): 26 | """Given the data fit the data with your model and return the model (a vector)""" 27 | def get_error(self, data, model): 28 | """Given a set of data and a model, what is the error of using this model to estimate the data """ 29 | @ 30 | 31 | An example of such model is the class LinearLeastSquaresModel as seen 32 | the file source (below) 33 | 34 | inline:ransac.py 35 | 36 | -------------- 37 | 38 | ``CategoryCookbook`` 39 | 40 | -------------------------------------------------------------------------------- /converted/Theoretical_Ecology.Pnw: -------------------------------------------------------------------------------- 1 | - [:Cookbook/Theoretical Ecology/Hastings and Powell: Chaos in a 2 | 3-Species Food-Chain] 3 | 4 | -------------------------------------------------------------------------------- /converted/TimeSeries.Pnw: -------------------------------------------------------------------------------- 1 | For the offical documentation created by the developers of the 2 | timeseries scikit `click here `__. 3 | 4 | Here on the [:Cookbook] you may find some useful and complementary 5 | information: 6 | 7 | | ``* [:Cookbook/TimeSeries/FAQ:FAQ]`` 8 | | ``*Recipies`` 9 | 10 | -------------------------------------------------------------------------------- /converted/mplot3D.Pnw: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/Matplotlib/mplot3D 2 | 3 | 4 | -------------------------------------------------------------------------------- /converted/multiprocessing.Pnw: -------------------------------------------------------------------------------- 1 | The multiprocessing standard module 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | This page was obsolete as multiprocessing's internals have changed. More 5 | information will come shortly; a link to this page will then be added 6 | back to the Cookbook. 7 | 8 | -------------- 9 | 10 | CategoryCookbook 11 | 12 | -------------------------------------------------------------------------------- /converted/xplt.Pnw: -------------------------------------------------------------------------------- 1 | This shows a simple example of how to create a quick 3-d surface 2 | visualization using xplt. 3 | 4 | 5 | <>= 6 | 7 | from scipy.sandbox import xplt 8 | from numpy import * 9 | from scipy import special 10 | 11 | x,y = ogrid[-12:12:50j,-12:12:50j] 12 | r = sqrt(x**2+y**2) 13 | z = special.j0(r) 14 | xplt.surf(z,x,y,shade=1,palette='heat') 15 | @ 16 | 17 | inline:surface.png 18 | 19 | -------------------------------------------------------------------------------- /ipython/ASTER.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Describe Cookbook/ASTER here. ... 4 | # -------------------------------------------------------------------------------- /ipython/A_Pyrex_Agnostic_Class.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # 1. redirect Cookbook/A\_Numerical\_Agnostic\_Pyrex\_Class 4 | # 5 | # -------------------------------------------------------------------------------- /ipython/FortranIO(2f)FortranFile(2e).py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # This page should be removed. It's content is now available at 4 | # Cookbook/FortranIO/FortranFile 5 | # -------------------------------------------------------------------------------- /ipython/GMailPM.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Note to the administrators of scipy/cookbook 4 | # ============================================ 5 | # 6 | # I'm planning to describe a method that could help other people to keep 7 | # track of their simulations and provide simple framework. It is available 8 | # as [pypi](http://pypi.python.org) package. A tutorial can be found 9 | # [here](http://homepage.univie.ac.at/wolfgang.lechner/gmailpm.html). In 10 | # the recipe I would just describe what I did in the python code. 11 | # 12 | # Do you think this is appropriate here? The script does not make use of 13 | # scipy or numpy but I think the audience of scipy.org might like the 14 | # idea! Please let me know if this is an inappropriate recipe, otherwise I 15 | # will just start writing next week. 16 | # 17 | # Basics 18 | # ====== 19 | # 20 | # The idea is to use python in combination with gmail as a powerful but 21 | # yet simple tool to document runs of computer simulations, their 22 | # parameters, starting times, progress and results. 23 | # 24 | # 25 | 26 | 27 | #!python numbers=disable 28 | import numpy as np 29 | #test 30 | 31 | # 32 | 33 | # 34 | # -------------------------------------------------------------------------------- /ipython/Intersection.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Find the points at which two given functions intersect 4 | # ------------------------------------------------------ 5 | # 6 | # Consider the example of finding the intersection of a polynomial and a 7 | # line: 8 | # 9 | # 10 | 11 | 12 | y1=x1^2 13 | y2=x2+1 14 | 15 | # 16 | 17 | # 18 | # 19 | # 20 | 21 | 22 | from scipy.optimize import fsolve 23 | 24 | import numpy as np 25 | 26 | def f(xy): 27 | x, y = xy 28 | z = np.array([y - x**2, y - x - 1.0]) 29 | return z 30 | 31 | fsolve(f, [1.0, 2.0]) 32 | 33 | # 34 | 35 | # The result of this should be: 36 | # 37 | # 38 | 39 | 40 | array([ 1.61803399, 2.61803399]) 41 | 42 | # 43 | 44 | # See also: 45 | # 46 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)Arrows.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Some example code for how to plot an arrow using the Arrow function. 4 | # 5 | # 6 | 7 | 8 | from pylab import * 9 | from numarray import * 10 | 11 | x = arange(10) 12 | y = x 13 | 14 | # Plot junk and then a filled region 15 | plot(x, y) 16 | 17 | # Now lets make an arrow object 18 | arr = Arrow(2, 2, 1, 1, edgecolor='white') 19 | 20 | # Get the subplot that we are currently working on 21 | ax = gca() 22 | 23 | # Now add the arrow 24 | ax.add_patch(arr) 25 | 26 | # We should be able to make modifications to the arrow. 27 | # Lets make it green. 28 | arr.set_facecolor('g') 29 | 30 | # 31 | 32 | # ![](files/Matplotlib(2f)Arrows_attachments/plot_arrow.png 33 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)BarCharts.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Use the bar function to make bar charts: 4 | # \#-bar 5 | # 6 | # Here's an example script that makes a bar char with error bars and 7 | # labels centered under the bars. 8 | # 9 | # 10 | 11 | 12 | #!/usr/bin/env python 13 | import numpy.numarray as na 14 | 15 | from pylab import * 16 | 17 | labels = ["Baseline", "System"] 18 | data = [3.75 , 4.75] 19 | error = [0.3497 , 0.3108] 20 | 21 | xlocations = na.array(range(len(data)))+0.5 22 | width = 0.5 23 | bar(xlocations, data, yerr=error, width=width) 24 | yticks(range(0, 8)) 25 | xticks(xlocations+ width/2, labels) 26 | xlim(0, xlocations[-1]+width*2) 27 | title("Average Ratings on the Training Set") 28 | gca().get_xaxis().tick_bottom() 29 | gca().get_yaxis().tick_left() 30 | 31 | show() 32 | 33 | # 34 | 35 | # ` ![](files/Matplotlib(2f)BarCharts_attachments/barchart.png` 36 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)Common_Errors.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # `* imshow - You can get seemingly quirky behavior if you do not set vmin and vmax manually. If they are left unset, then !AxisImage will attempt to automatically scale the values of the elements in order to keep the luminance constant. However, if you are doing something like an animation, or want to compare two images against each other, this can cause problems. For example, if you know your values will range between 0 and 1, you can do: imshow(img, vmin=0, vmax=1, cmap=cm.gray, interpolation=``). This also sets the color map to grays, and to use square blocks for the elements.` 4 | # 5 | # * * * * * 6 | # 7 | # CategoryCookbookMatplotlib 8 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)DeletingAnExistingDataSeries.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Each axes instance contains a lines attribute, which is a list of the 4 | # data series in the plot, added in chronological order. To delete a 5 | # particular data series, one must simply delete the appropriate element 6 | # of the lines list and redraw if necessary. 7 | # 8 | # The is illustrated in the following example from an interactive session: 9 | # 10 | # 11 | 12 | 13 | >>> x = N.arange(10) 14 | 15 | >>> fig = P.figure() 16 | >>> ax = fig.add_subplot(111) 17 | >>> ax.plot(x) 18 | [] 19 | 20 | >>> ax.plot(x+10) 21 | [] 22 | 23 | >>> ax.plot(x+20) 24 | [] 25 | 26 | >>> P.show() 27 | >>> ax.lines 28 | [, 29 | , 30 | ] 31 | 32 | >>> del ax.lines[1] 33 | >>> P.show() 34 | 35 | # 36 | 37 | # which will plot three lines, and then delete the second. 38 | # 39 | # * * * * * 40 | # 41 | # CategoryCookbookMatplotlib 42 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)LoadImage.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Image processing often works on gray scale images that were stored as 4 | # PNG files. How do we import / export that file into ? 5 | # 6 | # `* Here is a recipy to do this with Matplotlib using the `` function (your image is called ``). ` 7 | # 8 | # This permits to do some processing for further exporting such as for 9 | # [:Cookbook/Matplotlib/converting\_a\_matrix\_to\_a\_raster\_image:converting 10 | # a matrix to a raster image]. In the newest version of pylab (check that 11 | # your is superior to ) you get directly a 2D numpy array if the image is 12 | # grayscale. 13 | # 14 | # `* to write an image, do ` 15 | # 16 | # `* this kind of functions live also under ``, see for instance `` to create a color image:` 17 | # 18 | # `* to define the range, use:`` (adapted from `[`http://telin.ugent.be/~slippens/drupal/scipy_unscaledimsave`](http://telin.ugent.be/~slippens/drupal/scipy_unscaledimsave)` )` 19 | # 20 | # `* there was another (more direct) method suggested by `[`http://jehiah.cz/archive/creating-images-with-numpy`](http://jehiah.cz/archive/creating-images-with-numpy) 21 | # 22 | # * * * * * 23 | # 24 | # CategoryCookbookMatplotlib 25 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)PySide.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # This is a very basic example showing how to display a matplotlib plot 4 | # within a Qt application using PySide. In case of problems try to change 5 | # the rcParam entry “backend.qt4” to "PySide" (e.g. by in the matplotlibrc 6 | # file). 7 | # 8 | # 9 | 10 | 11 | #!/usr/bin/env python 12 | import sys 13 | import matplotlib 14 | matplotlib.use('Qt4Agg') 15 | import pylab 16 | 17 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 18 | from matplotlib.figure import Figure 19 | 20 | from PySide import QtCore, QtGui 21 | 22 | if __name__ == '__main__': 23 | app = QtGui.QApplication(sys.argv) 24 | 25 | # generate the plot 26 | fig = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0)) 27 | ax = fig.add_subplot(111) 28 | ax.plot([0,1]) 29 | # generate the canvas to display the plot 30 | canvas = FigureCanvas(fig) 31 | 32 | win = QtGui.QMainWindow() 33 | # add the plot canvas to a window 34 | win.setCentralWidget(canvas) 35 | 36 | win.show() 37 | 38 | sys.exit(app.exec_()) 39 | 40 | # 41 | 42 | # 43 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)ShadedRegions.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Use the fill function to make shaded regions of any color tint. Here is 4 | # an example. 5 | # 6 | # 7 | 8 | 9 | 10 | from pylab import * 11 | 12 | x = arange(10) 13 | y = x 14 | 15 | # Plot junk and then a filled region 16 | plot(x, y) 17 | 18 | # Make a blue box that is somewhat see-through 19 | # and has a red border. 20 | # WARNING: alpha doesn't work in postscript output.... 21 | fill([3,4,4,3], [2,2,4,4], 'b', alpha=0.2, edgecolor='r') 22 | 23 | # 24 | 25 | # ![](files/Matplotlib(2f)ShadedRegions_attachments/shaded.png 26 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)ThickAxes.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Example of how to thicken the lines around your plot (axes lines) and to 4 | # get big bold fonts on the tick and axis labels. 5 | # 6 | # 7 | 8 | 9 | from pylab import * 10 | 11 | # Thicken the axes lines and labels 12 | # 13 | # Comment by J. R. Lu: 14 | # I couldn't figure out a way to do this on the 15 | # individual plot and have it work with all backends 16 | # and in interactive mode. So, used rc instead. 17 | # 18 | rc('axes', linewidth=2) 19 | 20 | # Make a dummy plot 21 | plot([0, 1], [0, 1]) 22 | 23 | # Change size and font of tick labels 24 | # Again, this doesn't work in interactive mode. 25 | fontsize = 14 26 | ax = gca() 27 | 28 | for tick in ax.xaxis.get_major_ticks(): 29 | tick.label1.set_fontsize(fontsize) 30 | tick.label1.set_fontweight('bold') 31 | for tick in ax.yaxis.get_major_ticks(): 32 | tick.label1.set_fontsize(fontsize) 33 | tick.label1.set_fontweight('bold') 34 | 35 | xlabel('X Axis', fontsize=16, fontweight='bold') 36 | ylabel('Y Axis', fontsize=16, fontweight='bold') 37 | 38 | # Save figure 39 | savefig('thick_axes.png') 40 | 41 | # 42 | 43 | # ![](files/Matplotlib(2f)ThickAxes_attachments/thick_axes.png 44 | # -------------------------------------------------------------------------------- /ipython/Matplotlib(2f)converting_a_matrix_to_a_raster_image.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Scipy provides a command (imsave) to make a raster (png, jpg...) image 4 | # from a 2D array, each pixel corresponding to one value of the array. Yet 5 | # the image is black and white. 6 | # 7 | # Here is a recipy to do this with Matplotlib, and use a colormap to give 8 | # color to the image. 9 | # 10 | # 11 | 12 | 13 | from pylab import * 14 | from scipy import mgrid 15 | 16 | def imsave(filename, X, **kwargs): 17 | """ Homebrewed imsave to have nice colors... """ 18 | figsize=(array(X.shape)/100.0)[::-1] 19 | rcParams.update({'figure.figsize':figsize}) 20 | fig = figure(figsize=figsize) 21 | axes([0,0,1,1]) # Make the plot occupy the whole canvas 22 | axis('off') 23 | fig.set_size_inches(figsize) 24 | imshow(X,origin='lower', **kwargs) 25 | savefig(filename, facecolor='black', edgecolor='black', dpi=100) 26 | close(fig) 27 | 28 | 29 | X,Y=mgrid[-5:5:0.1,-5:5:0.1] 30 | Z=sin(X**2+Y**2+1e-4)/(X**2+Y**2+1e-4) # Create the data to be plotted 31 | imsave('imsave.png', Z, cmap=cm.hot ) 32 | 33 | # 34 | 35 | # ![](files/Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.png 36 | # -------------------------------------------------------------------------------- /ipython/MayaVi(2f)Installation.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # 4 | # 5 | # !MayaVi2 and TVTK are part of the [enthought tool 6 | # suite](http://code.enthought.com). 7 | # 8 | # **These instructions are out of date**, see the [Mayavi2 9 | # homepage](http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/) 10 | # 11 | # * * * * * 12 | # 13 | # CategoryInstallation 14 | # -------------------------------------------------------------------------------- /ipython/Obarray.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Object arrays using record arrays 4 | # ================================= 5 | # 6 | # numpy supports working with arrays of python objects, but these arrays 7 | # lack the type-uniformity of normal numpy arrays, so they can be quite 8 | # inefficient in terms of space and time, and they can be quite cumbersome 9 | # to work with. However, it would often be useful to be able to store a 10 | # user-defined class in an array. 11 | # 12 | # One approach is to take advantage of numpy's record arrays. These are 13 | # arrays in which each element can be large, as it has named and typed 14 | # fields; essentially they are numpy's equivalent to arrays of C 15 | # structures. Thus if one had a class consisting of some data - named 16 | # fields, each of a numpy type - and some methods, one could represent the 17 | # data for an array of these objects as a record array. Getting the 18 | # methods is more tricky. 19 | # 20 | # One approach is to create a custom subclass of the numpy array which 21 | # handles conversion to and from your object type. The idea is to store 22 | # the data for each instance internally in a record array, but when 23 | # indexing returns a scalar, construct a new instance from the data in the 24 | # records. Similarly, when assigning to a particular element, the array 25 | # subclass would convert an instance to its representation as a record. 26 | # 27 | # Attached is an implementation of the above scheme. 28 | # -------------------------------------------------------------------------------- /ipython/OldMatplotlib.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # Recipes listed here still exist on the Wiki, but are being contributed 4 | # to Matplotlib and will eventually be deleted. 5 | # 6 | # `* ["Plotting Tutorial"].` 7 | # 8 | # 1. 1. THIS IS A BROKEN LINK! Anyone have the page? 9 | # 2. See also the [old 10 | # version](http://www.scipy.org/documentation/plottutorial.html). 11 | # 12 | # `* [:Cookbook/Matplotlib/mplot3D:3D Plotting with Matplotlib]. Simple 3D plots using matplotlib and its now-included 3D capabilities.` 13 | # -------------------------------------------------------------------------------- /ipython/RANSAC.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # The attached file ( ) implements the [RANSAC 4 | )# algorithm](http://en.wikipedia.org/wiki/RANSAC). An example image: 5 | # 6 | # 7 | )# 8 | # To run the file, save it to your computer, start IPython 9 | # 10 | # 11 | 12 | 13 | ipython -wthread 14 | 15 | # 16 | 17 | # Import the module and run the test program 18 | # 19 | # 20 | 21 | 22 | import ransac 23 | ransac.test() 24 | 25 | # 26 | 27 | # To use the module you need to create a model class with two methods 28 | # 29 | # 30 | 31 | 32 | def fit(self, data): 33 | """Given the data fit the data with your model and return the model (a vector)""" 34 | def get_error(self, data, model): 35 | """Given a set of data and a model, what is the error of using this model to estimate the data """ 36 | 37 | # 38 | 39 | # An example of such model is the class LinearLeastSquaresModel as seen 40 | # the file source (below) 41 | # 42 | # ![](files/RANSAC_attachments/ransac.py 43 | # 44 | # * * * * * 45 | # 46 | # `CategoryCookbook` 47 | # -------------------------------------------------------------------------------- /ipython/Theoretical_Ecology.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # - [:Cookbook/Theoretical Ecology/Hastings and Powell: Chaos in a 4 | # 3-Species Food-Chain] 5 | # -------------------------------------------------------------------------------- /ipython/TimeSeries.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # For the offical documentation created by the developers of the 4 | # timeseries scikit [click here](http://pytseries.sourceforge.net). 5 | # 6 | # Here on the [:Cookbook] you may find some useful and complementary 7 | # information: 8 | # 9 | # `* [:Cookbook/TimeSeries/FAQ:FAQ]`\ 10 | # `*Recipies` 11 | # -------------------------------------------------------------------------------- /ipython/mplot3D.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # 1. redirect Cookbook/Matplotlib/mplot3D 4 | # 5 | # -------------------------------------------------------------------------------- /ipython/multiprocessing.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # ### The multiprocessing standard module 4 | # 5 | # This page was obsolete as multiprocessing's internals have changed. More 6 | # information will come shortly; a link to this page will then be added 7 | # back to the Cookbook. 8 | # 9 | # * * * * * 10 | # 11 | # CategoryCookbook 12 | # -------------------------------------------------------------------------------- /ipython/xplt.py: -------------------------------------------------------------------------------- 1 | # 2 | 3 | # This shows a simple example of how to create a quick 3-d surface 4 | # visualization using xplt. 5 | # 6 | # 7 | 8 | 9 | 10 | from scipy.sandbox import xplt 11 | from numpy import * 12 | from scipy import special 13 | 14 | x,y = ogrid[-12:12:50j,-12:12:50j] 15 | r = sqrt(x**2+y**2) 16 | z = special.j0(r) 17 | xplt.surf(z,x,y,shade=1,palette='heat') 18 | 19 | # 20 | 21 | # ![](files/xplt_attachments/surface.png 22 | # -------------------------------------------------------------------------------- /originals/ASTER.txt: -------------------------------------------------------------------------------- 1 | Describe Cookbook/ASTER here. 2 | ... 3 | -------------------------------------------------------------------------------- /originals/A_Numerical_Agnostic_Pyrex_Class_attachments/test_output.txt: -------------------------------------------------------------------------------- 1 | original object type--> 2 | typestr --> (4, 3) 4 | strides --> (12, 4) 5 | object after a numpy re-wrapping --> [[ 0 1 2] 6 | [ 3 4 5] 7 | [ 6 7 8] 8 | [ 9 10 11]] 9 | object after modification in C space --> [[ 1 2 3] 10 | [ 3 4 5] 11 | [ 6 7 8] 12 | [ 9 10 11]] 13 | original object type--> 14 | typestr --> (4, 3) 16 | strides --> (12, 4) 17 | object after a numpy re-wrapping --> [[ 0 1 2] 18 | [ 3 4 5] 19 | [ 6 7 8] 20 | [ 9 10 11]] 21 | object after modification in C space --> [[ 1 2 3] 22 | [ 3 4 5] 23 | [ 6 7 8] 24 | [ 9 10 11]] 25 | original object type--> 26 | typestr --> (4, 3) 28 | strides --> (12, 4) 29 | object after a numpy re-wrapping --> [[ 0 1 2] 30 | [ 3 4 5] 31 | [ 6 7 8] 32 | [ 9 10 11]] 33 | object after modification in C space --> [[ 1 2 3] 34 | [ 3 4 5] 35 | [ 6 7 8] 36 | [ 9 10 11]] 37 | -------------------------------------------------------------------------------- /originals/A_Pyrex_Agnostic_Class.txt: -------------------------------------------------------------------------------- 1 | #redirect Cookbook/A_Numerical_Agnostic_Pyrex_Class 2 | -------------------------------------------------------------------------------- /originals/A_Pyrex_Agnostic_Class_attachments/test_output.txt: -------------------------------------------------------------------------------- 1 | original object type--> 2 | typestr --> (4, 3) 4 | strides --> (12, 4) 5 | object after a numpy re-wrapping --> [[ 0 1 2] 6 | [ 3 4 5] 7 | [ 6 7 8] 8 | [ 9 10 11]] 9 | object after modification in C space --> [[ 1 2 3] 10 | [ 3 4 5] 11 | [ 6 7 8] 12 | [ 9 10 11]] 13 | original object type--> 14 | typestr --> (4, 3) 16 | strides --> (12, 4) 17 | object after a numpy re-wrapping --> [[ 0 1 2] 18 | [ 3 4 5] 19 | [ 6 7 8] 20 | [ 9 10 11]] 21 | object after modification in C space --> [[ 1 2 3] 22 | [ 3 4 5] 23 | [ 6 7 8] 24 | [ 9 10 11]] 25 | original object type--> 26 | typestr --> (4, 3) 28 | strides --> (12, 4) 29 | object after a numpy re-wrapping --> [[ 0 1 2] 30 | [ 3 4 5] 31 | [ 6 7 8] 32 | [ 9 10 11]] 33 | object after modification in C space --> [[ 1 2 3] 34 | [ 3 4 5] 35 | [ 6 7 8] 36 | [ 9 10 11]] 37 | -------------------------------------------------------------------------------- /originals/ApplyFIRFilter_attachments/fir_time_comparison.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ApplyFIRFilter_attachments/fir_time_comparison.png -------------------------------------------------------------------------------- /originals/ApplyFIRFilter_attachments/fir_time_comparison2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ApplyFIRFilter_attachments/fir_time_comparison2.png -------------------------------------------------------------------------------- /originals/ApplyFIRFilter_attachments/fir_time_comparison3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ApplyFIRFilter_attachments/fir_time_comparison3.png -------------------------------------------------------------------------------- /originals/Autovectorize.txt: -------------------------------------------------------------------------------- 1 | = Autovectorization = 2 | There are instances where it is very convenient to have a function defined in the language of scalars that can operate on arrays. [http://docs.scipy.org/doc/numpy/reference/generated/numpy.vectorize.html numpy.vectorize] provides such a conversion. 3 | 4 | In simplier language: This function basically makes a functions which calculate single values (e. g. math.sin) operate on array. 5 | 6 | Some links and threads on this: 7 | 8 | * optimising single value functions for array calculations - http://article.gmane.org/gmane.comp.python.numeric.general/26543 9 | * vectorized function inside a class - http://article.gmane.org/gmane.comp.python.numeric.general/16438 10 | * numpy.vectorize performance - http://article.gmane.org/gmane.comp.python.numeric.general/6867 11 | * vectorize() - http://www.scipy.org/Numpy_Example_List_With_Doc#head-fbff061fdb843209707a8fa537d9b24b6a91245e 12 | * NumPy: vectorization - http://folk.uio.no/hpl/PyUiT/PyUiT-split/slide218.html 13 | * vectorizing loops - http://article.gmane.org/gmane.comp.python.numeric.general/17266 14 | 15 | 16 | == See also == 17 | 18 | * ["SciPyPackages/NumExpr"] 19 | -------------------------------------------------------------------------------- /originals/BrownianMotion_attachments/brownian_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/BrownianMotion_attachments/brownian_demo.png -------------------------------------------------------------------------------- /originals/BrownianMotion_attachments/brownian_demo_2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/BrownianMotion_attachments/brownian_demo_2d.png -------------------------------------------------------------------------------- /originals/ButterworthBandpass_attachments/butterworth_bandpass_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ButterworthBandpass_attachments/butterworth_bandpass_example.png -------------------------------------------------------------------------------- /originals/ButterworthBandpass_attachments/butterworth_bandpass_frequency_response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ButterworthBandpass_attachments/butterworth_bandpass_frequency_response.png -------------------------------------------------------------------------------- /originals/C_Extensions(2f)NumPy_arrays_attachments/Cext_v2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/C_Extensions(2f)NumPy_arrays_attachments/Cext_v2.tar.gz -------------------------------------------------------------------------------- /originals/CommTheory_attachments/BPSK_BER.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/CommTheory_attachments/BPSK_BER.PNG -------------------------------------------------------------------------------- /originals/CorrelatedRandomSamples_attachments/correlated_random_vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/CorrelatedRandomSamples_attachments/correlated_random_vars.png -------------------------------------------------------------------------------- /originals/CoupledSpringMassSystem_attachments/two_springs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/CoupledSpringMassSystem_attachments/two_springs.png -------------------------------------------------------------------------------- /originals/CoupledSpringMassSystem_attachments/two_springs2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/CoupledSpringMassSystem_attachments/two_springs2.png -------------------------------------------------------------------------------- /originals/CoupledSpringMassSystem_attachments/two_springs_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/CoupledSpringMassSystem_attachments/two_springs_diagram.png -------------------------------------------------------------------------------- /originals/Data_Acquisition_with_PyUL_attachments/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Data_Acquisition_with_PyUL_attachments/example1.png -------------------------------------------------------------------------------- /originals/Data_Acquisition_with_PyUL_attachments/example2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Data_Acquisition_with_PyUL_attachments/example2.png -------------------------------------------------------------------------------- /originals/Data_Acquisition_with_PyUL_attachments/example3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Data_Acquisition_with_PyUL_attachments/example3.png -------------------------------------------------------------------------------- /originals/Data_Acquisition_with_PyUL_attachments/example4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Data_Acquisition_with_PyUL_attachments/example4.png -------------------------------------------------------------------------------- /originals/EmbeddingInTraitsGUI_attachments/mpl_in_traits_view.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/EmbeddingInTraitsGUI_attachments/mpl_in_traits_view.png -------------------------------------------------------------------------------- /originals/EyeDiagram_attachments/eye-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/EyeDiagram_attachments/eye-diagram.png -------------------------------------------------------------------------------- /originals/EyeDiagram_attachments/eye-diagram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/EyeDiagram_attachments/eye-diagram2.png -------------------------------------------------------------------------------- /originals/EyeDiagram_attachments/eye-diagram3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/EyeDiagram_attachments/eye-diagram3.png -------------------------------------------------------------------------------- /originals/FIRFilter_attachments/fir_demo_freq_resp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FIRFilter_attachments/fir_demo_freq_resp.png -------------------------------------------------------------------------------- /originals/FIRFilter_attachments/fir_demo_signals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FIRFilter_attachments/fir_demo_signals.png -------------------------------------------------------------------------------- /originals/FIRFilter_attachments/fir_demo_taps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FIRFilter_attachments/fir_demo_taps.png -------------------------------------------------------------------------------- /originals/FiltFilt_attachments/filfilt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FiltFilt_attachments/filfilt.jpg -------------------------------------------------------------------------------- /originals/FiltFilt_attachments/filfilt2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FiltFilt_attachments/filfilt2.jpg -------------------------------------------------------------------------------- /originals/Finding_Convex_Hull_attachments/convex_hull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Finding_Convex_Hull_attachments/convex_hull.png -------------------------------------------------------------------------------- /originals/FittingData_attachments/datafit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FittingData_attachments/datafit.png -------------------------------------------------------------------------------- /originals/FittingData_attachments/fitgaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FittingData_attachments/fitgaussian.png -------------------------------------------------------------------------------- /originals/FittingData_attachments/gaussianfit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FittingData_attachments/gaussianfit.png -------------------------------------------------------------------------------- /originals/FittingData_attachments/power_law_fit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FittingData_attachments/power_law_fit.png -------------------------------------------------------------------------------- /originals/FortranIO(2f)FortranFile(2e).txt: -------------------------------------------------------------------------------- 1 | This page should be removed. It's content is now available at Cookbook/FortranIO/FortranFile 2 | -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/chirp_hyperbolic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/chirp_hyperbolic.png -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/chirp_linear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/chirp_linear.png -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/chirp_logarithmic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/chirp_logarithmic.png -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/chirp_quadratic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/chirp_quadratic.png -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/chirp_quadratic_v0false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/chirp_quadratic_v0false.png -------------------------------------------------------------------------------- /originals/FrequencySweptDemo_attachments/sweep_poly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/FrequencySweptDemo_attachments/sweep_poly.png -------------------------------------------------------------------------------- /originals/GMailPM.txt: -------------------------------------------------------------------------------- 1 | = Note to the administrators of scipy/cookbook = 2 | 3 | I'm planning to describe a method that could help other people to keep track of their simulations and provide simple framework. It is available as [http://pypi.python.org pypi] package. A tutorial can be found [http://homepage.univie.ac.at/wolfgang.lechner/gmailpm.html here]. In the recipe I would just describe what I did in the python code. 4 | 5 | Do you think this is appropriate here? The script does not make use of scipy or numpy but I think the audience of scipy.org might like the idea! Please let me know if this is an inappropriate recipe, otherwise I will just start writing next week. 6 | 7 | = Basics = 8 | 9 | The idea is to use python in combination with gmail as a powerful but yet simple tool to document runs of computer simulations, their parameters, starting times, progress and results. 10 | 11 | {{{ 12 | #!python numbers=disable 13 | import numpy as np 14 | #test 15 | }}} 16 | -------------------------------------------------------------------------------- /originals/Histograms_attachments/histogram2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Histograms_attachments/histogram2d.png -------------------------------------------------------------------------------- /originals/Interpolation_attachments/interpolate_figure1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Interpolation_attachments/interpolate_figure1.png -------------------------------------------------------------------------------- /originals/Interpolation_attachments/interpolate_figure2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Interpolation_attachments/interpolate_figure2.png -------------------------------------------------------------------------------- /originals/Interpolation_attachments/splprep_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Interpolation_attachments/splprep_demo.png -------------------------------------------------------------------------------- /originals/Intersection.txt: -------------------------------------------------------------------------------- 1 | == Find the points at which two given functions intersect == 2 | 3 | Consider the example of finding the intersection of a polynomial and a line: 4 | 5 | {{{ 6 | y1=x1^2 7 | y2=x2+1 8 | }}} 9 | 10 | {{{#!python 11 | from scipy.optimize import fsolve 12 | 13 | import numpy as np 14 | 15 | def f(xy): 16 | x, y = xy 17 | z = np.array([y - x**2, y - x - 1.0]) 18 | return z 19 | 20 | fsolve(f, [1.0, 2.0]) 21 | }}} 22 | 23 | The result of this should be: 24 | 25 | {{{#!python 26 | array([ 1.61803399, 2.61803399]) 27 | }}} 28 | See also: http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fsolve.html#scipy.optimize.fsolve 29 | -------------------------------------------------------------------------------- /originals/KalmanFiltering_attachments/error_vs_iteration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/KalmanFiltering_attachments/error_vs_iteration.png -------------------------------------------------------------------------------- /originals/KalmanFiltering_attachments/estimate_vs_iteration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/KalmanFiltering_attachments/estimate_vs_iteration.png -------------------------------------------------------------------------------- /originals/KdV_attachments/kdv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/KdV_attachments/kdv.png -------------------------------------------------------------------------------- /originals/KdV_attachments/kdv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/KdV_attachments/kdv2.png -------------------------------------------------------------------------------- /originals/LASReader_attachments/sample3plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LASReader_attachments/sample3plot.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v1.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v2.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v3.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v4.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v5.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_residu2_v6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_residu2_v6.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_v1.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_v2.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_v3.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_v4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_v4.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/arc_v5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/arc_v5.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_residu2_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_residu2_v1.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_residu2_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_residu2_v2.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_residu2_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_residu2_v3.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_residu2_v4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_residu2_v4.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_residu2_v5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_residu2_v5.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_v1.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_v2.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_v3.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_v4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_v4.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/full_cercle_v5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/full_cercle_v5.png -------------------------------------------------------------------------------- /originals/Least_Squares_Circle_attachments/least_squares_circle_v1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Least_Squares_Circle_attachments/least_squares_circle_v1.py -------------------------------------------------------------------------------- /originals/LineIntegralConvolution.txt: -------------------------------------------------------------------------------- 1 | = Line Integral Convolution = 2 | Line integral convolution is a technique, or family of techniques, for representing two-dimensional vector fields. The idea is to produce a texture which is highly correlated in the direction of the vector field but not correlated across the vector field. This is done by generating a noise texture then, for each pixel of the image, "flowing" forward and back along the vector field. The points along this path are looked up in the noise texture and averaged to give the LIC texture at the starting point. The basic technique ignores both the magnitude of the vector field and its sign. With a minor modification the same technique can be used to produce an animation of "flow" along the vector field. 3 | 4 | attachment:flow-image.png 5 | 6 | Attached to this page is cython code to implement a simple line integral convolution operator, plus some demonstration python code. The demo code can either make more or less the image above - a simple array of vortices; note how an overall rotation appears in the sum of individual vortex vector fields, just as a superfluid's "bulk rotation" is actually a vortex array - or it can make a video of the same vector field. The video is a little awkward to work with, since all the standard video compression techniques butcher it horribly, but it does work well. 7 | 8 | attachment:lic_internal.pyx 9 | 10 | attachment:lic.py 11 | 12 | attachment:lic_demo.py 13 | 14 | attachment:setup.py 15 | -------------------------------------------------------------------------------- /originals/LineIntegralConvolution_attachments/flow-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LineIntegralConvolution_attachments/flow-image.png -------------------------------------------------------------------------------- /originals/LineIntegralConvolution_attachments/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | from distutils.extension import Extension 3 | from Cython.Distutils import build_ext 4 | 5 | setup( 6 | cmdclass = {'build_ext': build_ext}, 7 | ext_modules = [Extension("lic_internal", ["lic_internal.pyx"])] 8 | ) 9 | 10 | -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/Fisher_discriminant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/Fisher_discriminant.png -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/Fisher_disrciminant.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/Fisher_disrciminant.JPG -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/Fisher_disrciminant.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/Fisher_disrciminant.PNG -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/Probabilistic_model.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/Probabilistic_model.PNG -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/fisher: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/fisher -------------------------------------------------------------------------------- /originals/LinearClassification_attachments/prob_gen_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearClassification_attachments/prob_gen_model.png -------------------------------------------------------------------------------- /originals/LinearRegression_attachments/linregress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LinearRegression_attachments/linregress.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_1.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_1v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_1v2.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2v2.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2v3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_2v3.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_3.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_3v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/rabbits_and_foxes_3v2.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/zombie_nodead_nobirths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/zombie_nodead_nobirths.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/zombie_somedead_10births.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/zombie_somedead_10births.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/zombie_somedead_nobirths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/zombie_somedead_nobirths.png -------------------------------------------------------------------------------- /originals/LoktaVolterraTutorial_attachments/zombie_somedeaddead_nobirths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/LoktaVolterraTutorial_attachments/zombie_somedeaddead_nobirths.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Arrows.txt: -------------------------------------------------------------------------------- 1 | Some example code for how to plot an arrow using the Arrow function. 2 | 3 | {{{#!python 4 | from pylab import * 5 | from numarray import * 6 | 7 | x = arange(10) 8 | y = x 9 | 10 | # Plot junk and then a filled region 11 | plot(x, y) 12 | 13 | # Now lets make an arrow object 14 | arr = Arrow(2, 2, 1, 1, edgecolor='white') 15 | 16 | # Get the subplot that we are currently working on 17 | ax = gca() 18 | 19 | # Now add the arrow 20 | ax.add_patch(arr) 21 | 22 | # We should be able to make modifications to the arrow. 23 | # Lets make it green. 24 | arr.set_facecolor('g') 25 | }}} 26 | 27 | inline:plot_arrow.png 28 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Arrows_attachments/plot_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Arrows_attachments/plot_arrow.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)BarCharts.txt: -------------------------------------------------------------------------------- 1 | Use the bar function to make bar charts: http://matplotlib.sourceforge.net/matplotlib.pylab.html#-bar 2 | 3 | Here's an example script that makes a bar char with error bars and labels centered under the bars. 4 | 5 | {{{#!python numbers=disable 6 | #!/usr/bin/env python 7 | import numpy.numarray as na 8 | 9 | from pylab import * 10 | 11 | labels = ["Baseline", "System"] 12 | data = [3.75 , 4.75] 13 | error = [0.3497 , 0.3108] 14 | 15 | xlocations = na.array(range(len(data)))+0.5 16 | width = 0.5 17 | bar(xlocations, data, yerr=error, width=width) 18 | yticks(range(0, 8)) 19 | xticks(xlocations+ width/2, labels) 20 | xlim(0, xlocations[-1]+width*2) 21 | title("Average Ratings on the Training Set") 22 | gca().get_xaxis().tick_bottom() 23 | gca().get_yaxis().tick_left() 24 | 25 | show() 26 | }}} 27 | inline:barchart.png 28 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)BarCharts_attachments/barchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)BarCharts_attachments/barchart.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/dicrete_jet1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/dicrete_jet1.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/discrete_jet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/discrete_jet.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/jet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/jet.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet2.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet3.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ColormapTransformations_attachments/light_jet4.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Common_Errors.txt: -------------------------------------------------------------------------------- 1 | * imshow - You can get seemingly quirky behavior if you do not set vmin and vmax manually. If they are left unset, then !AxisImage will attempt to automatically scale the values of the elements in order to keep the luminance constant. However, if you are doing something like an animation, or want to compare two images against each other, this can cause problems. For example, if you know your values will range between 0 and 1, you can do: imshow(img, vmin=0, vmax=1, cmap=cm.gray, interpolation={{{nearest}}}). This also sets the color map to grays, and to use square blocks for the elements. 2 | ---- 3 | CategoryCookbookMatplotlib 4 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)CustomLogLabels_attachments/log_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)CustomLogLabels_attachments/log_labels.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)DeletingAnExistingDataSeries.txt: -------------------------------------------------------------------------------- 1 | Each axes instance contains a lines attribute, which is a list of the data series in the plot, added in chronological order. To delete a particular data series, one must simply delete the appropriate element of the lines list and redraw if necessary. 2 | 3 | The is illustrated in the following example from an interactive session: 4 | {{{#!python numbers=disable 5 | >>> x = N.arange(10) 6 | 7 | >>> fig = P.figure() 8 | >>> ax = fig.add_subplot(111) 9 | >>> ax.plot(x) 10 | [] 11 | 12 | >>> ax.plot(x+10) 13 | [] 14 | 15 | >>> ax.plot(x+20) 16 | [] 17 | 18 | >>> P.show() 19 | >>> ax.lines 20 | [, 21 | , 22 | ] 23 | 24 | >>> del ax.lines[1] 25 | >>> P.show() 26 | }}} 27 | which will plot three lines, and then delete the second. 28 | ---- 29 | CategoryCookbookMatplotlib 30 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin_small: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin_small -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/bin_small.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/binned_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/binned_data.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/griddataexample1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/griddataexample1.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/ppb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/ppb.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/ppb_raw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/ppb_raw.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw_small: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw_small -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/raw_small.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/unbinned_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Gridding_irregularly_spaced_data_attachments/unbinned_data.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)HintonDiagrams_attachments/hinton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)HintonDiagrams_attachments/hinton.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)LaTeX_Examples_attachments/fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)LaTeX_Examples_attachments/fig.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)LaTeX_Examples_attachments/fig1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)LaTeX_Examples_attachments/fig1.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)LaTeX_Examples_attachments/naka-rushton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)LaTeX_Examples_attachments/naka-rushton.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)LaTeX_Examples_attachments/psfrag_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)LaTeX_Examples_attachments/psfrag_example.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap0.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap1.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap1b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap1b.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap2.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap2b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap2b.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap3.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap3b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap3b.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Maps_attachments/basemap3c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Maps_attachments/basemap3c.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)MulticoloredLine_attachments/colored_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)MulticoloredLine_attachments/colored_line.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)MulticoloredLine_attachments/colored_line.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/env python 2 | ''' Color parts of a line based on its properties, e.g., slope. 3 | 4 | This is a minimal LineCollection demo. 5 | With a bit more work we could use a colormap instead of 6 | the if/elif/else block. It might make sense to simply modify 7 | LineCollection to inherit from ScalarMappable, like the other 8 | collections do. 9 | ''' 10 | 11 | from pylab import * 12 | from matplotlib.collections import LineCollection 13 | from matplotlib.colors import colorConverter 14 | 15 | x = arange(0, 10, 0.1) 16 | y = sin(x) 17 | z = cos(0.5 * (x[:-1] + x[1:])) # first derivative 18 | 19 | rr = colorConverter.to_rgba('r') 20 | gg = colorConverter.to_rgba('g') 21 | bb = colorConverter.to_rgba('b') 22 | colors = list() 23 | for zz in z: 24 | if zz < -.5: 25 | colors.append(rr) 26 | elif zz < .5: 27 | colors.append(gg) 28 | else: 29 | colors.append(bb) 30 | 31 | points = zip(x, y) 32 | segments = zip(points[:-1], points[1:]) 33 | 34 | ax = axes(frameon=True) 35 | 36 | 37 | LC = LineCollection(segments, colors = colors) 38 | LC.set_linewidth(3) 39 | ax.add_collection(LC) 40 | axis([0, 10, -1.1, 1.1]) 41 | savefig('colored_line.png', dpi=70) 42 | show() 43 | 44 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)MulticoloredLine_attachments/colored_line2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)MulticoloredLine_attachments/colored_line2.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)MultilinePlots_attachments/multiline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)MultilinePlots_attachments/multiline.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)MultilinePlots_attachments/multipleaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)MultilinePlots_attachments/multipleaxes.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label_attachments/Same_ylabel_subplots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Multiple_Subplots_with_One_Axis_Label_attachments/Same_ylabel_subplots.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Plotting_Images_with_Special_Values_attachments/sentinel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Plotting_Images_with_Special_Values_attachments/sentinel.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Plotting_Images_with_Special_Values_attachments/sentinel_pristine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Plotting_Images_with_Special_Values_attachments/sentinel_pristine.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Plotting_values_with_masked_arrays_attachments/masked_test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Plotting_values_with_masked_arrays_attachments/masked_test.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)PySide.txt: -------------------------------------------------------------------------------- 1 | This is a very basic example showing how to display a matplotlib plot within a Qt application using PySide. 2 | In case of problems try to change the rcParam entry “backend.qt4” to "PySide" (e.g. by in the matplotlibrc file). 3 | 4 | {{{#!python 5 | #!/usr/bin/env python 6 | import sys 7 | import matplotlib 8 | matplotlib.use('Qt4Agg') 9 | import pylab 10 | 11 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 12 | from matplotlib.figure import Figure 13 | 14 | from PySide import QtCore, QtGui 15 | 16 | if __name__ == '__main__': 17 | app = QtGui.QApplication(sys.argv) 18 | 19 | # generate the plot 20 | fig = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0)) 21 | ax = fig.add_subplot(111) 22 | ax.plot([0,1]) 23 | # generate the canvas to display the plot 24 | canvas = FigureCanvas(fig) 25 | 26 | win = QtGui.QMainWindow() 27 | # add the plot canvas to a window 28 | win.setCentralWidget(canvas) 29 | 30 | win.show() 31 | 32 | sys.exit(app.exec_()) 33 | }}} 34 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_edit_custom_widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_edit_custom_widgets.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_form_settings_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_form_settings_comment.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_full_workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_full_workspace.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_new_widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_new_widget.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_newopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_newopen.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_wizard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/designer_wizard.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/ipython_interacted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/ipython_interacted.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/ipython_invoked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/ipython_invoked.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/main_mpl_tutorial.py: -------------------------------------------------------------------------------- 1 | 2 | from mplwidget_tutorial import * 3 | 4 | f = Form1() 5 | f.show() 6 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Qt_with_IPython_and_Designer_attachments/mplwidget_tutorial.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # Form implementation generated from reading ui file 'mplwidget_tutorial.ui' 4 | # 5 | # Created: Thu Sep 15 15:59:51 2005 6 | # by: The PyQt User Interface Compiler (pyuic) 3.13 7 | # 8 | # WARNING! All changes made in this file will be lost! 9 | 10 | 11 | from qt import * 12 | from mplwidget import * 13 | 14 | 15 | class Form1(QMainWindow): 16 | def __init__(self,parent = None,name = None,fl = 0): 17 | QMainWindow.__init__(self,parent,name,fl) 18 | self.statusBar() 19 | 20 | if not name: 21 | self.setName("Form1") 22 | 23 | 24 | self.setCentralWidget(QWidget(self,"qt_central_widget")) 25 | Form1Layout = QVBoxLayout(self.centralWidget(),11,6,"Form1Layout") 26 | 27 | self.matplotlibWidget1 = MatplotlibWidget(self.centralWidget(),"matplotlibWidget1") 28 | Form1Layout.addWidget(self.matplotlibWidget1) 29 | 30 | 31 | 32 | self.languageChange() 33 | 34 | self.resize(QSize(422,346).expandedTo(self.minimumSizeHint())) 35 | self.clearWState(Qt.WState_Polished) 36 | 37 | 38 | def languageChange(self): 39 | self.setCaption(self.__tr("Form1")) 40 | 41 | 42 | def __tr(self,s,c = None): 43 | return qApp.translate("Form1",s,c) 44 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ShadedRegions.txt: -------------------------------------------------------------------------------- 1 | Use the fill function to make shaded regions of any color tint. Here is an example. 2 | 3 | {{{#!python 4 | 5 | from pylab import * 6 | 7 | x = arange(10) 8 | y = x 9 | 10 | # Plot junk and then a filled region 11 | plot(x, y) 12 | 13 | # Make a blue box that is somewhat see-through 14 | # and has a red border. 15 | # WARNING: alpha doesn't work in postscript output.... 16 | fill([3,4,4,3], [2,2,4,4], 'b', alpha=0.2, edgecolor='r') 17 | }}} 18 | 19 | inline:shaded.png 20 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ShadedRegions_attachments/shaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ShadedRegions_attachments/shaded.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Show_colormaps_attachments/cmap_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Show_colormaps_attachments/cmap_example.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)Show_colormaps_attachments/colormaps3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)Show_colormaps_attachments/colormaps3.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)SigmoidalFunctions_attachments/sigmoids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)SigmoidalFunctions_attachments/sigmoids.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)SigmoidalFunctions_attachments/sigmoids2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)SigmoidalFunctions_attachments/sigmoids2.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ThickAxes.txt: -------------------------------------------------------------------------------- 1 | Example of how to thicken the lines around your plot (axes lines) and to get big bold fonts on the tick and axis labels. 2 | 3 | {{{#!python 4 | from pylab import * 5 | 6 | # Thicken the axes lines and labels 7 | # 8 | # Comment by J. R. Lu: 9 | # I couldn't figure out a way to do this on the 10 | # individual plot and have it work with all backends 11 | # and in interactive mode. So, used rc instead. 12 | # 13 | rc('axes', linewidth=2) 14 | 15 | # Make a dummy plot 16 | plot([0, 1], [0, 1]) 17 | 18 | # Change size and font of tick labels 19 | # Again, this doesn't work in interactive mode. 20 | fontsize = 14 21 | ax = gca() 22 | 23 | for tick in ax.xaxis.get_major_ticks(): 24 | tick.label1.set_fontsize(fontsize) 25 | tick.label1.set_fontweight('bold') 26 | for tick in ax.yaxis.get_major_ticks(): 27 | tick.label1.set_fontsize(fontsize) 28 | tick.label1.set_fontweight('bold') 29 | 30 | xlabel('X Axis', fontsize=16, fontweight='bold') 31 | ylabel('Y Axis', fontsize=16, fontweight='bold') 32 | 33 | # Save figure 34 | savefig('thick_axes.png') 35 | 36 | }}} 37 | 38 | inline:thick_axes.png 39 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)ThickAxes_attachments/thick_axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)ThickAxes_attachments/thick_axes.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)TreeMap_attachments/TreeMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)TreeMap_attachments/TreeMap.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)UnfilledHistograms_attachments/hist_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)UnfilledHistograms_attachments/hist_outline.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)UsingTex_attachments/tex_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)UsingTex_attachments/tex_demo.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)converting_a_matrix_to_a_raster_image.txt: -------------------------------------------------------------------------------- 1 | Scipy provides a command (imsave) to make a raster (png, jpg...) image from a 2D array, each pixel corresponding to one value of the array. Yet the image is black and white. 2 | 3 | Here is a recipy to do this with Matplotlib, and use a colormap to give color to the image. 4 | 5 | {{{#!python 6 | from pylab import * 7 | from scipy import mgrid 8 | 9 | def imsave(filename, X, **kwargs): 10 | """ Homebrewed imsave to have nice colors... """ 11 | figsize=(array(X.shape)/100.0)[::-1] 12 | rcParams.update({'figure.figsize':figsize}) 13 | fig = figure(figsize=figsize) 14 | axes([0,0,1,1]) # Make the plot occupy the whole canvas 15 | axis('off') 16 | fig.set_size_inches(figsize) 17 | imshow(X,origin='lower', **kwargs) 18 | savefig(filename, facecolor='black', edgecolor='black', dpi=100) 19 | close(fig) 20 | 21 | 22 | X,Y=mgrid[-5:5:0.1,-5:5:0.1] 23 | Z=sin(X**2+Y**2+1e-4)/(X**2+Y**2+1e-4) # Create the data to be plotted 24 | imsave('imsave.png', Z, cmap=cm.hot ) 25 | }}} 26 | 27 | inline:imsave.png 28 | -------------------------------------------------------------------------------- /originals/Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contour.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contour.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contour.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contour3D.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contour3D.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contour3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contour3D.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contourf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contourf.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contourf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contourf.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contourf3D.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contourf3D.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/contourf3D.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/contourf3D.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/plot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/plot.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/plot.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/scatter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/scatter.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/scatter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/scatter.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/surface.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/surface.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/surface.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test1.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test1.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test2.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test2.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test3.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/test3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/test3.png -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/wireframe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/wireframe.jpg -------------------------------------------------------------------------------- /originals/Matplotlib(2f)mplot3D_attachments/wireframe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib(2f)mplot3D_attachments/wireframe.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/barchart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/barchart.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/barchartscaled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/barchartscaled.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/basemap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/basemap1.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/chart_scaled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/chart_scaled.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/colored_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/colored_line.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/contourf3D.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/contourf3D.jpg -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/hinton-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/hinton-small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/hist_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/hist_outline.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/hist_outline_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/hist_outline_small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/log_labels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/log_labels.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/log_labels_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/log_labels_small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/mpl_vtk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/mpl_vtk.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/multiline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/multiline.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/plot_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/plot_arrow.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/plot_arrow_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/plot_arrow_small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/sentinel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/sentinel.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/shaded.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/shaded.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/shaded_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/shaded_small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/sigmoids_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/sigmoids_small.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/tex_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/tex_demo.png -------------------------------------------------------------------------------- /originals/Matplotlib_attachments/thick_axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Matplotlib_attachments/thick_axes.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Installation.txt: -------------------------------------------------------------------------------- 1 | [[TableOfContents]] 2 | 3 | !MayaVi2 and TVTK are part of the [http://code.enthought.com enthought tool suite]. 4 | 5 | '''These instructions are out of date''', see the [http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/ Mayavi2 homepage] 6 | 7 | ---- 8 | CategoryInstallation 9 | -------------------------------------------------------------------------------- /originals/MayaVi(2f)RunningMayavi2_attachments/mv2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)RunningMayavi2_attachments/mv2.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)RunningMayavi2_attachments/mv2_cmdline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)RunningMayavi2_attachments/mv2_cmdline.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_axes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_axes.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_colorbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_colorbar.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_orientationaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_orientationaxes.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_outline.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_scene_parall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_scene_parall.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_scene_persp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_scene_persp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)BasicModules_attachments/basic_title.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eg.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eug1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eug1.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eug2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_eug2.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_p2c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_p2c.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_thrld1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_thrld1.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_thrld2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)Filters_attachments/filter_thrld2.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_isosurface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_isosurface.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp2.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp_warp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp_warp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp_widg_en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_scp_widg_en.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_sgo_gp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_sgo_gp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_streamline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_streamline.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_sug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_sug.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_surface.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_vcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_vcp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_vectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_vectors.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_volume.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_warpvcp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)ScriptingMayavi2(2f)MainModules_attachments/module_warpvcp.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Surf.txt: -------------------------------------------------------------------------------- 1 | If you want to plot a surface representing a matrix by elevation and colour of its points you have to transform the matrix data in a 3D data that !MayaVi2 can understand. [:Cookbook/MayaVi/mlab:mlab] knows how to do this, but it does not have the nice user interface of !MayaVi2. Here is a script that create a !SurfRegular object using mlab, and then loads it in !MayaVi2. A more detailed version of this script is given in the examples pages [:Cookbook/MayaVi/Examples]. 2 | 3 | {{{#!python 4 | import numpy 5 | def f(x, y): 6 | return numpy.sin(x*y)/(x*y) 7 | x = numpy.arange(-7., 7.05, 0.1) 8 | y = numpy.arange(-5., 5.05, 0.05) 9 | from enthought.tvtk.tools import mlab 10 | s = mlab.SurfRegular(x, y, f) 11 | from enthought.mayavi.sources.vtk_data_source import VTKDataSource 12 | d = VTKDataSource() 13 | d.data = s.data 14 | mayavi.add_source(d) 15 | from enthought.mayavi.filters.warp_scalar import WarpScalar 16 | w = WarpScalar() 17 | mayavi.add_filter(w) 18 | from enthought.mayavi.modules.outline import Outline 19 | from enthought.mayavi.modules.surface import Surface 20 | o = Outline() 21 | s = Surface() 22 | mayavi.add_module(o) 23 | mayavi.add_module(s) 24 | }}} 25 | You can run this script by running "mayavi2 -n -x script.py", loading it through the menu (File -> Open File), and pressing Ctrl+R, or entering "execfile('script.py') in the python shell. 26 | 27 | inline:surf.png 28 | -------------------------------------------------------------------------------- /originals/MayaVi(2f)Surf_attachments/surf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Surf_attachments/surf.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps1.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps2.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps3.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps4.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps5.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps6.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps7.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/ps8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/ps8.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)Tips_attachments/setcolors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)Tips_attachments/setcolors.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/contour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/contour.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/glyph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/glyph.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/nongui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/nongui.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/numeric_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/numeric_source.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/streamline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/streamline.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/surf_regular_mlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/surf_regular_mlab.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)examples_attachments/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)examples_attachments/test.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)mlab_attachments/simple_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)mlab_attachments/simple_example.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)mlab_attachments/simpleexample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)mlab_attachments/simpleexample.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)mlab_attachments/tvtk.mlab_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)mlab_attachments/tvtk.mlab_example.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)tvtk_attachments/ivtk_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)tvtk_attachments/ivtk_example.png -------------------------------------------------------------------------------- /originals/MayaVi(2f)tvtk_attachments/simple_tvtk_cone.py: -------------------------------------------------------------------------------- 1 | from enthought.tvtk import tvtk 2 | cs = tvtk.ConeSource(resolution=100) 3 | mapper = tvtk.PolyDataMapper(input=cs.output) 4 | actor = tvtk.Actor(mapper=mapper) 5 | 6 | # create a renderer: 7 | renderer = tvtk.Renderer() 8 | # create a render window and hand it the renderer: 9 | render_window = tvtk.RenderWindow(size=(400,400)) 10 | render_window.add_renderer(renderer) 11 | 12 | # create interactor and hand it the render window 13 | # This handles mouse interaction with window. 14 | interactor = tvtk.RenderWindowInteractor(render_window=render_window) 15 | renderer.add_actor(actor) 16 | interactor.initialize() 17 | interactor.start() 18 | -------------------------------------------------------------------------------- /originals/MayaVi(2f)tvtk_attachments/vis_quad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi(2f)tvtk_attachments/vis_quad.png -------------------------------------------------------------------------------- /originals/MayaVi_attachments/5_2_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi_attachments/5_2_1.png -------------------------------------------------------------------------------- /originals/MayaVi_attachments/mayavi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi_attachments/mayavi.png -------------------------------------------------------------------------------- /originals/MayaVi_attachments/mayavi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi_attachments/mayavi2.png -------------------------------------------------------------------------------- /originals/MayaVi_attachments/mlab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MayaVi_attachments/mlab.png -------------------------------------------------------------------------------- /originals/MetaArray_attachments/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/MetaArray_attachments/example.png -------------------------------------------------------------------------------- /originals/Multithreading.txt: -------------------------------------------------------------------------------- 1 | = Easy multithreading = 2 | Python includes a multithreading package, "threading", but python's multithreading is seriously limited by the Global Interpreter Lock, which allows only one thread to be interacting with the interpreter at a time. For purely interpreted code, this makes multithreading effectively cooperative and unable to take advantage of multiple cores. 3 | 4 | However, numpy code often releases the GIL while it is calculating, so that simple parallelism can speed up the code. For sophisticated applications, one should look into MPI or using threading directly, but surprisingly often one's application is "embarrassingly parallel", that is, one simply has to do the same operation to many objects, with no interaction between iterations. This kind of calculation can be easily parallelized: 5 | 6 | {{{ 7 | dft = parallel_map(lambda f: sum(exp(2.j*pi*f*times)), frequencies) 8 | }}} 9 | The code implementing parallel_map is not too complicated, and is attached to this entry. Even simpler, if one doesn't want to return values: 10 | 11 | {{{ 12 | def compute(n): 13 | ...do something... 14 | foreach(compute, range(100)) 15 | }}} 16 | This replaces a for loop. 17 | 18 | See attachments for code (written by AMArchibald). 19 | [[AttachList]] 20 | 21 | See also ParallelProgramming for alternatives and more discussion. 22 | ---- 23 | CategoryCookbook 24 | -------------------------------------------------------------------------------- /originals/Multithreading_attachments/test_handythread.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import unittest 3 | 4 | import handythread 5 | 6 | 7 | class HandythreadTest(unittest.TestCase): 8 | def test_coverage(self): 9 | d = {} 10 | l = range(100) 11 | def f(x): 12 | d[x]=x**2 13 | handythread.foreach(f, l) 14 | for i in l: 15 | self.assertEqual(d[i],i**2) 16 | 17 | def test_return(self): 18 | l = range(100) 19 | r = handythread.foreach(lambda x: x**2, l, return_=True) 20 | for i in range(len(l)): 21 | self.assertEqual(l[i]**2,r[i]) 22 | 23 | def test_return_1(self): 24 | l = range(100) 25 | r = handythread.foreach(lambda x: x**2, l, return_=True, threads=1) 26 | for i in range(len(l)): 27 | self.assertEqual(l[i]**2,r[i]) 28 | 29 | def test_parallel_map(self): 30 | l = range(100) 31 | r = handythread.parallel_map(lambda x: x**2, l) 32 | for i in range(len(l)): 33 | self.assertEqual(l[i]**2,r[i]) 34 | 35 | 36 | if __name__=='__main__': 37 | unittest.main() 38 | -------------------------------------------------------------------------------- /originals/Obarray.txt: -------------------------------------------------------------------------------- 1 | = Object arrays using record arrays = 2 | numpy supports working with arrays of python objects, but these arrays lack the type-uniformity of normal numpy arrays, so they can be quite inefficient in terms of space and time, and they can be quite cumbersome to work with. However, it would often be useful to be able to store a user-defined class in an array. 3 | 4 | One approach is to take advantage of numpy's record arrays. These are arrays in which each element can be large, as it has named and typed fields; essentially they are numpy's equivalent to arrays of C structures. Thus if one had a class consisting of some data - named fields, each of a numpy type - and some methods, one could represent the data for an array of these objects as a record array. Getting the methods is more tricky. 5 | 6 | One approach is to create a custom subclass of the numpy array which handles conversion to and from your object type. The idea is to store the data for each instance internally in a record array, but when indexing returns a scalar, construct a new instance from the data in the records. Similarly, when assigning to a particular element, the array subclass would convert an instance to its representation as a record. 7 | 8 | Attached is an implementation of the above scheme. 9 | -------------------------------------------------------------------------------- /originals/Obarray_attachments/obarray.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | def make_obarray(klass, dtype): 3 | class Obarray(np.ndarray): 4 | def __new__(cls, obj): 5 | A = np.array(obj,dtype=np.object) 6 | N = np.empty(shape=A.shape, dtype=dtype) 7 | for idx in np.ndindex(A.shape): 8 | for name, type in dtype: 9 | N[name][idx] = type(getattr(A[idx],name)) 10 | return N.view(cls) 11 | def __getitem__(self, idx): 12 | V = np.ndarray.__getitem__(self,idx) 13 | if np.isscalar(V): 14 | kwargs = {} 15 | for i, (name, type) in enumerate(dtype): 16 | kwargs[name] = V[i] 17 | return klass(**kwargs) 18 | else: 19 | return V 20 | def __setitem__(self, idx, value): 21 | if isinstance(value, klass): 22 | value = tuple(getattr(value, name) for name, type in dtype) 23 | # FIXME: treat lists of lists and whatnot as arrays 24 | return np.ndarray.__setitem__(self, idx, value) 25 | return Obarray 26 | 27 | 28 | -------------------------------------------------------------------------------- /originals/OldMatplotlib.txt: -------------------------------------------------------------------------------- 1 | Recipes listed here still exist on the Wiki, but are being contributed to Matplotlib and will eventually be deleted. 2 | 3 | * ["Plotting Tutorial"]. 4 | ## THIS IS A BROKEN LINK! Anyone have the page? 5 | ## See also the [http://www.scipy.org/documentation/plottutorial.html old version]. 6 | * [:Cookbook/Matplotlib/mplot3D:3D Plotting with Matplotlib]. Simple 3D plots using matplotlib and its now-included 3D capabilities. 7 | -------------------------------------------------------------------------------- /originals/OptimizationAndFitDemo1.txt: -------------------------------------------------------------------------------- 1 | This is a quick example of creating data from several [http://docs.scipy.org/doc/scipy/reference/special.html Bessel functions] and finding local maxima, then fitting a curve using some spline functions from the [http://docs.scipy.org/doc/scipy/reference/interpolate.html scipy.interpolate] module. The [http://code.enthought.com/chaco/ enthought.chaco] package and [http://www.wxpython.org/ wxpython] are used for creating the plot. [http://wiki.wxpython.org/index.cgi/PyCrust PyCrust] (which comes with wxpython) was used as the python shell. 2 | 3 | {{{#!python 4 | from enthought.chaco.wx import plt 5 | from scipy import arange, optimize, special 6 | 7 | plt.figure() 8 | plt.hold() 9 | w = [] 10 | z = [] 11 | x = arange(0,10,.01) 12 | 13 | for k in arange(1,5,.5): 14 | y = special.jv(k,x) 15 | plt.plot(x,y) 16 | f = lambda x: -special.jv(k,x) 17 | x_max = optimize.fminbound(f,0,6) 18 | w.append(x_max) 19 | z.append(special.jv(k,x_max)) 20 | 21 | plt.plot(w,z, 'ro') 22 | from scipy import interpolate 23 | t = interpolate.splrep(w, z, k=3) 24 | s_fit3 = interpolate.splev(x,t) 25 | plt.plot(x,s_fit3, 'g-') 26 | t5 = interpolate.splrep(w, z, k=5) 27 | s_fit5 = interpolate.splev(x,t5) 28 | plt.plot(x,s_fit5, 'y-') 29 | }}} 30 | 31 | {{{#!figure 32 | #class left 33 | 34 | inline:chacoscreenshot.png 35 | Optimization Example 36 | }}} 37 | -------------------------------------------------------------------------------- /originals/OptimizationAndFitDemo1_attachments/chacoscreenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/OptimizationAndFitDemo1_attachments/chacoscreenshot.png -------------------------------------------------------------------------------- /originals/OptimizationDemo1.txt: -------------------------------------------------------------------------------- 1 | SciPy's optimization package is scipy.optimize. The most basic non-linear optimization functions are: 2 | *optimize.fmin(func, x0), which finds the minimum of f(x) starting x with x0 (x can be a vector) 3 | *optimize.fsolve(func, x0), which finds a solution to func(x) = 0 starting with x = x0 (x can be a vector) 4 | *optimize.fminbound(func, x1, x2), which finds the minimum of a scalar function func(x) for the range [x1,x2] (x1,x2 must be a scalar and func(x) must return a scalar) 5 | See the [http://docs.scipy.org/doc/scipy/reference/optimize.html scipy.optimze documentation] for details. 6 | 7 | This is a quick demonstration of generating data from several Bessel functions and finding some local maxima using fminbound. This uses ipython with the -pylab switch. 8 | 9 | {{{#!python 10 | from scipy import optimize, special 11 | from numpy import * 12 | from pylab import * 13 | 14 | x = arange(0,10,0.01) 15 | 16 | for k in arange(0.5,5.5): 17 | y = special.jv(k,x) 18 | plot(x,y) 19 | f = lambda x: -special.jv(k,x) 20 | x_max = optimize.fminbound(f,0,6) 21 | plot([x_max], [special.jv(k,x_max)],'ro') 22 | 23 | title('Different Bessel functions and their local maxima') 24 | show() 25 | 26 | 27 | }}} 28 | 29 | {{{ 30 | #!figure 31 | #class left 32 | inline:NumPyOptimizationSmall.png 33 | 34 | Optimization Example 35 | }}} 36 | ---- 37 | CategoryCookbook 38 | -------------------------------------------------------------------------------- /originals/OptimizationDemo1_attachments/NumPyOptimization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/OptimizationDemo1_attachments/NumPyOptimization.png -------------------------------------------------------------------------------- /originals/OptimizationDemo1_attachments/NumPyOptimizationSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/OptimizationDemo1_attachments/NumPyOptimizationSmall.png -------------------------------------------------------------------------------- /originals/OptimizationDemo1_attachments/mplscreenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/OptimizationDemo1_attachments/mplscreenshot.png -------------------------------------------------------------------------------- /originals/ParticleFilter_attachments/pftrack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ParticleFilter_attachments/pftrack.jpg -------------------------------------------------------------------------------- /originals/ParticleFilter_attachments/pftrack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ParticleFilter_attachments/pftrack.png -------------------------------------------------------------------------------- /originals/ParticleFilter_attachments/pftracking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ParticleFilter_attachments/pftracking.jpg -------------------------------------------------------------------------------- /originals/ParticleFilter_attachments/track.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/ParticleFilter_attachments/track.jpg -------------------------------------------------------------------------------- /originals/RANSAC.txt: -------------------------------------------------------------------------------- 1 | The attached file ( attachment:ransac.py ) implements the [http://en.wikipedia.org/wiki/RANSAC RANSAC algorithm]. An example image: 2 | 3 | attachment:ransac.png 4 | 5 | To run the file, save it to your computer, start IPython 6 | {{{ 7 | ipython -wthread 8 | }}} 9 | 10 | Import the module and run the test program 11 | 12 | {{{#!python 13 | import ransac 14 | ransac.test() 15 | }}} 16 | 17 | To use the module you need to create a model class with two methods 18 | 19 | {{{#!python 20 | def fit(self, data): 21 | """Given the data fit the data with your model and return the model (a vector)""" 22 | def get_error(self, data, model): 23 | """Given a set of data and a model, what is the error of using this model to estimate the data """ 24 | }}} 25 | 26 | An example of such model is the class LinearLeastSquaresModel as seen the file source (below) 27 | 28 | inline:ransac.py 29 | 30 | ---- 31 | CategoryCookbook 32 | -------------------------------------------------------------------------------- /originals/RANSAC_attachments/ransac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/RANSAC_attachments/ransac.png -------------------------------------------------------------------------------- /originals/RadialBasisFunctions_attachments/rbf1d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/RadialBasisFunctions_attachments/rbf1d.png -------------------------------------------------------------------------------- /originals/RadialBasisFunctions_attachments/rbf1dnew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/RadialBasisFunctions_attachments/rbf1dnew.png -------------------------------------------------------------------------------- /originals/RadialBasisFunctions_attachments/rbf2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/RadialBasisFunctions_attachments/rbf2d.png -------------------------------------------------------------------------------- /originals/RadialBasisFunctions_attachments/rbf2dnew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/RadialBasisFunctions_attachments/rbf2dnew.png -------------------------------------------------------------------------------- /originals/Reading_Custom_Text_Files_with_Pyparsing_attachments/data.txt: -------------------------------------------------------------------------------- 1 | # This is is an example file structured in section 2 | # with comments begining with '#' 3 | 4 | [ INFOS ] 5 | Debug = False 6 | Shape (mm^-1) = 2.3 # here is a unit 7 | Length (mm) = 25361.15 8 | Path 1 = C:\\This\is\a\long\path\with some space in it\data.txt 9 | description = raw values can have multiple lines, but additional lines must start 10 | with a whitespace which is automatically skipped 11 | Parent = None 12 | 13 | [ TABLE IN ROWS ] 14 | Temp (C) 100 200 300 450.0 600 15 | E XX (GPa) 159.4 16.9E+0 51.8 .15E02 4 # Here is a space in the row name 16 | Words 'hundred' 'two hundreds' 'a lot' 'four' 'five' # Here are QuotedStrings with space 17 | 18 | [ TABLE IN COLUMNS ] 19 | STATION PRECIPITATION T_MAX_ABS T_MIN_ABS 20 | (/) (mm) (C) (C) # Columns must have a unit 21 | Ajaccio 64.8 18.8E+0 -2.6 22 | Auxerre 49.6 16.9E+0 Nan # Here is a Nan 23 | Bastia 114.2 20.8E+0 -0.9 24 | [ MATRIX ] 25 | True 2 3 26 | 4. 5. 6. 27 | 7. nan 8 28 | 29 | -------------------------------------------------------------------------------- /originals/Reading_Custom_Text_Files_with_Pyparsing_attachments/data3.txt: -------------------------------------------------------------------------------- 1 | # This is is an example file structured in section 2 | # with comments begining with '#' 3 | 4 | [ INFOS ] 5 | Debug = False 6 | Shape (mm^-1) = 2.3 # here is a unit 7 | Length (mm) = 25361.15 8 | Path 1 = C:\\This\is\a\long\path\with some space in it\data.txt 9 | description = raw values can have multiple lines, but additional lines must start 10 | with a whitespace which is automatically skipped 11 | Parent = None 12 | 13 | [ EMPTY SECTION ] 14 | # empty section should not be taken into account 15 | 16 | [ TABLE IN ROWS ] 17 | Temp (C) 100 200 300 450.0 600 18 | E XX (GPa) 159.4 16.9E+0 51.8 .15E02 4 # Here is a space in the row name 19 | Words 'hundred' 'two hundreds' 'a lot' 'four' 'five' # Here are QuotedStrings with space 20 | 21 | [ TABLE IN COLUMNS ] 22 | STATION PRECIPITATION T_MAX_ABS T_MIN_ABS 23 | (/) (mm) (C) (C) # Columns must have a unit 24 | Ajaccio 64.8 18.8E+0 -2.6 25 | Auxerre 49.6 16.9E+0 Nan # Here is a Nan 26 | Bastia 114.2 20.8E+0 -0.9 27 | 28 | [ MATRIX ] 29 | True 2 3 30 | 4. 5. 6. 31 | 7. nan 8 32 | 33 | -------------------------------------------------------------------------------- /originals/Reading_SPE_files_attachments/lampe_dt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Reading_SPE_files_attachments/lampe_dt.png -------------------------------------------------------------------------------- /originals/Reading_SPE_files_attachments/read_spe.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Reading_SPE_files_attachments/read_spe.zip -------------------------------------------------------------------------------- /originals/SavitzkyGolay_attachments/Original+noise+filtered.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SavitzkyGolay_attachments/Original+noise+filtered.pdf -------------------------------------------------------------------------------- /originals/SavitzkyGolay_attachments/Original+noise.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SavitzkyGolay_attachments/Original+noise.pdf -------------------------------------------------------------------------------- /originals/SavitzkyGolay_attachments/Original.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SavitzkyGolay_attachments/Original.pdf -------------------------------------------------------------------------------- /originals/SavitzkyGolay_attachments/cd_spec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SavitzkyGolay_attachments/cd_spec.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/Schrodinger_FDTD.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/Schrodinger_FDTD.pdf -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/Schrodinger_FDTD_new.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/Schrodinger_FDTD_new.pdf -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_barrier_hi_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_barrier_hi_sm.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_barrier_hi_sm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_barrier_hi_sm2.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_barrier_lo_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_barrier_lo_sm.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_barrier_lo_sm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_barrier_lo_sm2.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_hi_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_hi_sm.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_hi_sm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_hi_sm2.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_init_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_init_sm.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_init_sm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_init_sm2.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_lo_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_lo_sm.png -------------------------------------------------------------------------------- /originals/SchrodingerFDTD_attachments/schrod_step_lo_sm2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SchrodingerFDTD_attachments/schrod_step_lo_sm2.png -------------------------------------------------------------------------------- /originals/SignalSmooth_attachments/convolved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SignalSmooth_attachments/convolved.png -------------------------------------------------------------------------------- /originals/SignalSmooth_attachments/noisy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SignalSmooth_attachments/noisy.png -------------------------------------------------------------------------------- /originals/SignalSmooth_attachments/smoothsignal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SignalSmooth_attachments/smoothsignal.jpg -------------------------------------------------------------------------------- /originals/Solving_Large_Markov_Chains_attachments/pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Solving_Large_Markov_Chains_attachments/pi.png -------------------------------------------------------------------------------- /originals/SphericalBesselZeros_attachments/snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/SphericalBesselZeros_attachments/snapshot.png -------------------------------------------------------------------------------- /originals/Theoretical_Ecology.txt: -------------------------------------------------------------------------------- 1 | - [:Cookbook/Theoretical Ecology/Hastings and Powell: Chaos in a 3-Species Food-Chain] 2 | -------------------------------------------------------------------------------- /originals/TimeSeries.txt: -------------------------------------------------------------------------------- 1 | For the offical documentation created by the developers of the timeseries scikit [http://pytseries.sourceforge.net click here]. 2 | 3 | Here on the [:Cookbook] you may find some useful and complementary information: 4 | 5 | * [:Cookbook/TimeSeries/FAQ:FAQ] 6 | *Recipies 7 | -------------------------------------------------------------------------------- /originals/Watershed_attachments/watershed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Watershed_attachments/watershed.png -------------------------------------------------------------------------------- /originals/Weave_attachments/fftmod.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Weave_attachments/fftmod.tar.gz -------------------------------------------------------------------------------- /originals/Zombie_Apocalypse_ODEINT_attachments/zombie_nodead_nobirths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Zombie_Apocalypse_ODEINT_attachments/zombie_nodead_nobirths.png -------------------------------------------------------------------------------- /originals/Zombie_Apocalypse_ODEINT_attachments/zombie_somedead_10birth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Zombie_Apocalypse_ODEINT_attachments/zombie_somedead_10birth.png -------------------------------------------------------------------------------- /originals/Zombie_Apocalypse_ODEINT_attachments/zombie_somedead_nobirth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/Zombie_Apocalypse_ODEINT_attachments/zombie_somedead_nobirth.png -------------------------------------------------------------------------------- /originals/dbase_attachments/ex_plot.0.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/dbase_attachments/ex_plot.0.1.png -------------------------------------------------------------------------------- /originals/dbase_attachments/ex_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/dbase_attachments/ex_plot.png -------------------------------------------------------------------------------- /originals/dbase_attachments/ex_plot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/dbase_attachments/ex_plot1.png -------------------------------------------------------------------------------- /originals/dbase_attachments/example_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/dbase_attachments/example_plot.png -------------------------------------------------------------------------------- /originals/hdf5_in_Matlab.txt: -------------------------------------------------------------------------------- 1 | Python can save rich hierarchical datasets in hdf5 format. Matlab can read hdf5, but the api is so heavy it is almost unusable. Here are some matlab scripts (written by Gaël Varoquaux) to load and save data in hdf5 format under Matlab with the same signature as the standard matlab load/save function. 2 | 3 | attachment:hdf5matlab.zip 4 | 5 | These Matlab scripts cannot load every type allowed in hdf5. Feel free to provide python scripts to use pytables to implement simple load/save functions compatible with this hdf5 subset. 6 | 7 | One notice: these script use the "Workspace" namespace to store some variables, they will pollute your workspace when saving data from Matlab. Nothing that I find unacceptable. 8 | 9 | == Another loader script == 10 | 11 | Here is a second HDF5 loader script, which loads (optionally partial) data from a HDF5 file to a Matlab structure 12 | 13 | attachment:h5load.m 14 | 15 | It can deal with more varied HDF5 datasets than the Matlab high-level functions (at least R2008a hdf5info fails with chunked compressed datasets), via using only the low-level HDF5 API. 16 | 17 | The script also recognizes complex numbers in the Pytables format, and permutes array dimensions to match the logical order in the file (ie. to match Python. The builtin Matlab functions by default return data in the opposite order, so the first dimension in Python would be the last in Matlab). 18 | ---- 19 | CategoryCookbook 20 | -------------------------------------------------------------------------------- /originals/hdf5_in_Matlab_attachments/hdf5matlab.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/hdf5_in_Matlab_attachments/hdf5matlab.zip -------------------------------------------------------------------------------- /originals/mplot3D.txt: -------------------------------------------------------------------------------- 1 | #redirect Cookbook/Matplotlib/mplot3D 2 | -------------------------------------------------------------------------------- /originals/multiprocessing.txt: -------------------------------------------------------------------------------- 1 | === The multiprocessing standard module === 2 | 3 | This page was obsolete as multiprocessing's internals have changed. 4 | More information will come shortly; a link to this page will then be 5 | added back to the Cookbook. 6 | 7 | ---- 8 | CategoryCookbook 9 | -------------------------------------------------------------------------------- /originals/xplt.txt: -------------------------------------------------------------------------------- 1 | This shows a simple example of how to create a quick 3-d surface visualization using xplt. 2 | 3 | {{{#!python 4 | 5 | from scipy.sandbox import xplt 6 | from numpy import * 7 | from scipy import special 8 | 9 | x,y = ogrid[-12:12:50j,-12:12:50j] 10 | r = sqrt(x**2+y**2) 11 | z = special.j0(r) 12 | xplt.surf(z,x,y,shade=1,palette='heat') 13 | }}} 14 | 15 | inline:surface.png 16 | -------------------------------------------------------------------------------- /originals/xplt_attachments/surface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mpastell/SciPy-CookBook/52f70a7aa4bd4fd11217a13fc8dd5e277f2388ea/originals/xplt_attachments/surface.png -------------------------------------------------------------------------------- /pweave_all.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import glob 4 | import shutil 5 | 6 | os.chdir('attachments') 7 | 8 | files = glob.glob('*.Pnw') 9 | n = 0 10 | 11 | 12 | for doc in files: 13 | call = "Pweave -f sphinx %s" % doc 14 | os.system(call) 15 | rst_file = doc.replace('.Pnw', '.rst') 16 | shutil.move(rst_file, '../rst/' + rst_file) 17 | n +=1 18 | print n 19 | 20 | -------------------------------------------------------------------------------- /rst/ASTER.rst: -------------------------------------------------------------------------------- 1 | Describe Cookbook/ASTER here. ... 2 | 3 | -------------------------------------------------------------------------------- /rst/A_Pyrex_Agnostic_Class.rst: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/A\_Numerical\_Agnostic\_Pyrex\_Class 2 | 3 | 4 | -------------------------------------------------------------------------------- /rst/FortranIO(2f)FortranFile(2e).rst: -------------------------------------------------------------------------------- 1 | This page should be removed. It's content is now available at 2 | Cookbook/FortranIO/FortranFile 3 | 4 | -------------------------------------------------------------------------------- /rst/GMailPM.rst: -------------------------------------------------------------------------------- 1 | Note to the administrators of scipy/cookbook 2 | ============================================ 3 | 4 | I'm planning to describe a method that could help other people to keep 5 | track of their simulations and provide simple framework. It is available 6 | as `pypi `__ package. A tutorial can be found 7 | `here `__. 8 | In the recipe I would just describe what I did in the python code. 9 | 10 | Do you think this is appropriate here? The script does not make use of 11 | scipy or numpy but I think the audience of scipy.org might like the 12 | idea! Please let me know if this is an inappropriate recipe, otherwise I 13 | will just start writing next week. 14 | 15 | Basics 16 | ====== 17 | 18 | The idea is to use python in combination with gmail as a powerful but 19 | yet simple tool to document runs of computer simulations, their 20 | parameters, starting times, progress and results. 21 | 22 | 23 | 24 | .. code-block:: python 25 | 26 | #!python numbers=disable 27 | import numpy as np 28 | #test 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /rst/Intersection.rst: -------------------------------------------------------------------------------- 1 | Find the points at which two given functions intersect 2 | ------------------------------------------------------ 3 | 4 | Consider the example of finding the intersection of a polynomial and a 5 | line: 6 | 7 | 8 | 9 | .. code-block:: python 10 | 11 | y1=x1^2 12 | y2=x2+1 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | .. code-block:: python 22 | 23 | from scipy.optimize import fsolve 24 | 25 | import numpy as np 26 | 27 | def f(xy): 28 | x, y = xy 29 | z = np.array([y - x**2, y - x - 1.0]) 30 | return z 31 | 32 | fsolve(f, [1.0, 2.0]) 33 | 34 | 35 | 36 | 37 | The result of this should be: 38 | 39 | 40 | 41 | .. code-block:: python 42 | 43 | array([ 1.61803399, 2.61803399]) 44 | 45 | 46 | 47 | 48 | See also: 49 | http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.fsolve.html#scipy.optimize.fsolve 50 | 51 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)Arrows.rst: -------------------------------------------------------------------------------- 1 | Some example code for how to plot an arrow using the Arrow function. 2 | 3 | 4 | 5 | .. code-block:: python 6 | 7 | from pylab import * 8 | from numarray import * 9 | 10 | x = arange(10) 11 | y = x 12 | 13 | # Plot junk and then a filled region 14 | plot(x, y) 15 | 16 | # Now lets make an arrow object 17 | arr = Arrow(2, 2, 1, 1, edgecolor='white') 18 | 19 | # Get the subplot that we are currently working on 20 | ax = gca() 21 | 22 | # Now add the arrow 23 | ax.add_patch(arr) 24 | 25 | # We should be able to make modifications to the arrow. 26 | # Lets make it green. 27 | arr.set_facecolor('g') 28 | 29 | 30 | 31 | 32 | .. image:: Matplotlib(2f)Arrows_attachments/plot_arrow.png 33 | 34 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)BarCharts.rst: -------------------------------------------------------------------------------- 1 | Use the bar function to make bar charts: 2 | http://matplotlib.sourceforge.net/matplotlib.pylab.html\ #-bar 3 | 4 | Here's an example script that makes a bar char with error bars and 5 | labels centered under the bars. 6 | 7 | 8 | 9 | .. code-block:: python 10 | 11 | #!/usr/bin/env python 12 | import numpy.numarray as na 13 | 14 | from pylab import * 15 | 16 | labels = ["Baseline", "System"] 17 | data = [3.75 , 4.75] 18 | error = [0.3497 , 0.3108] 19 | 20 | xlocations = na.array(range(len(data)))+0.5 21 | width = 0.5 22 | bar(xlocations, data, yerr=error, width=width) 23 | yticks(range(0, 8)) 24 | xticks(xlocations+ width/2, labels) 25 | xlim(0, xlocations[-1]+width*2) 26 | title("Average Ratings on the Training Set") 27 | gca().get_xaxis().tick_bottom() 28 | gca().get_yaxis().tick_left() 29 | 30 | show() 31 | 32 | 33 | 34 | 35 | `` .. image:: Matplotlib(2f)BarCharts_attachments/barchart.png`` 36 | 37 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)Common_Errors.rst: -------------------------------------------------------------------------------- 1 | ``* imshow - You can get seemingly quirky behavior if you do not set vmin and vmax manually. If they are left unset, then !AxisImage will attempt to automatically scale the values of the elements in order to keep the luminance constant. However, if you are doing something like an animation, or want to compare two images against each other, this can cause problems. For example, if you know your values will range between 0 and 1, you can do: imshow(img, vmin=0, vmax=1, cmap=cm.gray, interpolation=``\ \ ``). This also sets the color map to grays, and to use square blocks for the elements.`` 2 | 3 | -------------- 4 | 5 | CategoryCookbookMatplotlib 6 | 7 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)DeletingAnExistingDataSeries.rst: -------------------------------------------------------------------------------- 1 | Each axes instance contains a lines attribute, which is a list of the 2 | data series in the plot, added in chronological order. To delete a 3 | particular data series, one must simply delete the appropriate element 4 | of the lines list and redraw if necessary. 5 | 6 | The is illustrated in the following example from an interactive session: 7 | 8 | 9 | 10 | .. code-block:: python 11 | 12 | >>> x = N.arange(10) 13 | 14 | >>> fig = P.figure() 15 | >>> ax = fig.add_subplot(111) 16 | >>> ax.plot(x) 17 | [] 18 | 19 | >>> ax.plot(x+10) 20 | [] 21 | 22 | >>> ax.plot(x+20) 23 | [] 24 | 25 | >>> P.show() 26 | >>> ax.lines 27 | [, 28 | , 29 | ] 30 | 31 | >>> del ax.lines[1] 32 | >>> P.show() 33 | 34 | 35 | 36 | 37 | which will plot three lines, and then delete the second. 38 | 39 | -------------- 40 | 41 | CategoryCookbookMatplotlib 42 | 43 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)LoadImage.rst: -------------------------------------------------------------------------------- 1 | Image processing often works on gray scale images that were stored as 2 | PNG files. How do we import / export that file into ? 3 | 4 | ``* Here is a recipy to do this with Matplotlib using the ``\ \ `` function (your image is called ``\ \ ``). ``\ 5 | 6 | This permits to do some processing for further exporting such as for 7 | [:Cookbook/Matplotlib/converting\_a\_matrix\_to\_a\_raster\_image:converting 8 | a matrix to a raster image]. In the newest version of pylab (check that 9 | your is superior to ) you get directly a 2D numpy array if the image is 10 | grayscale. 11 | 12 | ``* to write an image, do ``\ 13 | 14 | ``* this kind of functions live also under ``\ \ ``, see for instance ``\ \ `` to create a color image:``\ 15 | 16 | ``* to define the range, use:``\ \ `` (adapted from ``\ ```http://telin.ugent.be/~slippens/drupal/scipy_unscaledimsave`` `__\ `` )`` 17 | 18 | ``* there was another (more direct) method suggested by ``\ ```http://jehiah.cz/archive/creating-images-with-numpy`` `__ 19 | 20 | -------------- 21 | 22 | CategoryCookbookMatplotlib 23 | 24 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)PySide.rst: -------------------------------------------------------------------------------- 1 | This is a very basic example showing how to display a matplotlib plot 2 | within a Qt application using PySide. In case of problems try to change 3 | the rcParam entry “backend.qt4” to "PySide" (e.g. by in the matplotlibrc 4 | file). 5 | 6 | 7 | 8 | .. code-block:: python 9 | 10 | #!/usr/bin/env python 11 | import sys 12 | import matplotlib 13 | matplotlib.use('Qt4Agg') 14 | import pylab 15 | 16 | from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas 17 | 18 | from matplotlib.figure import Figure 19 | 20 | from PySide import QtCore, QtGui 21 | 22 | if __name__ == '__main__': 23 | app = QtGui.QApplication(sys.argv) 24 | 25 | # generate the plot 26 | fig = Figure(figsize=(600,600), dpi=72, facecolor=(1,1,1), edgecolor=(0,0,0) 27 | ) 28 | ax = fig.add_subplot(111) 29 | ax.plot([0,1]) 30 | # generate the canvas to display the plot 31 | canvas = FigureCanvas(fig) 32 | 33 | win = QtGui.QMainWindow() 34 | # add the plot canvas to a window 35 | win.setCentralWidget(canvas) 36 | 37 | win.show() 38 | 39 | sys.exit(app.exec_()) 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)ShadedRegions.rst: -------------------------------------------------------------------------------- 1 | Use the fill function to make shaded regions of any color tint. Here is 2 | an example. 3 | 4 | 5 | 6 | .. code-block:: python 7 | 8 | 9 | from pylab import * 10 | 11 | x = arange(10) 12 | y = x 13 | 14 | # Plot junk and then a filled region 15 | plot(x, y) 16 | 17 | # Make a blue box that is somewhat see-through 18 | # and has a red border. 19 | # WARNING: alpha doesn't work in postscript output.... 20 | fill([3,4,4,3], [2,2,4,4], 'b', alpha=0.2, edgecolor='r') 21 | 22 | 23 | 24 | 25 | .. image:: Matplotlib(2f)ShadedRegions_attachments/shaded.png 26 | 27 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)ThickAxes.rst: -------------------------------------------------------------------------------- 1 | Example of how to thicken the lines around your plot (axes lines) and to 2 | get big bold fonts on the tick and axis labels. 3 | 4 | 5 | 6 | .. code-block:: python 7 | 8 | from pylab import * 9 | 10 | # Thicken the axes lines and labels 11 | # 12 | # Comment by J. R. Lu: 13 | # I couldn't figure out a way to do this on the 14 | # individual plot and have it work with all backends 15 | # and in interactive mode. So, used rc instead. 16 | # 17 | rc('axes', linewidth=2) 18 | 19 | # Make a dummy plot 20 | plot([0, 1], [0, 1]) 21 | 22 | # Change size and font of tick labels 23 | # Again, this doesn't work in interactive mode. 24 | fontsize = 14 25 | ax = gca() 26 | 27 | for tick in ax.xaxis.get_major_ticks(): 28 | tick.label1.set_fontsize(fontsize) 29 | tick.label1.set_fontweight('bold') 30 | for tick in ax.yaxis.get_major_ticks(): 31 | tick.label1.set_fontsize(fontsize) 32 | tick.label1.set_fontweight('bold') 33 | 34 | xlabel('X Axis', fontsize=16, fontweight='bold') 35 | ylabel('Y Axis', fontsize=16, fontweight='bold') 36 | 37 | # Save figure 38 | savefig('thick_axes.png') 39 | 40 | 41 | 42 | 43 | .. image:: Matplotlib(2f)ThickAxes_attachments/thick_axes.png 44 | 45 | -------------------------------------------------------------------------------- /rst/Matplotlib(2f)converting_a_matrix_to_a_raster_image.rst: -------------------------------------------------------------------------------- 1 | Scipy provides a command (imsave) to make a raster (png, jpg...) image 2 | from a 2D array, each pixel corresponding to one value of the array. Yet 3 | the image is black and white. 4 | 5 | Here is a recipy to do this with Matplotlib, and use a colormap to give 6 | color to the image. 7 | 8 | 9 | 10 | .. code-block:: python 11 | 12 | from pylab import * 13 | from scipy import mgrid 14 | 15 | def imsave(filename, X, **kwargs): 16 | """ Homebrewed imsave to have nice colors... """ 17 | figsize=(array(X.shape)/100.0)[::-1] 18 | rcParams.update({'figure.figsize':figsize}) 19 | fig = figure(figsize=figsize) 20 | axes([0,0,1,1]) # Make the plot occupy the whole canvas 21 | axis('off') 22 | fig.set_size_inches(figsize) 23 | imshow(X,origin='lower', **kwargs) 24 | savefig(filename, facecolor='black', edgecolor='black', dpi=100) 25 | close(fig) 26 | 27 | 28 | X,Y=mgrid[-5:5:0.1,-5:5:0.1] 29 | Z=sin(X**2+Y**2+1e-4)/(X**2+Y**2+1e-4) # Create the data to be plotted 30 | imsave('imsave.png', Z, cmap=cm.hot ) 31 | 32 | 33 | 34 | 35 | .. image:: Matplotlib(2f)converting_a_matrix_to_a_raster_image_attachments/imsave.png 36 | 37 | -------------------------------------------------------------------------------- /rst/MayaVi(2f)Installation.rst: -------------------------------------------------------------------------------- 1 | TableOfContents 2 | 3 | !MayaVi2 and TVTK are part of the `enthought tool 4 | suite `__. 5 | 6 | **These instructions are out of date**, see the `Mayavi2 7 | homepage `__ 8 | 9 | -------------- 10 | 11 | CategoryInstallation 12 | 13 | -------------------------------------------------------------------------------- /rst/Obarray.rst: -------------------------------------------------------------------------------- 1 | Object arrays using record arrays 2 | ================================= 3 | 4 | numpy supports working with arrays of python objects, but these arrays 5 | lack the type-uniformity of normal numpy arrays, so they can be quite 6 | inefficient in terms of space and time, and they can be quite cumbersome 7 | to work with. However, it would often be useful to be able to store a 8 | user-defined class in an array. 9 | 10 | One approach is to take advantage of numpy's record arrays. These are 11 | arrays in which each element can be large, as it has named and typed 12 | fields; essentially they are numpy's equivalent to arrays of C 13 | structures. Thus if one had a class consisting of some data - named 14 | fields, each of a numpy type - and some methods, one could represent the 15 | data for an array of these objects as a record array. Getting the 16 | methods is more tricky. 17 | 18 | One approach is to create a custom subclass of the numpy array which 19 | handles conversion to and from your object type. The idea is to store 20 | the data for each instance internally in a record array, but when 21 | indexing returns a scalar, construct a new instance from the data in the 22 | records. Similarly, when assigning to a particular element, the array 23 | subclass would convert an instance to its representation as a record. 24 | 25 | Attached is an implementation of the above scheme. 26 | 27 | -------------------------------------------------------------------------------- /rst/OldMatplotlib.rst: -------------------------------------------------------------------------------- 1 | Recipes listed here still exist on the Wiki, but are being contributed 2 | to Matplotlib and will eventually be deleted. 3 | 4 | ``* ["Plotting Tutorial"].`` 5 | 6 | #. 7 | 8 | #. THIS IS A BROKEN LINK! Anyone have the page? 9 | #. See also the `old 10 | version `__. 11 | 12 | ``* [:Cookbook/Matplotlib/mplot3D:3D Plotting with Matplotlib]. Simple 3D plots using matplotlib and its now-included 3D capabilities.`` 13 | 14 | -------------------------------------------------------------------------------- /rst/RANSAC.rst: -------------------------------------------------------------------------------- 1 | The attached file ( .. image:: RANSAC_attachments/ransac.py ) implements the `RANSAC 2 | algorithm `__. An example image: 3 | 4 | .. image:: RANSAC_attachments/ransac.png 5 | 6 | To run the file, save it to your computer, start IPython 7 | 8 | 9 | 10 | .. code-block:: python 11 | 12 | ipython -wthread 13 | 14 | 15 | 16 | 17 | Import the module and run the test program 18 | 19 | 20 | 21 | .. code-block:: python 22 | 23 | import ransac 24 | ransac.test() 25 | 26 | 27 | 28 | 29 | To use the module you need to create a model class with two methods 30 | 31 | 32 | 33 | .. code-block:: python 34 | 35 | def fit(self, data): 36 | """Given the data fit the data with your model and return the model (a vector) 37 | """ 38 | def get_error(self, data, model): 39 | """Given a set of data and a model, what is the error of using this model to e 40 | stimate the data """ 41 | 42 | 43 | 44 | 45 | An example of such model is the class LinearLeastSquaresModel as seen 46 | the file source (below) 47 | 48 | .. image:: RANSAC_attachments/ransac.py 49 | 50 | -------------- 51 | 52 | ``CategoryCookbook`` 53 | 54 | -------------------------------------------------------------------------------- /rst/Theoretical_Ecology.rst: -------------------------------------------------------------------------------- 1 | - [:Cookbook/Theoretical Ecology/Hastings and Powell: Chaos in a 2 | 3-Species Food-Chain] 3 | 4 | -------------------------------------------------------------------------------- /rst/TimeSeries.rst: -------------------------------------------------------------------------------- 1 | For the offical documentation created by the developers of the 2 | timeseries scikit `click here `__. 3 | 4 | Here on the [:Cookbook] you may find some useful and complementary 5 | information: 6 | 7 | | ``* [:Cookbook/TimeSeries/FAQ:FAQ]`` 8 | | ``*Recipies`` 9 | 10 | -------------------------------------------------------------------------------- /rst/mplot3D.rst: -------------------------------------------------------------------------------- 1 | #. redirect Cookbook/Matplotlib/mplot3D 2 | 3 | 4 | -------------------------------------------------------------------------------- /rst/multiprocessing.rst: -------------------------------------------------------------------------------- 1 | The multiprocessing standard module 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | This page was obsolete as multiprocessing's internals have changed. More 5 | information will come shortly; a link to this page will then be added 6 | back to the Cookbook. 7 | 8 | -------------- 9 | 10 | CategoryCookbook 11 | 12 | -------------------------------------------------------------------------------- /rst/xplt.rst: -------------------------------------------------------------------------------- 1 | This shows a simple example of how to create a quick 3-d surface 2 | visualization using xplt. 3 | 4 | 5 | 6 | .. code-block:: python 7 | 8 | 9 | from scipy.sandbox import xplt 10 | from numpy import * 11 | from scipy import special 12 | 13 | x,y = ogrid[-12:12:50j,-12:12:50j] 14 | r = sqrt(x**2+y**2) 15 | z = special.j0(r) 16 | xplt.surf(z,x,y,shade=1,palette='heat') 17 | 18 | 19 | 20 | 21 | .. image:: xplt_attachments/surface.png 22 | 23 | -------------------------------------------------------------------------------- /scrape_cookbook.py: -------------------------------------------------------------------------------- 1 | import glob 2 | import os 3 | import pweave 4 | import shutil 5 | 6 | os.chdir('pages') 7 | 8 | 9 | dirs = glob.glob('CookBook(2f)*') 10 | 11 | n = len(dirs) 12 | 13 | for i in range(n): 14 | #try: 15 | base = dirs[i] 16 | #base = "Cookbook(2f)KalmanFiltering" 17 | current = open(base + "/current", "r").read().strip() 18 | source = "%s/revisions/%s" % (base, current) 19 | attachments = "%s/attachments" % base 20 | new_attachments = "../originals/" + base.replace("Cookbook(2f)", "") + "_attachments" 21 | try: 22 | shutil.copytree(attachments, new_attachments) 23 | except: 24 | pass 25 | --------------------------------------------------------------------------------