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

add_scale(1e-9) gives wrong scalebar #46

Open
kabiel opened this issue Jun 14, 2024 · 2 comments
Open

add_scale(1e-9) gives wrong scalebar #46

kabiel opened this issue Jun 14, 2024 · 2 comments

Comments

@kabiel
Copy link

kabiel commented Jun 14, 2024

Describe the bug
add_scale(1e-9) gives wrong scalebar:
wrong_scalebar

To Reproduce
test = spm.SXM(test_file).get_channel('[P8]_Lockin_X')
test.add_scale(1e-9) # adds scale bar; something wrong
test.show()
plt.show()

Files
If applicable, upload or link the file you are having a problem with.

System Information
Run the following and attach the result with your issue:

import sys
import pySPM

print("Platform", sys.platform)
print("Python", sys.version)
print("pySPM", pySPM.__version__)

Additional context
Add any other context about the problem here.

@scholi
Copy link
Owner

scholi commented Jun 15, 2024

OK it also took me some time to figure this.
First: you need to plot your image first, then use add_scale
Second: add_scale expect a value (unitless) which is expressed in the same unit as the plot.
Can you try:

test = spm.SXM(test_file).get_channel('[P8]_Lockin_X')
test.show()
test.add_scale(1)
plt.show()

@kabiel
Copy link
Author

kabiel commented Jun 17, 2024 via email

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