is a possible way to have the name of x axis in spanish?

6 vues (au cours des 30 derniers jours)
Ana Soph
Ana Soph le 27 Août 2020
Commenté : Star Strider le 29 Août 2020
Hello everybody, thank you so much for reading me, i hope all of you have a wonderful day, my question is.. it is a possible way to put the name of "x" axis of the months in spanish? or.. even put like manual? is possible? how?
Thank you so much !!! best
clear;clc;
numData = xlsread('solar2.xlsx','EneDicS')
Rad = numData(:,1);
Dia = numData(:,2);
tEnersol=readtable('solar2.xlsx','sheet','EneDics'); % read into a table object
tEnersol.Properties.VariableNames={'Rad','Dia'}; % assign variable names
yr=2014; % need the proper year
tEnersol.Date=datetime(yr,1,tEnersol.Dia); % and create a date column
hB=plot(tEnersol.Date,tEnersol.Rad, '.r'); hold on % plot against actual date
% xticks(0:50:365);
hAx=gca; % get axes handle...
xlim([datetime(2014,1,1) datetime(2014,12,12)]) % set limit to cover the full year
hAx.XAxis.TickLabelFormat='MMM'; % show day of MONTH
% xticklabels(cellstr(tEnersol.Date(xticks))) % use the date string as tick labels
hAx.XTickLabelRotation=45; % rotate so can have chance to read...
xlabel('Mes del año, TMYS'), ylabel('Irradiación solar [KWh/m^2]');
%irradiancia solar
%el archivo es solar
% x =(1:365);
% a1 = 1041
% b1 = 0.005075
% c1 = 0.7184
% w = a1*sin(b1*x+c1)
% D = datetime(yr, 1, x);
% plot(D, w, '.-b')

Réponse acceptée

Star Strider
Star Strider le 27 Août 2020
See the datetime documentation for: Date and Time from Text in Foreign Language and 'Locale' under Name-Value Pair Arguments. Use: 'Locale','es_ES'
  2 commentaires
Ana Soph
Ana Soph le 29 Août 2020
always awesome sir! thank you so much!
Star Strider
Star Strider le 29 Août 2020
Thank you!
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 27 Août 2020
Yes, didn't you do it? You can pass whatever string you want into xlabel(). It doesn't have to be an English string.
  1 commentaire
Ana Soph
Ana Soph le 29 Août 2020
yes hahah i did it, but i dont remember how, thank you so much ..

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by