Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

cubic+Bezier.sh 845 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  1. #!/usr/bin/env bash
  2. # Compare cubic spline and Bezier line
  3. ps=cubic+Bezier.ps
  4. cat << EOF > t.txt
  5. 0 0
  6. 1 1
  7. 2 1.5
  8. 3 1.25
  9. 4 1.5
  10. 4.5 3
  11. 5 2
  12. 6 2.5
  13. EOF
  14. # Plot using Bezier scheme
  15. gmt psxy -R-0.1/6.1/-0.1/3.1 -JX6i/3i -P t.txt -W1p+s -Baf -BWSne -K -Y0.75i -Xc > $ps
  16. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gblue -Wthin >> $ps
  17. # Plot using regular sample1d scheme
  18. gmt sample1d t.txt -S0/6 -I0.01 -Fc | gmt psxy -R-0.1/6.1/-0.1/3.1 -J -O -Bafg -BWsne -W1p -K -Y3.2i >> $ps
  19. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gblue -Wthin >> $ps
  20. # Compare cubic sspline and Bezier
  21. gmt sample1d t.txt -S0/6 -I0.01 -Fc | gmt psxy -R-0.1/6.1/-0.1/3.1 -J -O -Bafg -BWsne -Wfaint,black -K -Y3.2i >> $ps
  22. gmt psxy -R -J -O -K t.txt -Wfaint,red+s >> $ps
  23. gmt psxy -R -J -O -K t.txt -Sc0.1i -Gblue -Wthin >> $ps
  24. gmt psxy -R -J -O -T >> $ps
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...