Skip to content

Commit 4a82ece

Browse files
committed
better plot
1 parent 25cda91 commit 4a82ece

File tree

3 files changed

+6103
-62
lines changed

3 files changed

+6103
-62
lines changed

README.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,45 @@ Build artifacts by specifying a Makefile.
6161
6262
![](fig/plot.svg)
6363
64-
=== "Makefile"
64+
=== "Source"
65+
66+
``` {.gnuplot file=examples/plot.gp}
67+
# enter your plotting commands here
68+
```
6569
6670
``` {.make .build-artifact}
6771
.RECIPEPREFIX = >
6872
69-
docs/fig/plot.svg:
73+
docs/fig/plot.svg: examples/plot.gp
7074
> mkdir -p $(@D)
71-
> gnuplot -e "set term svg; plot sin(x)" > $@
75+
> gnuplot $^ > $@
7276
```
7377
~~~
7478

7579
=== "Figure 1"
7680

7781
![](fig/plot.svg)
7882

79-
=== "Makefile"
83+
=== "Source"
84+
85+
``` {.gnuplot file=examples/plot.gp}
86+
set term svg background rgb 'white' size 700, 500
87+
sinc(r) = sin(pi*r) / (pi*r)
88+
set isosamples 50, 50
89+
set hidden3d
90+
set xrange [-4:4]
91+
set yrange [-4:4]
92+
set xyplane 0
93+
set title "Sinc function"
94+
splot sinc(sqrt(x**2 + y**2)) t'' lc rgb '#5533cc'
95+
```
8096

8197
``` {.make .build-artifact}
8298
.RECIPEPREFIX = >
8399

84-
docs/fig/plot.svg:
100+
docs/fig/plot.svg: examples/plot.gp
85101
> mkdir -p $(@D)
86-
> gnuplot -e "set term svg; plot sin(x)" > $@
102+
> gnuplot $^ > $@
87103
```
88104

89105
## License

0 commit comments

Comments
 (0)