赞
踩
- tbl = readtable('TemperatureData.csv');
- head(tbl,5)
h = heatmap(tbl,'Month','Year','ColorVariable','TemperatureF');
- h.SourceTable.Month = categorical(h.SourceTable.Month);
- neworder = {'January','February','March','April','May','June','July',...
- 'August','September','October','November','December'};
- h.SourceTable.Month = reordercats(h.SourceTable.Month,neworder);
- h.XDisplayData = {'January','February','March','April','May','June', ...
- 'July','August','September','October','November','December'};
- h.Title = 'Average Temperatures';
- h.XLabel = '';
- h.FontSize = 12;
- h.MissingDataColor = [0.8 0.8 0.8];
- h.MissingDataLabel = 'No Data';
h.ColorbarVisible = 'off';
h.CellLabelFormat = '%.0f';
- h.XDisplayData = {'January','April','July','October'};
- h.YDisplayData = {'2015','2016','2017'};
- sonnets = fileread('sonnets.txt');
- sonnets(1:135)
- sonnets = string(sonnets);
- sonnets = splitlines(sonnets);
- sonnets(10:14)
- p = ["." "?" "!" "," ";" ":"];
- sonnets = replace(sonnets,p," ");
- sonnets(10:14)
- sonnets = join(sonnets);
- sonnets = split(sonnets);
- sonnets(7:12)
sonnets(strlength(sonnets)<5) = [];
- C = categorical(sonnets);
- figure
- wordcloud(C);
- title("Sonnets Word Cloud")
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。