PLaSK library
Loading...
Searching...
No Matches
bands6-plot.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3# Copyright (c) 2022 Lodz University of Technology
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13
14
15from pylab import *
16sqr32 = sqrt(3) / 2.
17
18results = loadtxt('bands6.out', unpack=True)
19
20plot(results[0], sqrt(results[1]**2 + results[2]**2), 'k--')
21
22try:
23 reference = loadtxt('bands.dat', unpack=True)
24except IOError:
25 pass
26else:
27 plot(reference[0], reference[3], '.', color='0.7')
28
29plot(results[0], results[3], '.', color='maroon')
30
31xticks([0., pi*sqr32, pi*(sqr32+0.5), pi*(sqr32+1.5)], ['$\\Gamma$', 'M', 'K', '$\\Gamma$'])
32xlim(0., pi*(sqr32+1.5))
33grid(axis='x')
34
35ylabel("$\\omega/c$")
36
37tight_layout(pad=0.1)
38show()