Data Visualization with Julia on Windows

476
Data Visualization with Julia
Data Visualization with Julia on Windows

In this tutorial, we will demonstrate on data visualization with Julia on Windows 10. Julia plays a pivotal role in exploratory data analysis.

At the very outset, you need to install Julia and Jupyter notebook on Windows 10. Once you complete the process then connect Julia to the notebook. So that Jupyter notebook can recognize Julia language.

We use Jupyter notebook IDE for coding purpose. To get the details on how to connect Julia to Jupyter, you see the guide.

Here, we will be using the iris flower dataset for data visualization with Julia. We will create a bar chart, scatter chart, and histogram using the iris dataset.

You just write a few lines of code to complete the entire task.

let’s get started.

Method : Data Visualization with Julia on Windows

Follow the below steps to visualize data.

Step #1: Open Jupyter Notebook

Open the Jupyter notebook using Anaconda Navigator. Once you open the notebook, then select Julia for coding purpose. You can also use Julia prompt in the REPL window.

Julia in Jupyter Notebook for Coding
Julia in Notebook


Step #2:

Now, you will need to install more packages to visualize data in Julia. Plots library is one of the most important packages in Julia.

We will use this library for data visualization. It lets you create the visualization. You can visit this site to know more details about this package.

We need to add the package using the source code.

Type the followings in the Jupyter notebook:

using Pkg

Pkg.add(“Plots”)

Adding Plots Library for Data Visualization with Julia
Plots Library Integration

For this guide, we will be using each of these libraries.

Step #3:

Type this command in a notebook and then run.

using Plots

It loads a package that uses for the creation of a visualization. Plots library is a powerful, robust and easy to use. This package was developed by Thomas Breloff.

Type plot() into a cell in Jupyter notebook and then run.

After executing the commands, it will yield the following plot:

Data Visualization with Julia on windows 10
Visualization

Let us check things are configured correctly. I will create the following charts.

Example: Data Visualization with Julia

In this section, I will be using the iris dataset in Julia program. We want to visualize real world data.

We need to import CSV package for dealing with CSV dataset.

After importing the CSV file, Julia can read the CSV file for visualization.

CSV file with row and columns inputting for visualization
Reading CSV File

Once you include the iris dataset then it will form a table with 150 rows and 6 columns.

Using the dataset, we will be creating the charts below:

Bar Chart

Scatter Chart

Histogram

Bar Chart

To create the bar chart, type the below commands in Jupyter cell and then click on run. You will see this chart:

Bar Chart
Bar Chart

Scatter Chart

In order to create a scatter chart, type the below commands in a notebook and then click on run. You will get this chart:

Data Visualization with Scatter Chart
Scatter Chart

Histogram

In order to create a histogram, type the below code in a notebook and then click on run. Here is a result.

Histogram Data Visualization on Windows
Histogram

If you want to use above charts in your document then save it using the following codes .

savefig (“your filename.png”) then press Enter.

After executing that code, you will not get any chart in your notebook. But your file will be automatically saved into the working directory.

Conclusion:

Hope this short tutorial gives you lots of good ideas about using Julia lnaguage as a Data visualization tool. If you want to visualize your dataset in one line of code visit here.

Please feel free to comment below

LEAVE A REPLY

Please enter your comment!
Please enter your name here