is a possible way to have the name of x axis in spanish?
조회 수: 3 (최근 30일)
이전 댓글 표시
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')
댓글 수: 0
채택된 답변
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
추가 답변 (1개)
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!