필터 지우기
필터 지우기

make a data plot

조회 수: 1 (최근 30일)
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 12월 16일
댓글: Ioannis Vourvachakis 2021년 12월 16일
Hello! I want to make a plot like this, but I don't know exactly how.
More specifically,I want to plot the possible values of flux variability for some reactions.
Could someone guide me? Thank you.
  댓글 수: 3
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 12월 16일
Thank you, I'll look for it.
Star Strider
Star Strider 2021년 12월 16일
My pleasure!

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

채택된 답변

John D'Errico
John D'Errico 2021년 12월 16일
편집: John D'Errico 2021년 12월 16일
Easier than you think.
First, write a little function that will plot a bar of fixed height, between two points on the x axis. It might look like the function called xbar below.
Next, call that function repeatedly, once for each horizontal bar.
Finally, change the y axis to have a different set of tick labels. It looks like you will need to set the YTickLabel property on the axes. For example:
plot(rand(1,5))
H = get(gca);
H.YTickLabel
ans = 9×1 cell array
{'0' } {'0.1'} {'0.2'} {'0.3'} {'0.4'} {'0.5'} {'0.6'} {'0.7'} {'0.8'}
Now you can reset those tick mark lables as desired. And they need not be numbers.
function xbar(y,xlo,xhi,barcolor)
% On the current figure, creates a horizontal bar
% of unit height, between y and y+1, and between xlo and xhi
% this can be as simple as one call to fill.
barpolyx = [xlo,xhi,xhi,xlo];
barpolyy = [y,y,y+1,y+1];
fill(barpolyx,barpolyy,barcolor)
end
Should be pretty simple. Spend some time learning to use the basic tools.
  댓글 수: 4
John D'Errico
John D'Errico 2021년 12월 16일
Wait. You were the one who implied you knew that.
I have no idea what it means to have ALL of the values shown. But surely you might be able to choose two percentiles of your data. Perhaps the 5 and 95% points from the data, thus excluding a few outliers. Or the 1% and 99% points. Or just the max and the min. Your choice.
help prctile
help min
help max
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 12월 16일
Yes, thank you!!

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

추가 답변 (1개)

Arthur Goldsipe
Arthur Goldsipe 2021년 12월 16일
This looks to me like a horizontally oriented box plot. You can easily create such plots using boxchart or boxplot. Since you want a legend, I recommend using boxchart.
  댓글 수: 8
Arthur Goldsipe
Arthur Goldsipe 2021년 12월 16일
The function from the Stats toolbox is named boxplot (not boxchart).
Ioannis Vourvachakis
Ioannis Vourvachakis 2021년 12월 16일
Yes, there is boxplot! Thank you!

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

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by