Multiple plots in a single figure not working correctly for pole plots
Mostra commenti meno recenti
Hi,
I was reading a set of crystal euler angles in the format
phi1_1 phi_1 phi2_1
phi1_2 phi_2 phi2_2
...
...
...
phi1_n phi_n phi2_n
from an external file and use the following code to plot the pole figures
filename = 'pcrystal_standard.csv';
fileID = fopen(filename);
C = textscan(fileID,'%f %f %f');
fclose(fileID);
ncrys = cellfun(@length, C(1,1));
for i =1:ncrys
phi1=deg2rad(C{1,1}(i,1));
phi=deg2rad(C{1,2}(i,1));
phi2=deg2rad(C{1,3}(i,1));
ori = orientation.byEuler(phi1,phi,phi2,cs,ss);
h = Miller({1,0,0},cs);
r1 = ori * h.symmetrise;
plot(r1);
hold on;
end
hold off;
After plotting each of the crystal orientations, i hold the plot with "hold on;" to make sure the points are plotted in the same figure. One of the plot corresponding to the upper symmetry elements, fail to recognize the hold and does not add the points, while the lower one does it correctly. Attached figure might explain this better. Not sure why this happens, but probably some one has answers.
7 Commenti
dpb
il 17 Ott 2023
No way to diagnose anything without the data file with which to try to recreate the problem...and any other prerequisites as well.
Arun Prasath
il 18 Ott 2023
filename = 'pcrystal_standard.csv';
fileID = fopen(filename);
C = textscan(fileID,'%f %f %f');
fclose(fileID);
ncrys = cellfun(@length, C(1,1));
for i =1:ncrys
phi1=deg2rad(C{1,1}(i,1));
phi=deg2rad(C{1,2}(i,1));
phi2=deg2rad(C{1,3}(i,1));
ori = orientation.byEuler(phi1,phi,phi2,cs,ss);
h = Miller({1,0,0},cs);
r1 = ori * h.symmetrise;
plot(r1);
hold on;
end
hold off;
Arun Prasath
il 18 Ott 2023
That's expecting a lot from volunteers...why don't you attach the data to plot as .mat file instead?
Better yet, build a complete (simple/small) running example that illustrates the problem. You may find as a pleasant corollary to doing the above what caused the issue in the beginning and thereby solve you own problem...
Voss
il 18 Ott 2023
cs and ss are undefined in the posted code.
Arun Prasath
il 18 Ott 2023
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!