# Examples¶

## Example 1¶

 x = linspace(0, 3pi, 100)
c = cos.(x)
s = sin.(x)

p = FramedPlot(
title="title!",
xlabel="\\Sigma x^2_i",
ylabel="\\Theta_i")



## Example 2¶

 p = FramedPlot(
aspect_ratio=1,
xrange=(0,100),
yrange=(0,100))

n = 21
x = linspace(0, 100, n)
yA = 40 .+ 10randn(n)
yB = x .+ 5randn(n)

a = Points(x, yA, kind="circle")
setattr(a, label="a points")

b = Points(x, yB)
setattr(b, label="b points")
style(b, kind="filled circle")

s = Slope(1, (0,0), kind="dotted")
setattr(s, label="slope")

l = Legend(.1, .9, [a,b,s])



## Example 3¶

 p = FramedPlot(
title="Title",
xlabel="X axis",
ylabel="Y axis")

t1 = Table(1, 2)
t1[1,1] = p
t1[1,2] = p

t2 = Table(2, 1)
t2[1,1] = t1
t2[2,1] = p


## Example 4¶

 x = linspace(0., 2pi, 40)
s = sin.(x)
c = cos.(x)

inset = FramedPlot(title="inset")
setattr(inset.frame, draw_ticks=false)

p = FramedPlot(aspect_ratio=1)
setattr(p.frame, tickdir=+1, draw_spine=false)



## Example 5¶

 x = linspace(pi, 3pi, 60)
c = cos.(x)
s = sin.(x)

p = FramedPlot(aspect_ratio=1)
setattr(p.frame1, draw_grid=true, tickdir=1)

setattr(p.x1, label="bottom", subticks=1)
setattr(p.y1, label="left", draw_spine=false)
setattr(p.x2, label="top", range=(10,1000), log=true)

setattr(p.y2, label="right", draw_ticks=false,
ticklabels=["-1", "-1/2", "0", "1/2", "1"])