フィルターのクリア

How to make discrete pcolor x-axis with no gaps between datapoints?

3 ビュー (過去 30 日間)
MP
MP 2022 年 7 月 11 日
回答済み: Steven Lord 2022 年 7 月 11 日
Is it possible to make a plot of continous discrete data? Something like shown in figure below? This is a simple representation of problem.
Here, B-axis is continous, while A-axis is discrete. Though the x-axis breaks, I do not want any gap between the datapoints. Basically, A-axis does not run continously from 0-300. Rathar it should select discrete x-points, 0-3-4-7-9 etc.... and make a continous plot.
Also, I would like to clarify that I am not making a 2-D plot (like the one shown here), I have a "pcolor plot".
Any help will be greatly appriciated.

採用された回答

Steven Lord
Steven Lord 2022 年 7 月 11 日
So instead of doing something like plotting data points with their actual X coordinates:
v = 1:10;
x = v.^2;
stem(x, v)
You want to plot the data points at x = 1, 4, 9, 16, etc. separated by only one space? If so, the easiest way is not to change the data but to change the labels.
figure
stem(v, v);
xticks(v);
xticklabels(string(x))
Though that could lead to erroneous conclusions on the part of people looking at your graph.

その他の回答 (1 件)

Bharat Chandra Mukkavalli
Bharat Chandra Mukkavalli 2022 年 7 月 11 日
Hi,
Hope this helps!

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by