Difference between revisions of "Graphing"

From ECLR
Jump to: navigation, search
(Line Plots)
Line 2: Line 2:
  
 
= Line Plots =
 
= Line Plots =
 +
 +
 +
 +
For this example we use one of Matlab's sample dataset to plot a simple line plot showing the time series movement of the stock market data.
 +
First Load the data.
 +
<source>
 +
load stockreturns
 +
</source>
 +
 +
The data contains a (100x10) matrix of stock market observations and we are going to plot all of these data point on a single line plot using the 'plot' function.
 +
 +
<source>
 +
figure
 +
plot(stocks(:))
 +
</source>
 +
 +
[[File:lineplot1.png]]
 +
 +
<source>
 +
sd=std(stocks(:);
 +
hold on
 +
plot(xlim, [sd sd],'--r')
 +
plot(xlim, [-sd -sd],'--r')
 +
</source>
 +
 +
[[File:lineplot2.png]]
  
 
= Scatter Diagrams =
 
= Scatter Diagrams =

Revision as of 20:19, 23 October 2015

Introduction

Line Plots

For this example we use one of Matlab's sample dataset to plot a simple line plot showing the time series movement of the stock market data. First Load the data.

load stockreturns

The data contains a (100x10) matrix of stock market observations and we are going to plot all of these data point on a single line plot using the 'plot' function.

figure
plot(stocks(:))

Lineplot1.png

sd=std(stocks(:);
hold on
plot(xlim, [sd sd],'--r')
plot(xlim, [-sd -sd],'--r')

Lineplot2.png

Scatter Diagrams

Histograms

Distribution Plots

Theoretical Distributions

Observed Distributions/Kernel Density Plots