Showing posts with label Plot (graphics). Show all posts
Showing posts with label Plot (graphics). Show all posts

Saturday, October 29, 2016

MacOS Sierra: Installing wisp (Wisp Is Scala Plotting) Console-centric Plotting Library for Scala

Command:

$ git clone https://github.com/quantifind/wisp.git


Result:

Cloning into 'wisp'...
remote: Counting objects: 1470, done.
remote: Total 1470 (delta 0), reused 0 (delta 0), pack-reused 1470
Receiving objects: 100% (1470/1470), 423.22 KiB | 382.00 KiB/s, done.
Resolving deltas: 100% (521/521), done.


Command:

$ cd wisp
$ sbt 'project wisp' coonsole


Result:

[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[error] Not a valid command: coonsole
[error] Not a valid project ID: coonsole
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: coonsole (similar: console, consoleQuick, console-quick)
[error] coonsole
[error]         ^
photino:wisp USERNAME$ sbt 'project wisp' console
[info] Loading project definition from /Users/USERNAME/wisp/project
[info] Set current project to default-e392df (in build file:/Users/USERNAME/wisp/)
[info] Set current project to Wisp (in build file:/Users/USERNAME/wisp/)
[info] Updating {file:/Users/USERNAME/wisp/}wisp...
[info] Resolving org.sonatype.oss#oss-parent;7 ...
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-library;2.11.6!scala-library.jar (9714ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-jackson_2.11/3.2.10/json4s-jackson_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-jackson_2.11;3.2.10!json4s-jackson_2.11.jar (516ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-filter_2.11/0.8.3/unfiltered-filter_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-filter_2.11;0.8.3!unfiltered-filter_2.11.jar (573ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-jetty_2.11/0.8.3/unfiltered-jetty_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-jetty_2.11;0.8.3!unfiltered-jetty_2.11.jar (541ms)
[info] downloading http://repo1.maven.org/maven2/com/quantifind/sumac_2.11/0.3.0/sumac_2.11-0.3.0.jar ...
[info] [SUCCESSFUL ] com.quantifind#sumac_2.11;0.3.0!sumac_2.11.jar (637ms)
[info] downloading http://repo1.maven.org/maven2/org/apache/commons/commons-math3/3.4.1/commons-math3-3.4.1.jar ...
[info] [SUCCESSFUL ] org.apache.commons#commons-math3;3.4.1!commons-math3.jar (1566ms)
[info] downloading http://repo1.maven.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.jar ...
[info] [SUCCESSFUL ] commons-io#commons-io;2.4!commons-io.jar (560ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-core_2.11/3.2.10/json4s-core_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-core_2.11;3.2.10!json4s-core_2.11.jar (720ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.3.1/jackson-databind-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-databind;2.3.1!jackson-databind.jar(bundle) (824ms)
[info] downloading http://repo1.maven.org/maven2/org/json4s/json4s-ast_2.11/3.2.10/json4s-ast_2.11-3.2.10.jar ...
[info] [SUCCESSFUL ] org.json4s#json4s-ast_2.11;3.2.10!json4s-ast_2.11.jar (517ms)
[info] downloading http://repo1.maven.org/maven2/com/thoughtworks/paranamer/paranamer/2.6/paranamer-2.6.jar ...
[info] [SUCCESSFUL ] com.thoughtworks.paranamer#paranamer;2.6!paranamer.jar (503ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scalap/2.11.0/scalap-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scalap;2.11.0!scalap.jar (829ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.0/scala-compiler-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.0!scala-compiler.jar (5789ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.0/scala-reflect-2.11.0.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.0!scala-reflect.jar (2677ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.1/scala-xml_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.1!scala-xml_2.11.jar(bundle) (783ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.1/scala-parser-combinators_2.11-1.0.1.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.1!scala-parser-combinators_2.11.jar(bundle) (645ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.3.0/jackson-annotations-2.3.0.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-annotations;2.3.0!jackson-annotations.jar(bundle) (511ms)
[info] downloading http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/2.3.1/jackson-core-2.3.1.jar ...
[info] [SUCCESSFUL ] com.fasterxml.jackson.core#jackson-core;2.3.1!jackson-core.jar(bundle) (558ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered_2.11/0.8.3/unfiltered_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered_2.11;0.8.3!unfiltered_2.11.jar (793ms)
[info] downloading http://repo1.maven.org/maven2/net/databinder/unfiltered-util_2.11/0.8.3/unfiltered-util_2.11-0.8.3.jar ...
[info] [SUCCESSFUL ] net.databinder#unfiltered-util_2.11;0.8.3!unfiltered-util_2.11.jar (511ms)
[info] downloading http://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar ...
[info] [SUCCESSFUL ] commons-codec#commons-codec;1.4!commons-codec.jar (515ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-webapp/8.1.13.v20130916/jetty-webapp-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-webapp;8.1.13.v20130916!jetty-webapp.jar (531ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-xml/8.1.13.v20130916/jetty-xml-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-xml;8.1.13.v20130916!jetty-xml.jar (510ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-servlet/8.1.13.v20130916/jetty-servlet-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-servlet;8.1.13.v20130916!jetty-servlet.jar (532ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-util/8.1.13.v20130916/jetty-util-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-util;8.1.13.v20130916!jetty-util.jar (589ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-security/8.1.13.v20130916/jetty-security-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-security;8.1.13.v20130916!jetty-security.jar (527ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/8.1.13.v20130916/jetty-server-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-server;8.1.13.v20130916!jetty-server.jar (606ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty.orbit#javax.servlet;3.0.0.v201112011016!javax.servlet.jar(orbit) (567ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-continuation/8.1.13.v20130916/jetty-continuation-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-continuation;8.1.13.v20130916!jetty-continuation.jar (501ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-http/8.1.13.v20130916/jetty-http-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-http;8.1.13.v20130916!jetty-http.jar (530ms)
[info] downloading http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-io/8.1.13.v20130916/jetty-io-8.1.13.v20130916.jar ...
[info] [SUCCESSFUL ] org.eclipse.jetty#jetty-io;8.1.13.v20130916!jetty-io.jar (529ms)
[info] downloading http://repo1.maven.org/maven2/org/scalatest/scalatest_2.11/2.2.1/scalatest_2.11-2.2.1.jar ...
[info] [SUCCESSFUL ] org.scalatest#scalatest_2.11;2.2.1!scalatest_2.11.jar(bundle) (3044ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.2/scala-reflect-2.11.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.2!scala-reflect.jar (2710ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.2!scala-xml_2.11.jar(bundle) (945ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.11.6/scala-compiler-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-compiler;2.11.6!scala-compiler.jar (9882ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.11.6/scala-reflect-2.11.6.jar ...
[info] [SUCCESSFUL ] org.scala-lang#scala-reflect;2.11.6!scala-reflect.jar (2726ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-xml_2.11/1.0.3/scala-xml_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-xml_2.11;1.0.3!scala-xml_2.11.jar(bundle) (792ms)
[info] downloading http://repo1.maven.org/maven2/org/scala-lang/modules/scala-parser-combinators_2.11/1.0.3/scala-parser-combinators_2.11-1.0.3.jar ...
[info] [SUCCESSFUL ] org.scala-lang.modules#scala-parser-combinators_2.11;1.0.3!scala-parser-combinators_2.11.jar(bundle) (685ms)
[info] downloading http://repo1.maven.org/maven2/jline/jline/2.12.1/jline-2.12.1.jar ...
[info] [SUCCESSFUL ] jline#jline;2.12.1!jline.jar (575ms)
[info] Done updating.
[info] Compiling 14 Scala sources to /Users/USERNAME/wisp/core/target/scala-2.11/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.11.6. Compiling...
[info]   Compilation completed in 6.847 s
[warn] there were 9 feature warnings; re-run with -feature for details
[warn] there was one inliner warning; re-run with -Yinline-warnings for details
[warn] two warnings found
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_91).
Type in expressions to have them evaluated.
Type :help for more information.


Command:

scala> import com.quantifind.charts.Highcharts._


Result:

import com.quantifind.charts.Highcharts._


Command:

scala> line((1 to 10), (1 to 10))


Result:

serving resources from: file:/Users/USERNAME/wisp/index-1477712248460.html
2016-10-29 12:37:28.864:INFO:oejs.Server:jetty-8.1.13.v20130916
2016-10-29 12:37:28.899:INFO:oejs.AbstractConnector:Started SocketConnector@0.0.0.0:55135
Server started: http://192.168.0.3:55135/index-1477712248460.html
Output written to http://192.168.0.3:55135 (CMD + Click link in Mac OSX).
res0: com.quantifind.charts.highcharts.Highchart = Highchart(List(Series(Vector(DataPair(1,1,None,None), DataPair(2,2,None,None), DataPair(3,3,None,None), DataPair(4,4,None,None), DataPair(5,5,None,None), DataPair(6,6,None,None), DataPair(7,7,None,None), DataPair(8,8,None,None), DataPair(9,9,None,None), DataPair(10,10,None,None)),None,None,None,Some(line),None,None,None,None,series)),Some(Title(,None,None,None,None,None,None,None,title)),Some(Chart(Some(xy))),None,Some(Credits(None,,None,None,)),Some(Exporting(chart,None,None,None,None,None,None)),None,Some(PlotOptions(None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,None,plotOptions)),None,true,None,Some([Lcom.quantifind.charts.highcharts.Axis;@3a5792a6),Some([Lcom.quantifind.charts.hi...


Graphical output:

Wisp Is Scala Plotting Example on macOS Sierra




Wednesday, October 19, 2016

macOS Sierra: R (programming language): Scatter Plot Example

Command:

$ r


Result:

R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin16.0.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

During startup - Warning messages:
1: Setting LC_COLLATE failed, using "C"
2: Setting LC_TIME failed, using "C"
3: Setting LC_MESSAGES failed, using "C"
4: Setting LC_MONETARY failed, using "C"


Command:

> cars <-c(1,3,6,4,9)
> plot(cars)


Result:

R (programming language) Plot

GNU Octave: Plot Example

Command:

octave:10> x = -10:0.1:10;
octave:11> x


Result:

x =

 Columns 1 through 13:

   -10.000    -9.900    -9.800    -9.700    -9.600    -9.500    -9.400    -9.300    -9.200    -9.100    -9.000    -8.900    -8.800

 Columns 14 through 26:

    -8.700    -8.600    -8.500    -8.400    -8.300    -8.200    -8.100    -8.000    -7.900    -7.800    -7.700    -7.600    -7.500

 Columns 27 through 39:

    -7.400    -7.300    -7.200    -7.100    -7.000    -6.900    -6.800    -6.700    -6.600    -6.500    -6.400    -6.300    -6.200

 Columns 40 through 52:

    -6.100    -6.000    -5.900    -5.800    -5.700    -5.600    -5.500    -5.400    -5.300    -5.200    -5.100    -5.000    -4.900

 Columns 53 through 65:

    -4.800    -4.700    -4.600    -4.500    -4.400    -4.300    -4.200    -4.100    -4.000    -3.900    -3.800    -3.700    -3.600

 Columns 66 through 78:

    -3.500    -3.400    -3.300    -3.200    -3.100    -3.000    -2.900    -2.800    -2.700    -2.600    -2.500    -2.400    -2.300

 Columns 79 through 91:

    -2.200    -2.100    -2.000    -1.900    -1.800    -1.700    -1.600    -1.500    -1.400    -1.300    -1.200    -1.100    -1.000

 Columns 92 through 104:

    -0.900    -0.800    -0.700    -0.600    -0.500    -0.400    -0.300    -0.200    -0.100     0.000     0.100     0.200     0.300

 Columns 105 through 117:

     0.400     0.500     0.600     0.700     0.800     0.900     1.000     1.100     1.200     1.300     1.400     1.500     1.600

 Columns 118 through 130:

     1.700     1.800     1.900     2.000     2.100     2.200     2.300     2.400     2.500     2.600     2.700     2.800     2.900

 Columns 131 through 143:

     3.000     3.100     3.200     3.300     3.400     3.500     3.600     3.700     3.800     3.900     4.000     4.100     4.200

 Columns 144 through 156:

     4.300     4.400     4.500     4.600     4.700     4.800     4.900     5.000     5.100     5.200     5.300     5.400     5.500

 Columns 157 through 169:

     5.600     5.700     5.800     5.900     6.000     6.100     6.200     6.300     6.400     6.500     6.600     6.700     6.800

 Columns 170 through 182:

     6.900     7.000     7.100     7.200     7.300     7.400     7.500     7.600     7.700     7.800     7.900     8.000     8.100

 Columns 183 through 195:

     8.200     8.300     8.400     8.500     8.600     8.700     8.800     8.900     9.000     9.100     9.200     9.300     9.400

 Columns 196 through 201:

     9.500     9.600     9.700     9.800     9.900    10.000


Command:

octave:12> plot(x,sin(x));


Result:

GNU Octave (Plotting sine wave function)