In [1]:
using Gadfly


Warning: could not import Base.foldl into NumericExtensions
Warning: could not import Base.foldr into NumericExtensions
Warning: could not import Base.sum! into NumericExtensions
Warning: could not import Base.maximum! into NumericExtensions
Warning: could not import Base.minimum! into NumericExtensions
Warning: New definition 
    concrete_minmax(DataArray{TA,N},T,T) at /Users/roberto/.julia/v0.2/Gadfly/src/misc.jl:149
is ambiguous with: 
    concrete_minmax(Any,T<:Real,T<:Real) at /Users/roberto/.julia/v0.2/Gadfly/src/misc.jl:100.
To fix, define 
    concrete_minmax(DataArray{TA,N},T,T)
before the new definition.

In [ ]:
plot(x=rand(4),y=rand(4))

In [5]:
plot([sin, cos], 0, 25)


Out[5]:
x -30 -25 -20 -15 -10 -5 0 5 10 15 20 25 30 35 40 45 50 55 -25 -24 -23 -22 -21 -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 -25 0 25 50 -26 -24 -22 -20 -18 -16 -14 -12 -10 -8 -6 -4 -2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 f2 f1 Color -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 -3.0 -2.9 -2.8 -2.7 -2.6 -2.5 -2.4 -2.3 -2.2 -2.1 -2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 -4 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9 8.0 0 2 4 6 8 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 y

In [3]:
using Processing
@Processing.version "2D"
@Processing.load

coordSystem(-1, 1, 1, -1) # user-defined coordinate system (x-axis min = -1,
						  # x-axis max = 1, y-axis min = -1, y-axis max = 1,
						  # xcent = 0, ycent = 0)
						  #
						  # I can just think easier this way...
						  #
						  # default coordinate system is in units of pixels with
						  # top-left corner of drawing surface labeled (0,0),
						  # just like Processing's default coordinate system
smooth()

ellipse(0,0,0.3,0.5)
ellipse(-.5,.5,0.2,0.2)
triangle(.3, .75, .58, .20, .86, .75)
triangle(.3, .6, .58, .40, .86, .7)
point(0, 0)
fill(1,0,0,1)
quad(-.3, -.75, -.58, -.20, -.86, -.75, -.2, -.4)
noFill()
rect(-.6, -.6, .2, .5)
line(.5, -.4, .7, -.5)
line(.7, -.4, .5, -.5)
strokeWeight(1)
stroke(0.9, 0, 0, 1)
arc(-.6, .6, .3, .3, 0.4pi, pi, CHORD)
animate()

x = 0
while true
	fill(sin(x)/2+0.5,cos(x)/2+0.5,(sin(x)*cos(x))/2+0.5,1)
	ellipse(0,0,0.2,0.2)
	point(0, 0)
	animate()
	x = x + 0.01
	if mousePressed()
		println("mouse pressed")
	end
end


no method stateStruct(RGB,Bool,RGB,Bool,RGB,Int64,Int64,Float64,Float64,Float64,Float64,ASCIIString,ASCIIString,Bool,Int64,Int64,Int64,Int64,Int64,Int64,Bool,Bool,Bool,Bool,Bool,Bool,Bool)
at /Users/roberto/.julia/v0.2/Processing/src/Processing2D.jl:108
at In[3]:14
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in eval at no file

In [1]:
l = [1,2,3]


Out[1]:
3-element Array{Int64,1}:
 1
 2
 3

In [2]:
k = [4,5,6]


Out[2]:
3-element Array{Int64,1}:
 4
 5
 6

In [3]:
dot(l,k)


Out[3]:
32

In [4]:
lk


Out[4]:
32

In [5]:
α = 20


Out[5]:
20

In [8]:
α(lk)


Out[8]:
640

In [ ]: