Plotting Various Colors & Symbols
古いコメントを表示
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 件のコメント
Adam Danz
2020 年 6 月 4 日
At what part of this process are you stuck?
Doug
2020 年 6 月 5 日
Adam Danz
2020 年 6 月 5 日
"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
2020 年 6 月 6 日
採用された回答
その他の回答 (1 件)
Doug
2020 年 6 月 11 日
11 件のコメント
Adam Danz
2020 年 6 月 11 日
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
2020 年 6 月 12 日
Adam Danz
2020 年 6 月 12 日
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
2020 年 6 月 12 日
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
2020 年 6 月 15 日
Adam Danz
2020 年 6 月 15 日
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
2020 年 7 月 1 日
Your data must be different than the data provided 3 comments above because the parentheses worked for me. Glad you worked it out! :)
Doug
2020 年 7 月 2 日
カテゴリ
ヘルプ センター および File Exchange で Graphics Object Properties についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
