Since it's your first time here, let us show you how Trendy works.

Close-button

British Tabloid Hysteria Correlation

This plot is broken.

ans =

   311

Error using horzcat
Dimensions of matrices being concatenated are not consistent.
  • Created by: Hugo Carr
  • Latest result: ans = 311 Error using horzcat Dimensions of matrices being concatenated are not consistent.
  • Created on: 13 Feb 2012
  • Liked: 5 times

How does newspaper hysteria correlate? Do groups of newspapers feel fear at the same time?

This graph uses trends which have been calculated by looking at the front page of each associated news website and deriving a hysteria metric, the heat map corresponds to how each time series correlate with one another.

A red value indicates that two newspapers use a similar volume of hysterical keywords at any given time. A blue value on the other hand indicates a negative correlation, something which could potentially be seen between newspapers on opposing sides of the political spectrum.

Plot Image
% time1427 and data1427 available for use
% for Hysteria: The Times
% 
% time1357 and data1357 available for use
% for Hysteria: The Sun 
% 
% time1358 and data1358 available for use
% for Hysteria: The Mirror
% 
% time1361 and data1361 available for use
% for Hysteria: The Independent
% 
% time1362 and data1362 available for use
% for Hysteria: The Guardian
% 
% time1360 and data1360 available for use
% for Hysteria: The Daily Star
% 
% time1356 and data1356 available for use
% for Hysteria: Daily Mail
% 
% time1359 and data1359 available for use
% for Hysteria: BBC News
% 
% Hysteria: The Telegraph
%   time vector is: time1363
%   data vector is: data1363

paddedData1427 = [nan(1, length(data1363)-length(data1427)) data1427']';

%------ 1
f = figure;
length(data1363)
subplot(2,2,1); imagesc(corrcoef([data1363 data1362 data1361 data1360 data1359 data1358 data1357 data1356 paddedData1427],'rows','pairwise'),[-1 1]);
%axis square

%colorbar
%title('The Hysteriometer: Correlation Heat Map')

mylabels = {'Telegraph', 'Guardian', 'Independent', 'Daily Star', 'BBC News','Mirror','Sun', 'Daily Mail','Times'}

set(gca, 'YTick', 1:9)
set(gca, 'YTickLabel', mylabels);
set(gca, 'XTickLabel', {});

colormap(interp1(1:3, [0 36 125; 255 255 255; 207 20 43]/256, linspace(1, 3, 64)));

% Adujust Margins
myPos = get(gca, 'Position');
myPos(3) = 1/0.95*myPos(3);
myPos(2) = 0.9*myPos(2);
set(gca, 'Position', myPos)

%---------- 2

subplot(2,2,2); imagesc(fliplr(corrcoef([data1363 data1362 data1361 data1360 data1359 data1358 data1357 data1356 paddedData1427],'rows','pairwise')),[-1 1]);
%axis square

%colorbar
%title('The Hysteriometer: Correlation Heat Map')

mylabels = {'Telegraph', 'Guardian', 'Independent', 'Daily Star', 'BBC News','Mirror','Sun', 'Daily Mail','Times'}

set(gca, 'YTick', 1:9)
set(gca, 'YTickLabel', mylabels);
set(gca, 'XTickLabel', {});

colormap(interp1(1:3, [0 36 125; 255 255 255; 207 20 43]/256, linspace(1, 3, 64)));
set(gca,'YAxisLocation', 'right')

% Adujust Margins
myPos = get(gca, 'Position');
myPos(1) = 0.95*myPos(1);
myPos(2) = 0.9*myPos(2);
set(gca, 'Position', myPos)

%---------- 3

subplot(2,2,3); imagesc((fliplr(corrcoef([data1363 data1362 data1361 data1360 data1359 data1358 data1357 data1356 paddedData1427],'rows','pairwise')))',[-1 1]);
%axis square

%colorbar
%title('The Hysteriometer: Correlation Heat Map')

mylabels = {'Telegraph', 'Guardian', 'Independent', 'Daily Star', 'BBC News','Mirror','Sun', 'Daily Mail','Times'}

set(gca, 'YTick', 1:9)
set(gca, 'YTickLabel', fliplr(mylabels));
set(gca, 'XTickLabel', {});

myShortlabels = {'Tele', 'Guar', 'Indy', 'Star', 'BBC','Mirr','Sun', 'Mail','Times'}

hText = text(1:9, 9.53*ones(1,9), myShortlabels)
set(hText,'Rotation',90,'HorizontalAlignment','right')

colormap(interp1(1:3, [0 36 125; 255 255 255; 207 20 43]/256, linspace(1, 3, 64)));

% Adujust Margins
myPos = get(gca, 'Position');
myPos(3) = 1/0.95*myPos(3);
myPos(4) = 1/0.95*myPos(4);
set(gca, 'Position', myPos)

%---------- 4

subplot(2,2,4); imagesc(fliplr(flipud(corrcoef([data1363 data1362 data1361 data1360 data1359 data1358 data1357 data1356 paddedData1427],'rows','pairwise'))),[-1 1]);
%axis square

%colorbar
%title('The Hysteriometer: Correlation Heat Map')

mylabels = {'Telegraph', 'Guardian', 'Independent', 'Daily Star', 'BBC News','Mirror','Sun', 'Daily Mail','Times'}

set(gca, 'YTick', 1:9)
set(gca, 'YTickLabel', fliplr(mylabels));
set(gca, 'XTickLabel', {});

myShortlabels = {'Tele', 'Guar', 'Indy', 'Star', 'BBC','Mirr','Sun', 'Mail','Times'}

hText = text(1:9, 9.53*ones(1,9), fliplr(myShortlabels))
set(hText,'Rotation',90,'HorizontalAlignment','right')

colormap(interp1(1:3, [0 36 125; 255 255 255; 207 20 43]/256, linspace(1, 3, 64)));

set(gca,'YAxisLocation', 'right')
% Adujust Margins
myPos = get(gca, 'Position');
myPos(1) = 0.95*myPos(1);
myPos(4) = 1/0.95*myPos(4);
set(gca, 'Position', myPos)

% Colorbar
myPos = get(f, 'Position');
newPos = myPos;

xCenter = (myPos(3)-myPos(1))/2;
yCenter = (myPos(4)-myPos(2))/2;


axes('Position', [0.324 0.1 0.25 0.785], 'Visible', 'off');
colorbar('YTickLabels',{})

axes('Position', [0.095 0.461 0.815 0.2], 'Visible', 'off');
colorbar('XTickLabels',{}, 'location', 'South')
Tags:

    6 comments

    Ned Gulley about 1 year ago

    Would you consider using a different colormap? Something that makes the gradient look monotonic (like the grayscale)?

    Hugo Carr about 1 year ago

    Hmmm, I see your point. I'm quite keen to distinguish zero though. I have an idea.

    Hugo Carr about 1 year ago

    (A patriotic idea)

    Ned Gulley about 1 year ago

    Well done sir. Rule Britannia!

    Hugo Carr about 1 year ago

    I'm afraid it won't look quite so authentic when the Times gets more data points. I've printed off a screenshot to hang next to my desk.

    Luke about 1 year ago

    That is truly fantastic.