diff options
author | sharkdp <davidpeter@web.de> | 2021-01-09 21:54:51 +0100 |
---|---|---|
committer | David Peter <sharkdp@users.noreply.github.com> | 2021-01-09 22:35:50 +0100 |
commit | 4c523af1ab4b0fdbb403ae31423bb6cf1dc7f65f (patch) | |
tree | b9a8ad8b153c4646990d2ed5cf7b4a568f1e1ac1 /tests | |
parent | c5c28eb05b89e8dc095da1593b63ea53862800c8 (diff) |
Add gnuplot syntax
closes #1431
Diffstat (limited to 'tests')
-rw-r--r-- | tests/syntax-tests/highlighted/gnuplot/test.gp | 19 | ||||
-rw-r--r-- | tests/syntax-tests/source/gnuplot/test.gp | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/syntax-tests/highlighted/gnuplot/test.gp b/tests/syntax-tests/highlighted/gnuplot/test.gp new file mode 100644 index 00000000..bb96f60d --- /dev/null +++ b/tests/syntax-tests/highlighted/gnuplot/test.gp @@ -0,0 +1,19 @@ +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114mterminal[0m[38;2;249;38;114m pngcairo enhanced[0m +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114moutput[0m[38;2;249;38;114m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m/tmp/polynomial.png[0m[38;2;230;219;116m"[0m + +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114mgrid[0m + +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114mxrange[0m[38;2;249;38;114m [0m[38;2;249;38;114m[[0m[38;2;190;132;255m-5[0m[38;2;249;38;114m:[0m[38;2;190;132;255m5[0m[38;2;249;38;114m][0m +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114myrange[0m[38;2;249;38;114m [0m[38;2;249;38;114m[[0m[38;2;190;132;255m-5[0m[38;2;249;38;114m:[0m[38;2;190;132;255m10[0m[38;2;249;38;114m][0m + +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114msamples[0m[38;2;249;38;114m [0m[38;2;190;132;255m10000[0m + +[38;2;249;38;114mset[0m[38;2;249;38;114m [0m[38;2;249;38;114mkey[0m[38;2;249;38;114m [0m[38;2;190;132;255mbottom[0m[38;2;249;38;114m [0m[38;2;190;132;255mright[0m + +[38;2;255;255;255mf[0m[38;2;248;248;242m(x) = [0m[38;2;190;132;255m1.0[0m[38;2;248;248;242m / [0m[38;2;190;132;255m14.0[0m[38;2;248;248;242m * ((x+[0m[38;2;190;132;255m4[0m[38;2;248;248;242m) * (x+[0m[38;2;190;132;255m1[0m[38;2;248;248;242m) * (x[0m[38;2;190;132;255m-1[0m[38;2;248;248;242m) * (x[0m[38;2;190;132;255m-3[0m[38;2;248;248;242m)) + [0m[38;2;190;132;255m0.5[0m + +[38;2;249;38;114mplot[0m[38;2;248;248;242m \[0m +[38;2;248;248;242m [0m[38;2;255;255;255mf[0m[38;2;248;248;242m(x) [0m[38;2;190;132;255mtitle[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mpolynomial of degree 4[0m[38;2;230;219;116m"[0m[38;2;248;248;242m \[0m +[38;2;248;248;242m [0m[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;249;38;114mlines[0m[38;2;248;248;242m \[0m +[38;2;248;248;242m [0m[38;2;190;132;255mlinewidth[0m[38;2;248;248;242m [0m[38;2;190;132;255m2[0m[38;2;248;248;242m \[0m +[38;2;248;248;242m [0m[38;2;190;132;255mlinetype[0m[38;2;248;248;242m rgb [0m[38;2;230;219;116m'[0m[38;2;230;219;116m#0077ff[0m[38;2;230;219;116m'[0m diff --git a/tests/syntax-tests/source/gnuplot/test.gp b/tests/syntax-tests/source/gnuplot/test.gp new file mode 100644 index 00000000..411cf134 --- /dev/null +++ b/tests/syntax-tests/source/gnuplot/test.gp @@ -0,0 +1,19 @@ +set terminal pngcairo enhanced +set output "/tmp/polynomial.png" + +set grid + +set xrange [-5:5] +set yrange [-5:10] + +set samples 10000 + +set key bottom right + +f(x) = 1.0 / 14.0 * ((x+4) * (x+1) * (x-1) * (x-3)) + 0.5 + +plot \ + f(x) title "polynomial of degree 4" \ + with lines \ + linewidth 2 \ + linetype rgb '#0077ff' |