How to correct cluttered axes in my plot in Matlab GUI?

2 ビュー (過去 30 日間)
Zihao Liu
Zihao Liu 2021 年 1 月 3 日
回答済み: Benjamin Kraus 2021 年 1 月 5 日
Before I plotted my scattering figure, the plot module in my GUI looked like this:
After I plot my data in the GUI with the code, it looks like this:
Could someone please tell me how to correct the cluttered X axis?
The code I used to plot this image is:
scatter(app.UIAxes,ppangle,aaangle,[ ],totalcounts,'filled')
colorbar(app.UIAxes)
xlabel(app.UIAxes,'\Phi')
ylabel(app.UIAxes,'\theta')

採用された回答

Benjamin Kraus
Benjamin Kraus 2021 年 1 月 5 日
It looks like you've set the XTickMode (and possibly also XTickLabelMode) to manual.
This means that when you add new data to the axes, the existing tick values and labels are being preserved.
You need to set your XTickMode (and possible XTickLabelMode) back to auto, either in App Designer:
Or manually in your code:
xticks(app.UIAxes, 'auto');
xticklabels(app.UIAxes, 'auto');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by