mtex-toolbox / mtex

MTEX is a free Matlab toolbox for quantitative texture analysis. Homepage:
http://mtex-toolbox.github.io/
GNU General Public License v2.0
281 stars 185 forks source link

Bug fix: show correct orientation id on pole figure tooltip #1748

Closed yuchung-chuang closed 1 year ago

yuchung-chuang commented 1 year ago

Hi,

First of all, thank you for making such a great toolbox.

This PR is to address an issue that using plotPDF(orientations) does not show the correct id in the tooltip (therefore the associated Euler angle is also incorrect). The details of this issue can be found in https://github.com/mtex-toolbox/mtex/discussions/1109.

This change can be easily tested by the following code:

CS = crystalSymmetry('6/mmm',[2.95 2.95 4.68], [90 90 120]*degree);
m = Miller({0 0 0 1},{1 1 -2 0},CS);
% plot 10 random orientations
ori = orientation.rand(10,CS);
plotPDF(ori, m)
% now click on the figure and get the id showing from the tooltip
% then plot that orientation on the same figure to see if they match
hold on
plotPDF(ori(id), m) 

Before this change, plotting ori(id) does not match with the selected one. This PR fixes it.

A detailed explanation of this change can be found in https://github.com/mtex-toolbox/mtex/discussions/1109#discussioncomment-5110774.

ralfHielscher commented 1 year ago

Hi Alex,

sorry for not responding to your contribution for such a long time. I highly appreciate our contribution. Thank you very much.

Ralf.