필터 지우기
필터 지우기

Unable to combine plots?

조회 수: 1 (최근 30일)
Roger Breton
Roger Breton 2023년 6월 27일
편집: Adam Danz 2023년 6월 27일
I created a monster of a script which satisfies my research needs for the moments but I am struggling with the subplots.
You will find my code in the attached m file and here is a screen capture of the two figures I try to combine to no avail :
The problem that I run into is that, once I use subplots to define each graph, I end up with a decent size image plot but a completely squished rectangles plot. For the purpose of my work, I need to rectangles plots to come up about the size you see here.
Any help is appreciated.
I wanted to contribute my code for others who might be doing 'color imaging' research. My goal is to find a visual mean of representing colors in an image such that relationships between colors so that the underlying rules of harmony could be intuitively interpreted. For the time being, my analysis is based on CIE Lch color format. Eventually, I would like to restate the 36 final colors in terms of Munsell color system.
My next step is to plot those 36 colors on a 3D scatter as "histograms", with chroma being the "height" and CIE a* and b* forming the 2D coordinates. It should prove an interesting visualization.
BTW, I want to say I still consider myself a Matlab newbie. So if you find grossly inefficient data structures, be gentle on me :-)
Have to add I could not have made it this far without ChatGPT.
  댓글 수: 2
DGM
DGM 2023년 6월 27일
Could you not do something like:
x = 1:100;
subplot(1,4,1)
plot(x) % something to fill the axes
subplot(1,4,2:4)
plot(x) % something to fill the axes
Of course, it gets squished beyond reason since I can't really control the figure aspect ratio on the forum, but you can make subplots span multiple "tiles" for lack of a better word. I'm pretty sure tiledlayout can do similar, but I'm running R2019b, and tiledlayout has changed a lot since then.
Adam Danz
Adam Danz 2023년 6월 27일
편집: Adam Danz 2023년 6월 27일
I'd love to know what ChatGPT prompts you used to create the chart with the colorful rectangles (bar chart).

댓글을 달려면 로그인하십시오.

답변 (1개)

Adam Danz
Adam Danz 2023년 6월 27일
편집: Adam Danz 2023년 6월 27일
fig = gcf; % from your code
tcl = tiledlayout(1,4,'TileSpacing','Compact');
ax1 = nexttile(tcl);
% PLOT IMAGE
ax2 = nexttile(tcl,[1,3]);
% Plot rectangles (bar chart)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by