Plotting Various Colors & Symbols
Show older comments
Hello,
I need help with the attached .mat file.
I am looking to make a series of 4 subplots for each D (Column 1) where each D is a different Symbol, and with that a different Color for each AR (Column 2). Each plot should look something similar to that of the attached Figure (Example_1).
After all the subplots I then need an additional plot at the end where I have all the data presented for 1 subplot for each D (Example_2).
Thanks in advance for the assistance.
4 Comments
Adam Danz
on 4 Jun 2020
At what part of this process are you stuck?
Doug
on 5 Jun 2020
Adam Danz
on 5 Jun 2020
"I am looking to make a series of 4 subplots for each D"
There are only 3 unique RES.D values in your data so it's very unclear how to create 4 subplots from that.
You mention a time series. I dont' see any obvious time values in your table. It's clear the the D column defines the symbol and the AR column defines the color but you haven't described which column contains the data you're plotting.
Doug
on 6 Jun 2020
Accepted Answer
More Answers (1)
Doug
on 11 Jun 2020
11 Comments
Adam Danz
on 11 Jun 2020
The symbols are different for each diameter. If you look at your subplots, each subplot has a different symbol and each subplot contains data from a different diameter.

Circles Diamonds Squares
The description from the question is,
I am looking to make a series of 4 subplots for each D (Column 1) where each D is a different Symbol, and with that a different Color for each AR (Column 2).
Is that still what you want to do?
Also, in the first subplot above there are 32 points but they all fall on 4 coordinates. Even if the colors are changed according to AR, you will only see the top 4 points. So I'm wondering if this is really the goal.
Doug
on 12 Jun 2020
Adam Danz
on 12 Jun 2020
This is confusing. You wrote that you want each value of D to be a different symbol (that's clear) and that there should be 3 subplots, one for each D (that's clear) which would result in each subplot containing only 1 symbol. But then you said "I want to have the different colours and symbols on all plots" which is where I get lost because if each plot contains its own D value and the D value defines the symbol, then each subplot can only have 1 symbol.
Adam Danz
on 12 Jun 2020
I've updated my answer with a demo you can follow that teaches you how to use the D and AR columns to specify marker and colors of each point. Study it and try to understand the logic that makes it work. Then you can adapt it to what you need to do.
Doug
on 15 Jun 2020
Adam Danz
on 15 Jun 2020
Sure! Let me know if you get stuck.
Lots of weird stuff going on in that line. Why use str2double when you're not working with strings? The curly brackets are also a problem. Curly brackets are for cell arrays but you're using them with matrices.
Try this.
xdat = RES.(xvar)(ismember(RES.D,DGroupID(jj)) & ismember(RES.AR, ARGroupID(colID)));
Adam Danz
on 1 Jul 2020
Your data must be different than the data provided 3 comments above because the parentheses worked for me. Glad you worked it out! :)
Doug
on 2 Jul 2020
Categories
Find more on Graphics Object Properties 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!