scholi / pySPM

Python library to handle Scanning Probe Microscopy Images. Can read nanoscan .xml data, Bruker AFM images, Nanonis SXM files as well as iontof images(ITA, ITM and ITS).
Apache License 2.0
58 stars 33 forks source link

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

Open kabiel opened 3 weeks ago

kabiel commented 3 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago
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: @.***>