How to plot specific rows from table
Show older comments
I am trying to plot data based on the specimen id, I have two types of speciments. 0.12C and 0.07C Steel, as seen in the photo here is the table.

I would like to plot the data with different markers for each Plate ID, but i can't seem to figure out how to plot them. I have tried calling out the rows and varible when plotting but it won't work.
Here is how i load the data:
Table4 = readtable('Grain Size.xlsx','sheet','KIC Master','VariableNamingRule','preserve');
Here is how I am trying to plot:
plot(ax2,Table4(1:7,"Ferrite Grain Size-1/2 (in.)"),Table4(1:7,"Provisional To °F"),'Color','black','LineStyle','none','Marker','x','MarkerEdgeColor','black','MarkerFaceColor','black');
plot(ax2,Table4(8:11,"Ferrite Grain Size-1/2 (in.)"),Table4(8:11,"Provisional To °F"),'Color','black','LineStyle','none','Marker','S','MarkerEdgeColor','black','MarkerFaceColor','black');
I get this error:
Error using plot
Invalid subscript for Y. A table variable subscript must be a numeric array containing real positive integers, a logical array, a character vector, a string array, a cell
array of character vectors, or a pattern scalar used to match variable names.Error using plot
Invalid subscript for Y. A table variable subscript must be a numeric array containing real positive integers, a logical array, a character vector, a string array, a cell
array of character vectors, or a pattern scalar used to match variable names.
What am I missing here? The only way i have gotten this kind of thing to work in the past is by creating seaperate tables for each specimen type then plotting each table individually. I would like to at least keep them in the same table and be able to call our which rows I want to plot.
Thank You!
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!