A plot with four subplots (quadrants)
이전 댓글 표시
Hello,
I am working on a mood detection algorithm (from music) and I am currently stuck at the GUI.
I need to plot something similar to Thayer's arousal-valence emotion plane (four quadrants), here's what it looks like: Thayer
Now, it's not really technical, it's more about formatting the plot so it looks like that. I've tried everything I can but couldn't get to that result.
Basically what I need to do is this: if my function returns 1, a point would be plotted on the yellow panel (scatter plot maybe?), if answer is 2 - green, 3 - blue, 4 - red.
Is it possible? If it is, any idea of how I can do this?
Thank you in advance!
M.
댓글 수: 3
Sara
2014년 4월 16일
Do you need it to look like the picture or are you ok with having 4 plots? The point you're plotting, is it at a random location inside acolored box or at specific meaningful location? Would something like this work:
suplot(2,2,n)
plot(...)
where n is the number of the panel (1=red,2=yellow,3=blue,4=green in the figure you've posted).
Mihnea
2014년 4월 16일
Sara
2014년 4월 16일
You can use the quadrants of a classic plot: x>0,y>0 for yellow; x<0,y>0 for red and so on. In this way it's just one plot. And if you want to color the background, you can use the patch command.
채택된 답변
추가 답변 (2개)
Image Analyst
2014년 4월 16일
1 개 추천
If you have multiple subplots, you need to do some tricky stuff to get them close together. Why not just create an image and display that in a single axes control? Then put annotation over it with plot(), annotation(), text(), etc..
댓글 수: 4
Mihnea
2014년 4월 16일
Mihnea
2014년 4월 16일
Image Analyst
2014년 4월 17일
That's not what I was thinking, but that might work too. Just use patch() or fill() to put up a colored rectangle.
Mihnea
2014년 4월 17일
Mihnea
2014년 4월 17일
0 개 추천
댓글 수: 3
Image Analyst
2014년 4월 17일
Who's answer should you have put your answer under as a comment (Kelly or me)? Also, your link seems to be broken.
Kelly Kearney
2014년 4월 17일
Assuming this comment applied to my solution, you can set the xcolor and ycolor properties to match your figure background. I'm assuming for now you're not interested in tick labels; if you need those it might require a bit more fiddling.
set(gcf, 'color', 'w');
set(ax, 'xcolor', 'w', 'ycolor', 'w', 'xtick', [], 'ytick', [])
Mihnea
2014년 4월 17일
카테고리
도움말 센터 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!