How to I make data evenly spaced when displaying on a plot?

10 次查看(过去 30 天)
I have a figure that plots seismograms sorted by distance to the event (closest to the bottom). However, when it plots, the seismograms are not evenly spaced, so it looks like a mess and they overlap a lot, especially when the recievers (whats collecting the data) are close together. How can I make each one evenly spaced, but still sorted?
figure; hold on
for i = 1 : length(sort_dists)
indk = dist_ind(i);
plot(((1:length(fseis)))/isps, fseis(:,indk)./max(abs(fseis(:,indk)))+ deg2km(sort_dists(i)));
text(seis_duration_sec,deg2km(sort_dists(i)),num2str(deg2km(sort_dists(i))));
end
  2 个评论
dpb
dpb 2021-10-14
Be far easier to have a sample dataset for folks to play with to see just what a given single plot looks like as well as to experiment...very difficult to guess what the data itself ought to look like in order to try to simulate something realistic.
The normal way to plot against a non-numeric axis would be to use the ordinal position as the abscissa instead of the numeric values; that works for a given trace.
In your case where you're trying to separate traces, that may be "not so much".
Possibly instead of the distance metric itself you should convert it to a categorical variable instead that is ordinal by the sorted distance.
Again, without seeing just what it is that we've got to work with, it's a wild guess.
I don't think the strips plot is what you're looking for here; it breaks up a given trace into sections; you've got a bunch of different traces. What might serve that is a builtin specialty plot could be stackedplot that is a bunch of small plots lined up on top of each other vertically in the overall figure window. I dunno how satisfactory that might be because they won't be overlaid at all as with the single axis you presently have.
Again, attach at least a representative dataset as a .mat file

请先登录,再进行评论。

回答(1 个)

Kevin Holly
Kevin Holly 2021-10-14
Have you tried using strips?

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by