Before we start to draw a picture, we need to know how the gnuplot expresses the mathematical formula.
-
- Addition, subtraction, multiplication, division, multiplication
Use+,-,*,/,**Indicates
-
- Integer and floating point number
Similar to the C language, gnuplot treats integers and floating-point numbers (real numbers) differently. The integer calculation result is still an integer. Therefore, be especially careful when Processing Integer Division. For example, the result of 7/2 is 3 instead of 3.5.
-
- Plural
Gnuplot supports plural operations. The plural values are represented by a pair of real numbers contained in curly brackets. For example:{3, 5}3 + 5I
-
- Mathematical functions
Gnuplot has rich mathematical functions in almost the same format as the C language. Function names are the same for real numbers and plural numbers. The following link shows the list of predefined functions:
Http://www.gnuplot.info/docs_4.2/gnuplot.html#x1-5300013.1
-
- Custom Functions
User-Defined Functions are easy, suchF (x) = x + 1Define a mona1 function,F (x, y) = x + yDefines a binary function.
- π (circumference rate)
π is used in gnuplotPi.
Here are some examples:
Here we usePrintCommand is to output the result to the screen.
With this knowledge, we can start drawing.