Filter löschen
Filter löschen

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

5 Ansichten (letzte 30 Tage)
Ana Soph
Ana Soph am 27 Aug. 2020
Kommentiert: Star Strider am 29 Aug. 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')

Akzeptierte Antwort

Star Strider
Star Strider am 27 Aug. 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 Kommentare
Ana Soph
Ana Soph am 29 Aug. 2020
always awesome sir! thank you so much!
Star Strider
Star Strider am 29 Aug. 2020
Thank you!
As always, my pleasure!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Image Analyst
Image Analyst am 27 Aug. 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 Kommentar
Ana Soph
Ana Soph am 29 Aug. 2020
yes hahah i did it, but i dont remember how, thank you so much ..

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by