gnuplot координирующие части нескольких входных файлов в 2 сложенных графика - PullRequest
0 голосов
/ 29 марта 2019

Я пробую функцию мультиплота в первый раз, и, как я читаю здесь другой вопрос, реплота здесь не совсем подходит, но я недостаточно хорошо понимаю gnuplot, чтобы искать альтернативы.

У меня есть два графика с 2 входными файлами каждый.Первый график требует выбора данных по-разному для каждого входного файла (следовательно, повторного графика).Я хотел бы расположить эти два графика в два ряда по 1 столбцу.

Если я удаляю входные данные для любого графика, я могу нанести их по отдельности просто отлично, поэтому синтаксис по крайней мере в такой степени корректен.

Вот мой вклад:

se te po enh co so
se ou "plot_tfoh-2.ipdip"
set xrange[10:50]
set xlabel "{/ -Bold ionization energy [eV]}"
set ylabel "{/ -Bold spectral intensity}" offset 1.25,0
set tics out
set xtics nomirror
set ytics nomirror
set title "{/ -Bold tfoh-2 | Ionization Spectra}" offset 0,-0.5
#FIRST GRAPH (top graph in multiplot)
plot 0 notitle
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 25" w i lt 25
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$20*$20+$19*$19+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 24" w i lt 24
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$19*$19+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 23" w i lt 23
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 22" w i lt 22
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F{/Arial \"}_{py} - F{/Arial '}_{py}" w i lt 21
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F{/Arial \"}_{py} - F{/Arial '}_{pz}" w i lt 20
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 19" w i lt 19
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(O-F)_p" w i lt 18
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 17" w i lt 17
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(O-F)_p" w i lt 16
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 15" w i lt 15
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$6*$6+$5*$5+$4*$4) t "orb 14" w i lt 14
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 13" w i lt 13
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 12" w i lt 12
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 11" w i lt 11
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "O_{2s}" w i lt 10
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$5*$5+$4*$4) t "F{/Arial \"}_{2s}" w i lt 9
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(F{/Arial '} - F{/Arial \"})_{2s}" w i lt 8
replot "//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F_{2s}" w i lt 7
# SECOND GRAPH (bottom graph in multiplot)
plot 0 notitle
replot "//worka/blaise/masters/results/tfoh-2/dip/plot_tfoh-2.dip.input.dat" notitle w i lc rgb 'grey50'
replot "/worka/blaise/masters/results/tfoh-2/dip/final.replotConfig.dat" using 1:2 t "O-F 2h states" w i lc rgb "red"
se te po enh co so
set key top right font ",13"
se ou "ref.plot_tfoh-2.ipdip.ps"
replot

Я был бы очень признателен за любую помощь по этому вопросу.Если я могу добавить больше деталей, пожалуйста, дайте мне знать.

1 Ответ

1 голос
/ 29 марта 2019

Вам необходимо установить мультиплотную среду перед построением графика.На основе вашего примера это будет выглядеть примерно так:

se te po enh co so
se ou "plot_tfoh-2.ipdip.ps"
set xrange[10:50]
set xlabel "{/ -Bold ionization energy [eV]}"
set ylabel "{/ -Bold spectral intensity}" offset 1.25,0
set tics out
set xtics nomirror
set ytics nomirror
set title "{/ -Bold tfoh-2 | Ionization Spectra}" offset 0,-0.5

set multiplot layout 2,1

#FIRST GRAPH (top graph in multiplot)
plot 0 notitle,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 25" w i lt 25,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$20*$20+$19*$19+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 24" w i lt 24,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$19*$19+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 23" w i lt 23,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 22" w i lt 22,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F{/Arial \"}_{py} - F{/Arial '}_{py}" w i lt 21,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$18*$18+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F{/Arial \"}_{py} - F{/Arial '}_{pz}" w i lt 20,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 19" w i lt 19,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$17*$17+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(O-F)_p" w i lt 18,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 17" w i lt 17,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$16*$16+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(O-F)_p" w i lt 16,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$15*$15+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 15" w i lt 15,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$6*$6+$5*$5+$4*$4) t "orb 14" w i lt 14,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$14*$14+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 13" w i lt 13,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$13*$13+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 12" w i lt 12,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$12*$12+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "orb 11" w i lt 11,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$11*$11+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "O_{2s}" w i lt 10,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.2.dat" u 2:(+$5*$5+$4*$4) t "F{/Arial \"}_{2s}" w i lt 9,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$10*$10+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "(F{/Arial '} - F{/Arial \"})_{2s}" w i lt 8,\
"//worka/blaise/masters/results/tfoh-2/ip/plot_tfoh-2.ip.1.dat" u 2:(+$9*$9+$8*$8+$7*$7+$6*$6+$5*$5+$4*$4) t "F_{2s}" w i lt 7


# SECOND GRAPH (bottom graph in multiplot)

plot 0 notitle,\
"//worka/blaise/masters/results/tfoh-2/dip/plot_tfoh-2.dip.input.dat" notitle w i lc rgb 'grey50',\
"/worka/blaise/masters/results/tfoh-2/dip/final.replotConfig.dat" using 1:2 t "O-F 2h states" w i lc rgb "red"

Обратите внимание, что команды replot нет, просто запятые, разделяющие различные компоненты каждой панели.Пожалуйста, обратитесь к документации и demos для дополнительных примеров.

Надеюсь, это поможет!

...