Book contents
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 Getting started with IPython
- 3 A short Python tutorial
- 4 Numpy
- 5 Two-dimensional graphics
- 6 Three-dimensional graphics
- 7 Ordinary differential equations
- 8 Partial differential equations: a pseudospectral approach
- 9 Case study: multigrid
- Appendix A Installing a Python environment
- Appendix B Fortran77 subroutines for pseudospectral methods
- References
- Index
5 - Two-dimensional graphics
Published online by Cambridge University Press: 05 August 2014
- Frontmatter
- Contents
- Preface
- 1 Introduction
- 2 Getting started with IPython
- 3 A short Python tutorial
- 4 Numpy
- 5 Two-dimensional graphics
- 6 Three-dimensional graphics
- 7 Ordinary differential equations
- 8 Partial differential equations: a pseudospectral approach
- 9 Case study: multigrid
- Appendix A Installing a Python environment
- Appendix B Fortran77 subroutines for pseudospectral methods
- References
- Index
Summary
Introduction
The most venerable and perhaps best-known scientific graphics package is Gnuplot, and downloads of this open-source project can be obtained from its website. The official documentation is Gnuplot Community (2012), some 238 pages, and a more descriptive introduction can be found in Janert (2010). Gnuplot is of course independent of Python. However, there is a numpy interface to it, which provides Python-like access to the most commonly used Gnuplot functions. This is available on line. Although most scientific Python implementations install the relevant code as a matter of course, the documentation and example files from this online source are useful. For many applications requiring two-dimensional graphics, the output from Gnuplot is satisfactory, but only at its best is it of publication quality. Here Matlab is, until recently, the market leader in this respect, but Python aims to equal or surpass it in quality and versatility.
The matplotlib project aims to produce Matlab-quality graphics as an add-on to numpy. Almost certainly, this should be part of your installation. It is installed by default in most Python packages designed for scientists. There is extensive “official documentation” (1255 pages) at Matplotlib Community (2013), and a useful alternative description in Tosi (2009). The reader is strongly urged to peruse the Matplotlib Gallery where a large collection of publication quality figures, and the code to generate them, is displayed.
- Type
- Chapter
- Information
- Python for Scientists , pp. 79 - 106Publisher: Cambridge University PressPrint publication year: 2014