plot_chiq_path¶
plot_chiq_path.py [-h] [-d] [--mode {chi,chi0,rpa,scl,rrpa,Iq}]
[--data_out DATA_OUT] [--format FORMAT]
[--label LABEL] [--label-fontsize FONT_SIZE]
[--subfigures SUBFIGURES] [--ymin YMIN] [--ymax YMAX]
[--sharey]
file_qpath file_eigen
Description¶
plot_chiq_path.py
is a script for plotting the susceptibility along a q-path.
Positional Arguments¶
- file_qpath
File name for the q-path data, e.g.
"q_path.dat"
, generated bygen_qpath.py
.- file_eigen
File name for eigenvalues of
chi_q
, e.g."chi_q_eigen.dat"
, generated bychiq_post.py
withmode="eigen"
.
Options¶
- -h, –help
Show this help message and exit.
- -d
Replace \(\chi\) with \(\Delta\chi\) in the y-axis label.
- –mode {chi,chi0,rpa,scl,rrpa,Iq}
Specify the mode for plotting. Default is
chi
.- –data_out DATA_OUT
Specify the filename to export numerical data for the plot.
- –format FORMAT
Specify the format of the output figure, e.g.,
pdf
. The available formats arepdf
,png
,ps
,eps
, andsvg
. Multiple formats can be specified by separating them with commas, e.g.,pdf,png
. The default ispdf
.- –label LABEL, -l LABEL
Specify a filename containing labels of entries to be plotted. The file should be in python dictionary format, e.g.,
{0: "label0", 1: "label1"}
. Skipped entries will not be displayed in the plot.- –label-fontsize FONT_SIZE
Specify the font size for the labels in the plot. The default is 8.
- –subfigures SUBFIGURES, –subfigure SUBFIGURES
Specify a filename to define optional figures that display specific subsets of data. Each line in the file represents one figure and should contain space-separated integers corresponding to the columns to plot.
- –ymin YMIN
Set the lower bound of the y-axis.
- –ymax YMAX
Set the upper bound of the y-axis.
- –sharey
Ensure all figures share the same y-axis range.
Examples¶
Plotting with default mode:
$ plot_chiq_path.py q_path.dat chi_q_eigen.dat
Running plot_chiq_path.py
Namespace(file_qpath='../q_path.dat', file_eigen='chi_q_eigen.dat', d=False, mode='chi', data_out=None, label=None, subfigures=None, ymin=None, ymax=None, sharey=False)
qlabels = [(0.0, 'X'), (0.5, 'Gamma'), (1.20711, 'M'), (1.70711, 'X'), (2.06066, "M'")]
# of q points 57
# of columns 4
'chi_q_eigen_path.pdf'
'chi_q_eigen_path_inv.pdf'
Two files are generated: one is chi_q_eigen_path.pdf
, which shows \(\chi(q)\), and the other is chi_q_eigen_path_inv.pdf
, which shows the inverse \(1/\chi(q)\).
With the --data_out
option, the script generates a text file that is suitable for plotting with other tools such as Gnuplot:
$ plot_chiq_path.py ../q_path.dat chi_q_eigen.dat --data_out chi_q_eigen_path.dat
...
$ cat chi_q_eigen_path.dat
# "X" 0.0, "Gamma" 0.5, "M" 1.20711, "X" 1.70711, "M'" 2.06066,
0.000000000000000000e+00 9.794008258171953418e-01 9.794008258171951198e-01 9.794008258171951198e-01 1.763353990492932954e-04
3.125000000000000000e-02 9.724242604351043262e-01 9.724242604351041042e-01 9.724242604351035490e-01 1.065169599963056157e-04
6.250000000000000000e-02 9.524169229614609655e-01 9.524169229614607435e-01 9.524169229614607435e-01 -1.026114959849500075e-04
9.375000000000000000e-02 9.218696757374871265e-01 9.218696757374870154e-01 9.218696757374866824e-01 -4.499257023655722776e-04
1.250000000000000000e-01 8.841583258152648783e-01 8.841583258152647673e-01 8.841583258152643232e-01 -9.330648057165880083e-04
1.562500000000000000e-01 8.427750433199974189e-01 8.427750433199971969e-01 8.427750433199968638e-01 -1.547676221358762483e-03
1.875000000000000000e-01 8.007532694427048625e-01 8.007532694427044184e-01 8.007532694427044184e-01 -2.286324688140134453e-03
...
The comment on the first line indicates the q-path label. For Gnuplot, one can set the x-label by the command
set xtics ("X" 0.0, "Gamma" 0.5, "M" 1.20711, "X" 1.70711, "M'" 2.06066)