band-unfolding / bandup

BandUP: Band Unfolding code for Plane-wave based calculations
http://www.ifm.liu.se/theomod/compphys/band-unfolding
GNU General Public License v3.0
98 stars 50 forks source link

vmax and ticks #38

Closed w-yuxuan closed 10 months ago

w-yuxuan commented 10 months ago

Dear Dr. Tsirkin, Thank you for building the amazing bandup package!

When the vmax is less than 1, I noticed that the color bar doesn't show the upper range like attached. Is there a setting for it to show fraction like 0.4? I tried adding: --cb_label --round_cb 2 --disable_auto_round_vmin_and_vmax

Can I make the code display the greek letter gamma? I notice the issue only when I have discontinuities like U,K. I tried // Gamma too. Thank you so much! 0k-4 0to4

stepan-tsirkin commented 10 months ago

Dear @w-yuxuan

First of all, BandUP was developed by @paulovcmedeiros , I just collaborated. Unfortunately, Paulo does not actively maintain the project anymore. Later, I developed a similar tool (but fully in python) banduppy : https://github.com/band-unfolding/banduppy/tree/master/banduppy Could you try that, and say if it works for you? I am able to provide a better support for banduppy.

About v-ticks in colorbar, looks like it is hard-coded to be integers:

https://github.com/band-unfolding/bandup/blob/bd3ff1f38d82787f62b27e8acbfff8a0706231e0/src/python_interface/bandupy/plot.py#L735-L737

So, you will need to modify line 735 to your taste, smth like

cb_yticks = np.linspace(image.norm.vmin, image.norm.vmax + 1, 5) 

Regarding Greek letters, there should not be a problem with matplotlib : https://matplotlib.org/stable/users/explain/text/mathtext.html Did you try to give it as "$\Gamma$"

Please, tell me if this works.

Note: banduppy also has a plotting routine, but much simpler (less options, but easier to understand and modify)

https://github.com/band-unfolding/banduppy/blob/160a60257201c708a6f68809ba13c2a8dd64c34e/banduppy/unfolding_path.py#L165-L222

w-yuxuan commented 10 months ago

thank you so so much for pointing me to the specific line!! Unfortunately it didn't work but "!G " worked. The vmax ticks line worked very well and this is what I ended up to make it even better: cb_yticks = np.linspace(image.norm.vmin, image.norm.vmax, 5, endpoint=True). Thanks for your quick support again!!