mirror of https://github.com/mpastell/Weave.jl
176 lines
4.8 KiB
Markdown
176 lines
4.8 KiB
Markdown
|
|
|
|
# Gadfly
|
|
|
|
````julia
|
|
julia> using Gadfly
|
|
|
|
julia> x = linspace(0, 2π, 200)
|
|
200-element Array{Float64,1}:
|
|
0.0
|
|
0.0315738
|
|
0.0631476
|
|
0.0947214
|
|
0.126295
|
|
0.157869
|
|
0.189443
|
|
0.221017
|
|
0.25259
|
|
0.284164
|
|
⋮
|
|
6.03059
|
|
6.06217
|
|
6.09374
|
|
6.12532
|
|
6.15689
|
|
6.18846
|
|
6.22004
|
|
6.25161
|
|
6.28319
|
|
|
|
julia> plot(x=x, y = sin(x), Geom.line)
|
|
|
|
````
|
|
|
|
|
|
![](figures/gadfly_markdown_test_1_1.png)
|
|
|
|
|
|
````julia
|
|
julia> y = 20
|
|
20
|
|
|
|
julia> plot(x=x, y = cos(x), Geom.line)
|
|
|
|
````
|
|
|
|
|
|
![](figures/gadfly_markdown_test_1_2.png)
|
|
|
|
|
|
|
|
|
|
|
|
````julia
|
|
x = linspace(0, 200)
|
|
println(x)
|
|
````
|
|
|
|
|
|
````julia
|
|
[0.0,2.0202020202020203,4.040404040404041,6.0606060606060606,8.080808080808
|
|
081,10.1010101010101,12.121212121212121,14.14141414141414,16.16161616161616
|
|
3,18.181818181818183,20.2020202020202,22.22222222222222,24.242424242424242,
|
|
26.262626262626267,28.28282828282828,30.303030303030305,32.323232323232325,
|
|
34.34343434343434,36.36363636363637,38.38383838383838,40.4040404040404,42.4
|
|
2424242424242,44.44444444444444,46.464646464646464,48.484848484848484,50.50
|
|
5050505050505,52.52525252525253,54.54545454545454,56.56565656565656,58.5858
|
|
5858585859,60.60606060606061,62.62626262626263,64.64646464646465,66.6666666
|
|
6666666,68.68686868686868,70.70707070707071,72.72727272727273,74.7474747474
|
|
7475,76.76767676767676,78.78787878787878,80.8080808080808,82.82828282828282
|
|
,84.84848484848484,86.86868686868688,88.88888888888889,90.9090909090909,92.
|
|
92929292929293,94.94949494949495,96.96969696969697,98.98989898989899,101.01
|
|
010101010101,103.03030303030303,105.05050505050507,107.07070707070707,109.0
|
|
9090909090908,111.11111111111111,113.13131313131312,115.15151515151516,117.
|
|
17171717171718,119.19191919191918,121.21212121212122,123.23232323232322,125
|
|
.25252525252526,127.27272727272727,129.2929292929293,131.31313131313132,133
|
|
.33333333333331,135.35353535353536,137.37373737373736,139.3939393939394,141
|
|
.41414141414143,143.43434343434342,145.45454545454547,147.47474747474746,14
|
|
9.4949494949495,151.5151515151515,153.53535353535352,155.55555555555557,157
|
|
.57575757575756,159.5959595959596,161.6161616161616,163.63636363636365,165.
|
|
65656565656565,167.67676767676767,169.6969696969697,171.7171717171717,173.7
|
|
3737373737376,175.75757575757575,177.77777777777777,179.7979797979798,181.8
|
|
181818181818,183.83838383838383,185.85858585858585,187.87878787878788,189.8
|
|
989898989899,191.91919191919192,193.93939393939394,195.95959595959596,197.9
|
|
7979797979798,200.0]
|
|
````
|
|
|
|
|
|
|
|
|
|
|
|
|
|
````julia
|
|
julia> using Gadfly
|
|
|
|
julia> x = linspace(0, 2π, 200)
|
|
200-element Array{Float64,1}:
|
|
0.0
|
|
0.0315738
|
|
0.0631476
|
|
0.0947214
|
|
0.126295
|
|
0.157869
|
|
0.189443
|
|
0.221017
|
|
0.25259
|
|
0.284164
|
|
⋮
|
|
6.03059
|
|
6.06217
|
|
6.09374
|
|
6.12532
|
|
6.15689
|
|
6.18846
|
|
6.22004
|
|
6.25161
|
|
6.28319
|
|
|
|
julia> plot(x=x, y = sin(x), Geom.line)
|
|
|
|
````
|
|
|
|
|
|
![](figures/gadfly_markdown_test_3_1.png)
|
|
|
|
|
|
````julia
|
|
julia> y = 20
|
|
20
|
|
|
|
julia> plot(x=x, y = cos(x), Geom.line)
|
|
|
|
````
|
|
|
|
|
|
![](figures/gadfly_markdown_test_3_2.png)
|
|
|
|
|
|
|
|
|
|
````julia
|
|
x = linspace(0, 200)
|
|
println(x)
|
|
````
|
|
|
|
|
|
````julia
|
|
[0.0,2.0202020202020203,4.040404040404041,6.0606060606060606,8.080808080808
|
|
081,10.1010101010101,12.121212121212121,14.14141414141414,16.16161616161616
|
|
3,18.181818181818183,20.2020202020202,22.22222222222222,24.242424242424242,
|
|
26.262626262626267,28.28282828282828,30.303030303030305,32.323232323232325,
|
|
34.34343434343434,36.36363636363637,38.38383838383838,40.4040404040404,42.4
|
|
2424242424242,44.44444444444444,46.464646464646464,48.484848484848484,50.50
|
|
5050505050505,52.52525252525253,54.54545454545454,56.56565656565656,58.5858
|
|
5858585859,60.60606060606061,62.62626262626263,64.64646464646465,66.6666666
|
|
6666666,68.68686868686868,70.70707070707071,72.72727272727273,74.7474747474
|
|
7475,76.76767676767676,78.78787878787878,80.8080808080808,82.82828282828282
|
|
,84.84848484848484,86.86868686868688,88.88888888888889,90.9090909090909,92.
|
|
92929292929293,94.94949494949495,96.96969696969697,98.98989898989899,101.01
|
|
010101010101,103.03030303030303,105.05050505050507,107.07070707070707,109.0
|
|
9090909090908,111.11111111111111,113.13131313131312,115.15151515151516,117.
|
|
17171717171718,119.19191919191918,121.21212121212122,123.23232323232322,125
|
|
.25252525252526,127.27272727272727,129.2929292929293,131.31313131313132,133
|
|
.33333333333331,135.35353535353536,137.37373737373736,139.3939393939394,141
|
|
.41414141414143,143.43434343434342,145.45454545454547,147.47474747474746,14
|
|
9.4949494949495,151.5151515151515,153.53535353535352,155.55555555555557,157
|
|
.57575757575756,159.5959595959596,161.6161616161616,163.63636363636365,165.
|
|
65656565656565,167.67676767676767,169.6969696969697,171.7171717171717,173.7
|
|
3737373737376,175.75757575757575,177.77777777777777,179.7979797979798,181.8
|
|
181818181818,183.83838383838383,185.85858585858585,187.87878787878788,189.8
|
|
989898989899,191.91919191919192,193.93939393939394,195.95959595959596,197.9
|
|
7979797979798,200.0]
|
|
````
|
|
|
|
|