pySPM icon indicating copy to clipboard operation
pySPM copied to clipboard

add_scale(1e-9) gives wrong scalebar

Open kabiel opened this issue 1 year ago • 2 comments

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.

kabiel avatar Jun 14 '24 21:06 kabiel

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()

scholi avatar Jun 15 '24 12:06 scholi

Great, thank you!! It works now.  Von: Olivier Scholder ***@***.***>Gesendet: Samstag, Juni 15, 2024 2:47 PMAn: scholi/pySPM ***@***.***>Cc: kabiel ***@***.***>; Author ***@***.***>Betreff: Re: [scholi/pySPM] add_scale(1e-9) gives wrong scalebar (Issue #46) 

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()

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

kabiel avatar Jun 17 '24 11:06 kabiel