![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/479548/image.png)
How to correct cluttered axes in my plot in Matlab GUI?
2 views (last 30 days)
Show older comments
Before I plotted my scattering figure, the plot module in my GUI looked like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/477083/image.png)
After I plot my data in the GUI with the code, it looks like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/477088/image.png)
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')
0 Comments
Accepted Answer
Benjamin Kraus
on 5 Jan 2021
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/479548/image.png)
Or manually in your code:
xticks(app.UIAxes, 'auto');
xticklabels(app.UIAxes, 'auto');
0 Comments
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!