Graphic drawing

128 Views Asked by At

In the visual, 2 different graphics are given in a single frame (layout 1, 2). Both graphs are constrained by y 0: 7.

  1. Data concerning the graph of the column (phonon distribution) "" ZrSbTe.ph_THz "and xmax = 0.885990 The data concerning the 2nd column graph are “ZrSbTe.dos_THz” and 2: 1 (Total), 3: 1 (Zr), 4: 1 (Sb) and 5: 1 (Te) ie the y-axis in the 1st column graph in the file, other columns in the file are taken as the x-axis in the graph. 70% area was used for 1st Chart and 30% for 2nd Chart. Let's get the same graph by paying attention to the colors. Let's load the gnuscript and the output graphic by making a 2 page PDF.

x-coordinates of column labels (you specify y coordinates)

Γ = -0.01
X = 0.13
L = 0.20
T = 0.22
W = 0.251
R = 0.34
X1 = 0.38
Z = 0.50
Γ = 0.575
Y = 0.67
S = 0.715
W = 0.835

enter image description here

1

There are 1 best solutions below

2
On

Your final goal could be split into many different questions and "how-to-dos",... too many without any code and specific question. Keep in mind, for every keyword you can type help <keyword> in the gnuplot console to get some information. Check the gnuplot homepage and the PDF manual in the local doc folder. I assume you are new to gnuplot... check the following example as a starting point. If you have a specific question, please remember: questions always with code.

Code:

### split graph
reset session

$Labels <<EOD
Γ   -0.01
X    0.13
L    0.20
T    0.22
W    0.251
R    0.34
X1   0.38
Z    0.50
Γ    0.575
Y    0.67
S    0.715
W    0.835
EOD

# create some random test data
N=100
set print $PH
    do for [i=0:N] {
        print sprintf("%g %g %g %g %g",-0.01+i*(0.835+0.01)/N, rand(0)*3, rand(0)*3+1, rand(0)*3+3, rand(0)*3+4)
    }
set print $DOS
    print "X Total Zr Sb Te"
    do for [i=0:N] {
        print sprintf("%g %g %g %g %g",-0.01+i*(0.835+0.01)/N, rand(0), rand(0)+1, rand(0)+2, rand(0)+3)
    }
set print

# set lines
do for [i=1:|$Labels|] {
    set arrow i from word($Labels[i],2),graph 0 to word($Labels[i],2), graph 1 nohead lw 1.5 front
}

set ylabel "Frequency / THz"
set key noautotitle opaque box
set colorsequence classic

set multiplot layout 1,2

    set size 0.7,1
    set bmargin 3
    set rmargin 0
    plot for [i=2:5] $PH u 1:i w l lc "dark-grey", \
         $Labels u 2:(NaN):xtic(1)

    set size 0.3,1
    set origin 0.7,0
    set lmargin 0
    set rmargin -1
    unset ylabel
    unset tics
    unset arrow
    set xlabel "DOS"
    plot for [i=2:5] $DOS u i:1 w l ti columnhead(i)
unset multiplot
### end of code

Result:

enter image description here