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

PlottingConvention oddities #2014

Open
creuzige opened this issue Dec 14, 2023 · 1 comment
Open

PlottingConvention oddities #2014

creuzige opened this issue Dec 14, 2023 · 1 comment

Comments

@creuzige
Copy link

creuzige commented Dec 14, 2023

What do you want to do?

Following up on the request in #1952 to check the new plotting convention functions in 6.0.beta2

I ran into three issues and two questions:

Issues

  1. I was able to use the "plottingConvention" approach outlined in https://mtex-toolbox.github.io/changelog#1 to change the display axes. However, the figure area seems to default to the prior axes. I've attached the figures as generated. The first one is the original image with default plotting conventions, the second is after changing the plotting conventions

Original image with defaults:

AsImported

With updated plotting conventions:

how2plot.outOfScreen = ebsd_beta.N
how2plot.east = yvector

Rotated

  1. The import wizard still creates a script with variables
setMTEXpref('xAxisDirection','east');
setMTEXpref('yAxisDirection','north');

These don't seem to change the plotting conventions anymore. Maybe these should be replaced with the new commands?

  1. When I pass the 'how2plot' command in each plot function (also shown in plotting convention not considered by plotPDF #1988), things behave as expected but is a bit tedious. However, if I try to store the plotting convention with an ebsd variable I get the following error:
In class 'EBSD', no set method is defined for dependent property 'plottingConvention'.  A dependent property needs a set method
to assign its value.

Error in indexing (line 97)
      ebsd = builtin('subsasgn',ebsd,s,b);

Error in EBSD_plot3D (line 70)
ebsd.plottingConvention = how2plot

The use case I found this is that the EBSD image is flipped in Y; I'm gathering because the Oxford EBSD data seems to start with 0,0 in the upper left corner with Y down...

Questions

  1. How can I view the EBSD data from a 3D perspective? My use case here is that I have a sample that I placed in a goniometer and I am applying external rotations to the EBSD sample and want to align the sample to the goniometer coordinate system.

  2. For alignment of coordinates, did the EBSD 'shift' command get converted to a vector3d as well, or is it still xy only?

What MTEX version do you use?

Using 6.0.beta2, Matlab R2022a, Mac OS 13.6.3

@vtvivian
Copy link
Contributor

vtvivian commented Jan 4, 2024

Hi creuzige,

I found this workaround for issue 3 (missing 'set' method), which is to change the ebsd.plottingConvention.east and ebsd.plottingConvention.outOfScreen fields directly:

e.g. :

ebsd.plottingConvention.east= -vector3d.X;
ebsd.plottingConvention.outOfScreen=vector3d.Z;
% setMTEXpref('xAxisDirection','west');
% setMTEXpref('zAxisDirection','outOfPlane');

figure; plot(ebsd,ebsd.bc,ebsd.plottingConvention)

You still have to pass ebsd.plottingConvention explicitly into plot(), but for me it is convenient as it is one fewer variable to keep track of.

Re: your question 1, does this work? here is an ebsd map at a funny angle:

ebsd.plottingConvention.east= -vector3d.X;
ebsd.plottingConvention.outOfScreen=vector3d(-1,-1,-1);
ebsd.plottingConvention

ans = plottingConvention

outOfScreen: (-1,-1,-1)
north : (0,1,-1)
east : (-2,1,1)

figure; plot(ebsd,ebsd.bc,ebsd.plottingConvention)

funnyangle

Small bug I noticed: the micronbar seems to disappear when the map is rotated in this way - maybe it is drawn in a no-longer-visible position?

Vivian

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

2 participants