![dateplot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261169/dateplot.png)
alternative visualisations of 3 vectors
2 views (last 30 days)
Show older comments
I have two 3 vectors and I wish to visulaise the relationship between them.
They both contain day, month and year.
>>scatter3(f2.Day,f2.Month,f2.Year)
>> hold on
>> scatter3(s2.Day,s2.Month,s2.Year,'*')
>> hold off
I have used scatter3 plot to see the Relationship between them.
this is what is produced
![Capture2.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/256436/Capture2.png)
Are they any alternative plots which might produce a clearer relationship between them?
0 Comments
Answers (1)
Eric Sofen
on 10 Jan 2020
You could construct datetimes from those separate vectors of year/month/day, and then plot the datetime variables. That brings you back to 2D and should make things easier to see given the density of your data.
% Cook up some data
>> f.Day = randi(31,10,1);
>> f.Month = randi(12,10,1);
>> f.Year = 2020 + randi(10,10,1);
>> s.Day = randi(31,10,1);
>> s.Month = randi(12,10,1);
>> s.Year = 2015 + randi(10,10,1);
fdatetime = datetime(f.Year,f.Month,f.Day)
sdatetime = datetime(s.Year,s.Month,s.Day)
plot(sdatetime,fdatetime)
![dateplot.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/261169/dateplot.png)
0 Comments
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!