Skip to content

Commit e8d612c

Browse files
authored
Plotting chapter addition (#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

Diff for: .gitignore

+2
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

Diff for: SUMMARY.md

+1
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)

Diff for: contents/plotting/code/gnuplot/example_tex.gp

+4
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)

Diff for: contents/plotting/code/gnuplot/latex_import.tex

+8
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}

Diff for: contents/plotting/code/gnuplot/sine.gp

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plot sin(x) with lines
2+
replot cos(x) with lines

Diff for: contents/plotting/code/gnuplot/sine_to_file.gp

+12
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)"

Diff for: contents/plotting/data/1d_sample_data.dat

+100
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

Diff for: contents/plotting/data/1d_sample_low_res.dat

+10
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

Diff for: contents/plotting/data/2d_sample_data.dat

+100
Large diffs are not rendered by default.

Diff for: contents/plotting/data/2d_sample_low_res.dat

+3
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

Diff for: contents/plotting/data/scatterplot_data.dat

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
0.7972009737623846 0.3548405553754319
2+
0.8661873069668018 0.13307711243511333
3+
0.7605752608745506 0.8686860241215444
4+
0.7796784902862803 0.35589625594005647
5+
0.23842162678327328 0.18541942067815853
6+
0.23648916187439406 0.6351126027850458
7+
0.6075688534409027 0.789554555806735
8+
0.361307926046027 0.6338943724188091
9+
0.3692102429804389 0.40610861857701597
10+
0.30699091691896263 0.27999628668153087
11+
0.3576274997561899 0.3424136116636338
12+
0.49939254069352956 0.17342363033854724
13+
0.3757807212407509 0.23691987574604734
14+
0.0473471879739189 0.24960280817550107
15+
0.9594610126549095 0.08829550604670633
16+
0.6234317458171774 0.4289509153384199
17+
0.9022776991397023 0.4110342819077373
18+
0.9442056062211033 0.7753816391205892
19+
0.670835966396536 0.27623047190098915
20+
0.7963592117227156 0.14752773871465585
21+
0.7577858033857463 0.3954810649398204
22+
0.7179758399543221 0.8615745521978004
23+
0.29899457073349933 0.30236705276428477
24+
0.5777934047067612 0.1370795488116856
25+
0.1975357457596858 0.5150704143012881
26+
0.7176087867346745 0.34085277391279
27+
0.9810920181632499 0.6770668303599698
28+
0.9441468382016291 0.1410518836798671
29+
0.1542701855112465 0.7525774829035234
30+
0.053499143946586836 0.9881695630817837
31+
0.05964520406617435 0.3502740385876988
32+
0.2657073917133219 0.8790420984424512
33+
0.11923901607442366 0.23398631434739792
34+
0.7970864911912654 0.0997755110357803
35+
0.6773637174266158 0.19750744136026688
36+
0.6368734388080566 0.3175312327486055
37+
0.8187889334854561 0.4769968274296357
38+
0.23821720130139346 0.9967727408296512
39+
0.9017396106078186 0.3511302712184545
40+
0.43307539381872173 0.34609744898122297
41+
0.05034970801188954 0.5209330920203943
42+
0.5588459892542543 0.08875143519294015
43+
0.9626181947001171 0.6230716490904487
44+
0.33201747771346524 0.32158253196418074
45+
0.9179571651752263 0.07515706718318294
46+
0.44941219128444665 0.3661259470819096
47+
0.7817847863401477 0.49744369856004855
48+
0.9828473884175235 0.6150385686543078
49+
0.5494688561727186 0.46711235096998727
50+
0.5305380388480687 0.1239910430681963
51+
0.9167500030828619 0.7981392230594806
52+
0.7971090036526693 0.15874956874851276
53+
0.25472040384215044 0.5602438443187836
54+
0.927880708095218 0.21846539798758502
55+
0.8555367569382548 0.8285210913893313
56+
0.307956137316012 0.4824303203479099
57+
0.13337222938117232 0.7013200725029511
58+
0.13629952204381945 0.11804128588027796
59+
0.39021396380467177 0.055561565062783425
60+
0.08304592584781356 0.6739703670516985
61+
0.8683062683723772 0.9969863055259214
62+
0.5444401111818664 0.4366532159364429
63+
0.7788453978832244 0.08670454545216133
64+
0.532115341765985 0.22536749650764776
65+
0.56694490422404 0.42961451455537025
66+
0.09977595487454094 0.1093670138718339
67+
0.8248320086337768 0.27585059438321524
68+
0.06907123973446772 0.289132140946887
69+
0.009232756609561132 0.13089894315512907
70+
0.4137028330926831 0.48900424960494693
71+
0.6183560078084898 0.404193475266053
72+
0.1246970668355063 0.5664026154589128
73+
0.3754323405614832 0.37997036733718303
74+
0.43890957129051733 0.24395939159427682
75+
0.15154067187327258 0.11624373967939094
76+
0.2762634862770077 0.5611718115783499
77+
0.0633974595073914 0.4588957603865418
78+
0.16382631207305076 0.40403101255866636
79+
0.15639790244241447 0.10094904501994262
80+
0.3718175201117897 0.6532121049891211
81+
0.7417743191659067 0.9207777779848563
82+
0.536767342945706 0.7618237961885344
83+
0.6292658506048447 0.003741117257125781
84+
0.686422372246446 0.5286091525166754
85+
0.7305900823768021 0.304738530937986
86+
0.8556138493329699 0.48279503370029
87+
0.06899995640578749 0.16198476377928994
88+
0.3110129951845655 0.5986484770470173
89+
0.5857767079544498 0.403065968147873
90+
0.5448664909171652 0.5806854884443069
91+
0.23276884501773165 0.9727237795445616
92+
0.4822650252554159 0.7810870575465758
93+
0.6361739695987663 0.18798984644168426
94+
0.4833892568071845 0.5481015971602836
95+
0.304642918787009 0.7894134085042763
96+
0.9900865909644034 0.9453557641155395
97+
0.7949961655478377 0.4164404911088764
98+
0.7221396623906693 0.6209655769541615
99+
0.7566834157262134 0.30657353218231886
100+
0.7249362226862976 0.5803937320597572

0 commit comments

Comments
 (0)