Skip to content

Commit e8d612c

Browse files
authored
Plotting chapter addition (algorithm-archivists#622)
* adding structure for plotting section * Adding more plots to plotting chapter and removing projections chapter updating gitignore, prepping for trip * adding gnupot pots and working on file oputput with gnuplot. * adding a paragraph in a pseudo-merge * finalizing tex output for gnuplot. now for data input * adding data files for plotting from file section. * rearranging chapter and incorporating scatterplot into main chapter. * adding scatterplot to plotting chapter. * adding logscale plot and fixing typos * adding revised plotting chapter. * adding scatterplot_data.dat * adding documentation links in the plotting chapter
1 parent e1c1d7c commit e8d612c

35 files changed

+961
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,5 @@ __pycache__/
509509
# Settings directory for visual studio code
510510
vscode/
511511

512+
# Data file extension for Algorithm Archive
513+
*.dat

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* [Algorithm Archive](README.md)
44
* [Introduction](contents/introduction/introduction.md)
55
* [How To Contribute](contents/how_to_contribute/how_to_contribute.md)
6+
* [Plotting](contents/plotting/plotting.md)
67
* [Data Structures](contents/data_structures/data_structures.md)
78
* [Stacks and Queues](contents/stacks_and_queues/stacks_and_queues.md)
89
* [Mathematical Background](contents/mathematical_background/mathematical_background.md)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set terminal epslatex standalone size 12cm, 8cm
2+
set output "out.tex"
3+
4+
p exp(x)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
\documentclass[11pt]{article}
2+
3+
\usepackage{gnuplottex}
4+
\begin{document}
5+
6+
\input{out}
7+
8+
\end{document}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plot sin(x) with lines
2+
replot cos(x) with lines
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set terminal pngcairo size 640, 480
2+
set output "sine_cosine_plot.png"
3+
set xrange [0:10]
4+
set yrange [0:1]
5+
set logscale x
6+
set logscale y
7+
set key at 1,0.5
8+
set title "Gnuplot Test"
9+
set size square
10+
11+
plot sin(x) with lines dashtype 2 linecolor rgb "black" title "sin(x)", \
12+
cos(x) w p pt 17 lc rgb "purple" t "cos(x)"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
0.06279051952931337
2+
0.12533323356430426
3+
0.1873813145857246
4+
0.2486898871648548
5+
0.3090169943749474
6+
0.3681245526846779
7+
0.42577929156507266
8+
0.4817536741017153
9+
0.5358267949789967
10+
0.5877852522924731
11+
0.6374239897486896
12+
0.6845471059286886
13+
0.7289686274214116
14+
0.7705132427757893
15+
0.8090169943749473
16+
0.8443279255020151
17+
0.8763066800438637
18+
0.9048270524660196
19+
0.9297764858882513
20+
0.9510565162951535
21+
0.9685831611286311
22+
0.9822872507286886
23+
0.9921147013144778
24+
0.9980267284282716
25+
1.0
26+
0.9980267284282716
27+
0.9921147013144779
28+
0.9822872507286887
29+
0.9685831611286311
30+
0.9510565162951536
31+
0.9297764858882515
32+
0.9048270524660195
33+
0.8763066800438635
34+
0.844327925502015
35+
0.8090169943749475
36+
0.7705132427757893
37+
0.7289686274214114
38+
0.6845471059286888
39+
0.6374239897486899
40+
0.5877852522924732
41+
0.535826794978997
42+
0.4817536741017152
43+
0.4257792915650729
44+
0.36812455268467814
45+
0.3090169943749475
46+
0.24868988716485524
47+
0.18738131458572457
48+
0.12533323356430454
49+
0.06279051952931358
50+
1.2246467991473532e-16
51+
-0.06279051952931335
52+
-0.12533323356430429
53+
-0.18738131458572477
54+
-0.24868988716485457
55+
-0.3090169943749473
56+
-0.3681245526846779
57+
-0.42577929156507227
58+
-0.4817536741017154
59+
-0.5358267949789964
60+
-0.5877852522924727
61+
-0.6374239897486896
62+
-0.6845471059286884
63+
-0.7289686274214116
64+
-0.7705132427757894
65+
-0.8090169943749473
66+
-0.8443279255020153
67+
-0.8763066800438636
68+
-0.9048270524660198
69+
-0.9297764858882515
70+
-0.9510565162951535
71+
-0.9685831611286312
72+
-0.9822872507286887
73+
-0.9921147013144778
74+
-0.9980267284282716
75+
-1.0
76+
-0.9980267284282716
77+
-0.9921147013144779
78+
-0.9822872507286887
79+
-0.9685831611286311
80+
-0.9510565162951536
81+
-0.9297764858882516
82+
-0.9048270524660199
83+
-0.8763066800438634
84+
-0.844327925502015
85+
-0.8090169943749476
86+
-0.7705132427757896
87+
-0.7289686274214121
88+
-0.684547105928689
89+
-0.6374239897486896
90+
-0.5877852522924734
91+
-0.5358267949789971
92+
-0.4817536741017161
93+
-0.425779291565073
94+
-0.36812455268467786
95+
-0.3090169943749476
96+
-0.24868988716485535
97+
-0.18738131458572468
98+
-0.12533323356430465
99+
-0.06279051952931326
100+
-2.4492935982947064e-16
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
0.5877852522924731
2+
0.9510565162951535
3+
0.9510565162951536
4+
0.5877852522924732
5+
1.2246467991473532e-16
6+
-0.587785252292473
7+
-0.9510565162951535
8+
-0.9510565162951536
9+
-0.5877852522924734
10+
-2.4492935982947064e-16

contents/plotting/data/2d_sample_data.dat

Lines changed: 100 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
1.0 2.0 3.0
2+
4.0 5.0 6.0
3+
7.0 8.0 9.0

0 commit comments

Comments
 (0)