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

2 ビュー (過去 30 日間)
Ana Soph
Ana Soph 2020 年 8 月 27 日
コメント済み: Star Strider 2020 年 8 月 29 日
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')

採用された回答

Star Strider
Star Strider 2020 年 8 月 27 日
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 件のコメント
Ana Soph
Ana Soph 2020 年 8 月 29 日
always awesome sir! thank you so much!
Star Strider
Star Strider 2020 年 8 月 29 日
Thank you!
As always, my pleasure!

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2020 年 8 月 27 日
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 件のコメント
Ana Soph
Ana Soph 2020 年 8 月 29 日
yes hahah i did it, but i dont remember how, thank you so much ..

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by