Pyxplot Users' Guide

Pyxplot Users' Guide

Pyxplot Users' Guide A Scientific Scripting Language, Graph Plotting Suite and Vector Graphics Toolkit. Version 0.9.2 D = ρfree ∂B E =∇ · RR¨ ∂t q(t) = 2 ∇ × − − R˙ d sin θ = nλ R˙ H(t) = R ds2 = 1 2GM dt2 a a b c − rc2 x¨ + Γ bcx˙ x˙ = 0 H = J ∂D 1 free ∂t ∇ × L 2 − B = 0 dL = 4πF ∇ · ¯h2 ∂2ψ ∆φ 2m ∂x2 + V ψ = Eψ Lead Developer: Dominic Ford Lead Tester: Ross Church Email: [email protected] This manual is also available in HTML, at http://www.pyxplot.org.uk/0.9/doc/html/ September 2012 Contents I Introduction to Pyxplot1 1 Introduction3 1.1 What is Pyxplot?.........................3 1.2 Compatibility with gnuplot....................4 1.3 The structure of this manual...................4 1.4 An introductory tour.......................4 1.5 License...............................9 1.6 Spelling conventions........................ 10 1.7 Acknowledgments......................... 10 2 Installation 11 2.1 Installation within Linux distributions............. 11 2.2 System requirements....................... 11 2.2.1 Dependencies in Debian and Ubuntu......... 12 2.2.2 Dependencies in MacOS................ 13 2.3 Installation from source archive................. 13 2.3.1 System-wide installation................ 14 3 First steps with Pyxplot 15 3.1 Getting started.......................... 15 3.2 First plots............................. 16 3.3 Comments............................. 18 3.4 Splitting long commands..................... 20 3.5 Printing text............................ 20 3.6 Axis labels and titles....................... 22 3.6.1 Removing labels and titles............... 23 3.7 Querying the values of settings.................. 24 3.8 Plotting data files......................... 25 3.9 Plotting many data files at once................. 27 3.9.1 Horizontally arranged data files............ 27 3.9.2 Choosing which data to plot.............. 28 3.10 The replot command....................... 28 3.11 Directing where output goes................... 29 3.12 Setting the size of output..................... 30 3.13 Plotting styles........................... 30 3.14 Setting axis ranges........................ 31 3.15 Interactive help.......................... 34 i ii CONTENTS 4 Performing calculations 37 4.1 Variables.............................. 37 4.2 Physical constants......................... 38 4.3 Functions.............................. 38 4.3.1 Spliced functions.................... 39 4.4 Handling numerical errors.................... 43 4.5 Working with complex numbers................. 44 4.6 Working with physical units................... 45 4.6.1 Treatment of angles in Pyxplot............ 47 4.6.2 Converting between different temperature scales... 48 4.7 Configuring how numbers are displayed............. 49 4.7.1 Display of physical units................ 49 4.7.2 Changing the accuracy to which numbers are displayed 51 4.7.3 Creating pastable text................. 52 4.8 Numerical integration and differentiation............ 52 4.9 Solving systems of equations................... 54 4.10 Searching for minima and maxima of functions......... 56 4.11 Working with time-series data.................. 58 4.11.1 Calendars........................ 62 4.11.2 Time intervals...................... 64 5 Working with data 67 5.1 Input filters............................ 67 5.2 Reading data from a pipe..................... 68 5.3 Including data within command scripts............. 68 5.4 Special comment lines in data files................ 69 5.5 Tabulating functions and slicing data files........... 69 5.6 Function fitting.......................... 71 5.7 Datafile interpolation....................... 73 5.7.1 Two-dimensional interpolation............. 75 5.8 Fourier transforms......................... 76 5.8.1 Window functions.................... 80 5.9 Histograms............................. 82 5.10 Random data generation..................... 83 6 Programming: Pyxplot's data types 87 6.1 Instantiating objects....................... 87 6.2 Strings............................... 89 6.2.1 The string substitution operator............ 90 6.2.2 Converting strings to numbers............. 91 6.2.3 Slicing strings...................... 92 6.2.4 String methods..................... 92 6.2.5 Regular expressions................... 93 6.3 Lists................................ 94 6.3.1 Using lists as stacks................... 95 6.3.2 Using lists as buffers.................. 95 6.3.3 Sorting lists....................... 96 6.3.4 Iterating over lists.................... 97 6.3.5 Calling functions with lists of arguments....... 98 6.3.6 List mapping and filtering............... 98 CONTENTS iii 6.3.7 Vectors versus lists................... 99 6.4 Dictionaries............................ 99 6.5 Vectors and matrices....................... 100 6.5.1 Dot and cross products................. 101 6.5.2 Matrix algebra...................... 101 6.5.3 Plotting data from vectors............... 102 6.6 Colors............................... 102 6.6.1 Color representations of the electromagnetic spectrum 103 6.7 Dates................................ 103 6.8 Modules and classes........................ 106 6.9 File handles............................ 107 6.9.1 Storing data structures in text files.......... 109 7 Programming: flow control 111 7.1 Conditionals............................ 111 7.2 For loops.............................. 112 7.3 Foreach loops........................... 113 7.4 Foreach datum loops....................... 114 7.5 While and do loops........................ 115 7.6 The break and continue statements.............. 116 7.7 The conditional operator..................... 117 7.8 Subroutines............................ 117 7.9 Macros............................... 122 7.10 The exec command........................ 123 7.11 Assertions............................. 123 7.12 Raising exceptions......................... 123 7.13 Shell commands.......................... 124 7.14 Script watching: pyxplot watch................. 125 II Plotting and vector graphics 127 8 Plotting: a complete guide 129 8.1 The with modifier......................... 129 8.1.1 The palette....................... 132 8.1.2 Default settings..................... 133 8.2 Pyxplot's plot styles........................ 134 8.2.1 Lines and points..................... 134 8.2.2 Error bars........................ 137 8.2.3 Shaded regions..................... 138 8.2.4 Barcharts and histograms............... 138 8.2.5 Steps........................... 141 8.2.6 Arrows.......................... 141 8.2.7 Color maps, contour maps and surface plots..... 143 8.3 Labelling datapoints........................ 143 8.4 The style keyword........................ 144 8.5 Plotting functions in exotic styles................ 144 8.6 Plotting parametric functions.................. 145 8.6.1 Two-dimensional parametric surfaces......... 147 8.7 Graph legends........................... 151 iv CONTENTS 8.8 Configuring axes.......................... 152 8.8.1 Adding additional axes................. 152 8.8.2 Selecting which axes to plot against.......... 153 8.8.3 Plotting quantities with physical units........ 153 8.8.4 Specifying the positioning of axes........... 154 8.8.5 Configuring the appearance of axes.......... 154 8.8.6 Setting the color of axes................ 156 8.8.7 Specifying where ticks should appear along axes... 157 8.8.8 Configuring how tick marks are labelled....... 159 8.8.9 Linked axes....................... 161 8.9 Gridlines.............................. 164 8.10 Clipping behaviour........................ 165 8.11 Labelling graphs.......................... 165 8.11.1 Arrows.......................... 165 8.11.2 Text labels........................ 166 8.12 Color maps............................. 171 8.12.1 Custom color mappings................. 173 8.12.2 Color scale bars..................... 178 8.13 Contour maps........................... 180 8.14 Three-dimensional plotting.................... 182 8.14.1 Surface plotting..................... 183 9 Producing image files 187 9.1 The set terminal command.................. 187 9.1.1 Previewing graphs on the screen............ 187 9.1.2 Producing images on disk............... 189 9.1.3 The complete syntax of the set terminal command 189 9.2 The default terminal....................... 191 9.3 PostScript output......................... 191 9.3.1 Paper sizes........................ 191 9.4 Backing up over-written files................... 191 9.5 Changing font........................... 192 10 Producing vector graphics 193 10.1 Adding other vector graphics objects.............. 193 10.2 Multiplot mode.......................... 194 10.3 The text command........................ 194 10.4 The arrow and line commands................. 195 10.5 Editing items on the canvas................... 197 10.5.1 Settings associated with multiplot items....... 197 10.5.2 Reordering multiplot items............... 198 10.5.3 The construction of large multiplots.......... 198 10.6 Linked axes and galleries of plots................ 202 10.6.1 The replot command revisited............ 204 10.7 The polygon command...................... 204 10.8 The image command....................... 206 10.9 The eps command......................... 207 10.10 The box and circle commands................. 207 10.11 The arc command......................... 208 10.12 The point command....................... 212 CONTENTS v 10.13 The ellipse command...................... 212 10.14 The piechart command..................... 214 10.15 LaTeX and Pyxplot........................ 217 III Reference manual 219 11 Command reference

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    422 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us