Plot 9 parameters for 29 country for 20 years in one curve
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
wided hechkel
le 7 Août 2020
Modifié(e) : Sudheer Bhimireddy
le 8 Août 2020
Dear,
I want to plot using MATLAB, a curve or 3D plot for this database :
ALB 1996 -0,6215114
ALB 1997 -0,6254301
ALB 1998 -0,62933439
ALB 1999 -0,63335227
ALB 2000 -0,63735683
BGD 1996 2,13048473
BGD 1997 2,11153446
BGD 1998 2,07734031
BGD 1999 2,02275107
BGD 2000 1,95238739
So, I have 3 parameters: 1/ countries 2/ years 3/ values
In the example above i used only few data, but could you please find the total database attached (Excel File) I worked on 9 parameters, 29 countries, and 20 years, I want to obtain 9 plots, so for each parameter i have a plot.
Could you please help to resolve this issue ?
0 commentaires
Réponse acceptée
Sudheer Bhimireddy
le 8 Août 2020
Modifié(e) : Sudheer Bhimireddy
le 8 Août 2020
You can try something like this:
% Read data from one sheet
data = readtable('base.xlsx','Sheet','Feuil6');
% Read a parameter
temp = data(:,5);
% Reshape the parameter
temp = reshape(temp.lnide,[29 22]);
% Get the country names and years
countries = unique(data.payscode);
countries = cell2mat(countries);
years = unique(data.Ann_e);
% Plot
h = bar3(temp);
ax = gca;
ax.XTick = 1:3:size(years);
ax.XTickLabel = years(1:3:end);
ax.YTick = 1:3:size(countries);
ax.YTickLabel = countries(1:3:end,:);
to get:
Alternate way is to use plot() with different linestyles and line colors. But that will look messy with 29x20 lines for each parameter.
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!