Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPDF plotting arrows incorrectly #2072

Open
mbolan5 opened this issue Feb 14, 2024 · 0 comments
Open

IPDF plotting arrows incorrectly #2072

mbolan5 opened this issue Feb 14, 2024 · 0 comments

Comments

@mbolan5
Copy link

mbolan5 commented Feb 14, 2024

I am attempting to simplify the presentation of my rotation data from a plot of every single point to a connected arrow hitting every, say, tenth point.

I'm using the orientation measured along a line through a selected deformed grain. An example snippet is below:

aust_sym = crystalSymmetry('432', [4 4 4], 'mineral', 'Austenite', 'color', [0.53 0.81 0.98])

angles = [70.6491, 41.3549, 5.15433;
          70.6669, 41.3756, 5.03974;
          70.7769, 41.3011, 4.84436;
          70.6721, 41.3515, 5.12568;
          71.1963, 40.9086, 4.51548;]

ori = orientation.byEuler(angles*degree, aust_sym)


plotIPDF(ori(1), vector3d.Y, 'antipodal', 'MarkerSize', 4)
hold on;

for i = 1:4
    plotIPDF(ori(i+1), vector3d.Y, 'antipodal', 'MarkerSize', 4)
    hold on;

    if i == 4
        plotIPDF([ori(i), ori(i+1)], vector3d.Y,'arrow', 'tipAngle', 5)
        hold on;
    else
        plotIPDF([ori(i), ori(i+1)], vector3d.Y,'arrow', 'tipAngle', 0)
        hold on;
    end
end

But when you run the code all of the arrows overshoot, as shown in the image below.

ipdf_unzoomed

I was playing around in debug mode, trying to see how the arrows were drawn, and I stumbled across a fix: if one zooms in after the first point is drawn (so breakpoint at the beginning of the for loop, then zoom in on the first plotted point, then run the loop), the issue resolved. The lines draw properly.

ipdf_zoomed_6x

This is where it gets stranger. When I repeated the test, I didn't zoom in quite as much and some of the arrows drew incorrectly. I tried to come up with a repeatable measurement, so I zoomed using MATLAB's figure zoom button in the top right corner of the figure:

zoom_button

Using that, I found that the arrows will appear to draw correctly if one clicks zoom 6x after the IPDF has been created, but before drawing any arrows. At 5x, errors will exist but will be small. At 4x, they will grow larger. So on until the no magnification case presented above. See images below. Also note that all images have been zoomed in to the same scale after all arrows were drawn for comparability.

5x:
ipdf_zoomed_5x

4x:
ipdf_zoomed_4x

I'm using MTEX 5.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant