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

plot error with matplotlib 3.8.2 #168

Closed
leahwang1962 opened this issue Jan 8, 2024 · 6 comments
Closed

plot error with matplotlib 3.8.2 #168

leahwang1962 opened this issue Jan 8, 2024 · 6 comments

Comments

@leahwang1962
Copy link

Hello,
The Montelmirror.py inside the examples folder works fine with Matplotlib3.5.1, but the below error happens when I upgraded to Matplotlib 3.8.2. Same error with other scripts need plot.

image

Thanks.

@kklmn
Copy link
Owner

kklmn commented Jan 8, 2024

Hi,
The current xrt version is compatible with this new behavior of matplotlib. Please update.

@leahwang1962
Copy link
Author

It is the current version I am using. I just downloaded the zip file from here this afternoon.
image

@kklmn
Copy link
Owner

kklmn commented Jan 8, 2024

No, you are not. The line "del graph.lines[:]" seen in the traceback is now commented out.

Do in your python session:

import xrt
print(xrt.__file__, xrt.__version__)

You will probably see an unexpected location.

@leahwang1962
Copy link
Author

Thanks.
After reinstall, I got the latest version 1.6.0 and the plot part is fine.
However there is another issue when the plot screen rotated 45 degree, or for other random orientation(no error if no rotation). It works fine at 1.4.0 version. Can you let me how I should modify the code? Greatly appreciate.
my code is like this:
beamLine.fsmMontelImage3 =rsc.Screen(beamLine, 'FSM-Montel', (0, p[0] + q[0], 0), (0.70711, 0, 0.707107),(-0.70711, 0, 0.707107))

image

@kklmn
Copy link
Owner

kklmn commented Jan 10, 2024

Hi,
I've fixed this issue. The error is created during formatting a warning output. And the warning is about your x and z local vectors being not strictly orthogonal to each other, cf 0.70711 and 0.707107.
You may download the GH version or just rectify the screen's x and z.

@leahwang1962
Copy link
Author

Great. Thanks a lot.

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