-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Formatting data to use #8
Comments
Violinplot is supposed to work the same way as box plots. If in doubt, try the example in the readme, and format your data the same way. If you then still need my help, please post a complete, executable code fragment and the error it produces. |
I don't know why I'm struggling with this so much. I've tried it a few different ways. The CCC, FFF, and VVV are my three groups, and MatlabDwellTimes was an Excel doc that I imported, it has the same values, just arranged into three columns for the corresponding group. Even just trying the violinplot function for one group (i.e. CCC) would not work. CCC = [ 293 234 234 234 236 273 305 305 313 416 465 465 537 698 699 727 784 787 838 1072 1208 1232 1237 1246 1290 1311 1342 1473 1544 1562 1562 1566 1568 1729 1767 1793 1815 1969 2013 2209 2222 2225 2305 2441 3158 3384 3609 3655 3748 3762 3855 4632 4933 6139 6391 6911 6936 7217 11325 14902 16330 18129 ]; data = [CCC,FFF,VVV]; violinplot(MatlabDwellTimes) The error message says "Error in ViolinWork (line 11) |
Thank you. There are two problems in your code, the way you showed it here. Both are in the line that begins with
With these two modifications, your example works on my machine: CCC = [ 293 234 234 234 236 273 305 305 313 416 465 465 537 698 699 727 784 787 838 1072 1208 1232 1237 1246 1290 1311 1342 1473 1544 1562 1562 1566 1568 1729 1767 1793 1815 1969 2013 2209 2222 2225 2305 2441 3158 3384 3609 3655 3748 3762 3855 4632 4933 6139 6391 6911 6936 7217 11325 14902 16330 18129 ];
FFF = [ 167 176 176 180 183 188 189 207 332 346 369 371 372 394 509 526 549 620 628 693 827 838 859 1078 1187 1206 1217 ];
VVV = [ 305 307 913 1109 1133 1331 1603 1821 2113 3186 3246 3307 3563 4598 4876 8337 18806 ];
data = [CCC,FFF,VVV];
cat = {'CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','CCC','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','FFF','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV','VVV'};
violinplot(data,cat) |
I appreciate it so much! |
The above code works on my computer. If you paste the exact code above into your Matlab, does it not work? What version of Matlab are you running? |
Hi, your plot looks beautiful. This is a basic issue, but how should data be formatted for the program to run properly?
I currently have three groups, CCC, FFF, VVV, entered in a format such as CCC = [12 14 23 34 54 25];
This is not running properly and I am wondering how I should be entering these values instead so that I can get it to run.
Sorry for the stupid question, and any help is much appreciated!
The text was updated successfully, but these errors were encountered: