% When plotting data with the x axis containing large values (i.e. large offset),
% the plot is incorrect.
% This is ok  when using the gnuplot graphic toolkit.

clear all
close all
clc

% -----------------------------------------------------------------------------
% Example 1
% ---------
y=rand(1,5000);
t=[0:length(y)-1]*0.01;

% Correct plot
figure
subplot(2,1,1)
plot(t, y)

% Incorrect plot
%figure
subplot(2,1,2)
plot(t-t(1)+1e8, y)

% -----------------------------------------------------------------------------
% Example 2
% ---------

% Correct plot
figure
plot(t, y)

% Incorrect plot
figure
plot(t+1e8, y)


% -----------------------------------------------------------------------------
% Example 3
% ---------
N=100;
y=y(1:N);
t=t(1:N);

% Correct plot
figure
plot(t, y)

% Incorrect plot
figure
plot(t+1e8, y)
