scatter with z dimension color express dates just in months
4 次查看(过去 30 天)
显示 更早的评论
I have this code:
figure()
pointsize = 30;
scatter(x,y, pointsize, date,'filled');
set(gca,'yscale','log')
xlabel('x');
ylabel('y');
grid on;
colorbar
The z axis is date in the typical format MATLAB likes (a 5 digit number) Instead of showing dates on the colorbar like 43500, how do I show just the tic marks for the month?
I tried this which seems to work, but how do I just show the month? not the days and year?
c=colorbar('SouthOutside'); % Note you can change position
c.TickLabels = datestr(c.Ticks);
This also seems to get the year wrong. But I just want the month.
edit: Ok this is working, but I have several tics for each month. How do I reduce number of tics?
formatOut = 'mmmm';
c=colorbar('SouthOutside'); % Note you can change position
c.TickLabels = datestr(c.Ticks,formatOut);
1 个评论
dpb
2019-6-7
W/O data to try to match what you're doing it's pretty-much impossible to be able to do anything specific...attach a sample test case that illustrates the issue that folks can piddle with without having to try to reproduce your work on their own...
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!