Plot Function (fnplt) graph controls
이전 댓글 표시
I am using fnplt to fit curve to my data. My difficulty is to control marker instances and style on the attached graph. I want all marker instances match given instances on the shown Polar Angle axis. Markers need to be a bit bigger and filled with the same colour of curve.
Any comment is appreciated
cs = csapi(Angle,DKTSCFMATRIX(1,:));
fnplt(cs,1,'-b^');
hold on
cs1 = csapi(Angle,DKTSCFMATRIX(2,:));
fnplt(cs1,1,'-k^');
cs2 = csapi(Angle,DKTSCFMATRIX(3,:));
fnplt(cs2,1,'-r^');
댓글 수: 5
madhan ravi
2018년 8월 27일
Upload your datas too.
Ulvi Rahmanli
2018년 8월 27일
madhan ravi
2018년 8월 27일
Markers are in the same colours as the curve.
Ulvi Rahmanli
2018년 8월 27일
편집: Ulvi Rahmanli
2018년 8월 27일
madhan ravi
2018년 8월 27일
I have surfed through the internet what I found out was only line width can be changed for fnplt . There aren't much information about this function because it is not documented .
답변 (1개)
Amal George M
2018년 8월 30일
편집: Amal George M
2018년 8월 30일
Hi Ulvi,
To my understanding, the intention is to modify the properties of markers created using ' fnplt '. As of now, the inbuilt function 'fnplt' does not have the functionality to achieve this. Thank you for bringing this to our attention.
As a workaround, you can modify the required properties using the handles to the graphic objects. I have attached the custom code below.
Angle = 0:45:360;
DKTSCFMATRIX=[1.60, 3.01, 3.50, 2.54, 4.01, 4.01, 3.61, 2.78, 1.60;
3.28, 3.06, 6.75, 7.34, 3.21, 5.05, 6.39, 4.64, 3.28;
1.16, 2.83, 5.24, 4.30, 2.92, 5.63, 6.55, 3.78, 1.16];
cs = csapi(Angle,DKTSCFMATRIX(1,:));
fnplt(cs,1,'-b^');
handle_axis=gca; % returns handle to current axis
handle_recent_line=handle_axis.Children(1); % returns handle to recent line
set(handle_recent_line,'MarkerFaceColor',handle_recent_line.Color,'MarkerSize',4) % assigns line color to marker face and changes marker size
hold on
cs1 = csapi(Angle,DKTSCFMATRIX(2,:));
fnplt(cs1,1,'-k^');
handle_recent_line=handle_axis.Children(1); % returns handle to recent line
set(handle_recent_line,'MarkerFaceColor',handle_recent_line.Color,'MarkerSize',4) % assigns line color to marker face and changes marker size
cs2 = csapi(Angle,DKTSCFMATRIX(3,:));
fnplt(cs2,1,'-r^');
handle_recent_line=handle_axis.Children(1); % returns handle to recent line
set(handle_recent_line,'MarkerFaceColor',handle_recent_line.Color,'MarkerSize',4) % assigns line color to marker face and changes marker size
ylabel('SCF','fontsize',11)
xlabel('Polar Angle','fontsize',11)
hleg1 = legend('Left Brace','Middle Brace','Right Brace');
grid on
xlim([0 360])
xticks([0:45:360])
title('Stress Concetration Factor Around DKT Joint Periphery')
Note: Here 'gca' function is used to get the current axis object. Here a link on the line properties that can be modified.
Hope this helps.
카테고리
도움말 센터 및 File Exchange에서 Histograms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!