Plot Function (fnplt) graph controls

12 Ansichten (letzte 30 Tage)
Ulvi Rahmanli
Ulvi Rahmanli am 27 Aug. 2018
Bearbeitet: Amal George M am 30 Aug. 2018
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 Kommentare
Ulvi Rahmanli
Ulvi Rahmanli am 27 Aug. 2018
Bearbeitet: Ulvi Rahmanli am 27 Aug. 2018
Sorry, they are. What about marker instances and filling them with the same edge colour?
Thanks
madhan ravi
madhan ravi am 27 Aug. 2018
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 .

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Amal George M
Amal George M am 30 Aug. 2018
Bearbeitet: Amal George M am 30 Aug. 2018
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.

Kategorien

Mehr zu Graphics Object Properties finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by