Reader small image

You're reading from  Julia for Data Science

Product typeBook
Published inSep 2016
Reading LevelBeginner
PublisherPackt
ISBN-139781785289699
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Anshul Joshi
Anshul Joshi
author image
Anshul Joshi

Anshul Joshi is a data scientist with experience in recommendation systems, predictive modeling, neural networks, and high performance computing. His research interests encompass deep learning, artificial intelligence, and computational physics. Most of the time, he can be caught exploring GitHub or trying anything new he can get his hands on. You can also follow his personal blog.
Read more about Anshul Joshi

Right arrow

Visualizing using Vega


Vega is a beautiful visualization library provided by John Myles White. It is available as a registered Julia package, so it can be installed easily.

It is built on top of D3.js and uses JSON to create beautiful visualizations. It requires an Internet connection whenever we need to generate graphs as it doesn't store local copies of the JavaScript libraries needed.

Installation

To install Vega, use the following commands:

Pkg.add("Vega")
using Vega

Examples

Let's walk through various visualizations using Vega.

Scatterplot

Following are the arguments of a scatterplot:

  •  x and y: AbstractVector

  • Group: AbstractVector

Scatterplots are used to determine the correlation between two variables, that is, how one is affected by the other:

scatterplot(x=rand(100), y=rand(100))

We can now move on to building a complex scatterplot:

This will generate the following scatterplot. We can clearly see two clusters generated by Vega. These are d1 and d2:

In this particular example, we grouped...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Julia for Data Science
Published in: Sep 2016Publisher: PacktISBN-13: 9781785289699

Author (1)

author image
Anshul Joshi

Anshul Joshi is a data scientist with experience in recommendation systems, predictive modeling, neural networks, and high performance computing. His research interests encompass deep learning, artificial intelligence, and computational physics. Most of the time, he can be caught exploring GitHub or trying anything new he can get his hands on. You can also follow his personal blog.
Read more about Anshul Joshi