x-ticklabels with varying distance
1 回表示 (過去 30 日間)
古いコメントを表示
I have plotted a set of samples S1, S2, S3, etc.. using
boxplot, hold on, scatter
(this part is not related to my question:)) Now I want to group every 2 sample by making them closer together on the x-axis: In other words I want to have only 1 space between S1 and S2 and 1.5 space between S2 and S3 on the x-axis. Similarly I want 1 space between S3 and S4 and 1.5 space between S4 and S5. So in this way every 2 sample is closer together on the x-axis. Is it possible to achieve this in matlab?
Thanks.
0 件のコメント
回答 (1 件)
dpb
2017 年 7 月 20 日
Yeah, just define an associated x vector on a 1:1 basis with the y values (your S arrays here) that has the appropriately-spaced distances between them, then use the
plot(x,y)
form instead of just
plot(y)
which former plots y vs x instead of the latter that is just versus the ordinal position in the array.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Scatter Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!