Skip to content

Commit

Permalink
Added jpg output.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbaldridge committed Nov 26, 2015
1 parent e5008cc commit cf90c96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions simdata/plot_hyperplane.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ filename = "linear_data_train"
data = read.table(paste(filename,".csv",sep=''),header=F,sep=',')
colnames(data) = c("label","x","y")

#jpeg("linear_data_hyperplane.jpg")
plot(data[,c("x","y")],pch=21,bg=c("orange","blue")[data[,"label"]+1],xlim=c(-.25,1),ylim=c(-.25,1))
abline(h=0,lty=2)
abline(v=0,lty=2)
Expand All @@ -13,3 +14,4 @@ b = 1.57296884
slope = -1*(w0/w1)
intercept = -1*(b/w1)
abline(coef=c(intercept,slope),lwd=3)
#dev.off()

0 comments on commit cf90c96

Please sign in to comment.