How to take ascii file and plot into scatter plot?
9 views (last 30 days)
Show older comments
I have an ascii file that looks like this (called lh_text):
I tried to load it into matlab using the following command:
But am getting the error: ' unknown text of line one of ASCII file '
I would like to make a bar plot that has the values as the y axis, and the names of the structures (e.g. bankssts, fusiform) as the labels on the x axis (please see attached!)
Can you help me convert this file to a file that I can plot?
Dave B on 8 Nov 2021
Edited: Dave B on 8 Nov 2021
readtable will do well to read in the file
converting it to categorical will make it easier to make a bar out of
reordercats will help for changing the order on the x axis (I did them by the height of the bars, but you could do them by whatever order you like)
% if you want it in order of biggest to smallest bar:
[~,sortind] = sort(t.Var2,'descend');
More Answers (0)
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!