Two graphs in the same plot, why?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sergio
am 31 Jan. 2024
Kommentiert: Sergio
am 31 Jan. 2024
Hi, I imported some data from an xls file, and when plotting it , I obtain two graphs in the plot. Only one is necessary. What is the other and why does it appear?
xlsread('sunHoursInTrollhattan.xlsx')
plot(ans)
xlabel('måned')
ylabel('timer')
title('Soltimar i Trollhattan')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1604756/image.png)
Thanks
0 Kommentare
Akzeptierte Antwort
Alan Stevens
am 31 Jan. 2024
Something like this
data = xlsread('sunHoursInTrollhattan.xlsx');
mins = data(:,1)*60 + data(:,2);
plot(1:12, mins,'o'),grid
Weitere Antworten (1)
Alan Stevens
am 31 Jan. 2024
You have the hours as one plot and the minutes as the other!
Turn the data into all minutes, or all hours first.
1 Kommentar
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!