Plotting multiple heat maps from a single data file - gnuplot

I'm actually trying to make a density map but the key word seems to be heat map. Here is my issue. I have a data file which looks like this: (the formatting is weird but it's a 12x12 square matrix with each column separated by space)
#orbital 1
#upspin density
50 49 51 48 54 50 49 46 51 52 49 49
49 52 55 52 53 52 48 51 53 49 50 54
46 54 53 53 52 48 51 53 50 47 49 50
50 51 50 51 47 49 51 55 48 49 48 50
51 53 49 49 49 54 49 49 53 52 51 50
49 51 51 49 55 54 49 51 49 52 50 51
49 46 51 52 49 49 50 49 51 48 54 50
48 51 53 49 50 54 49 52 55 52 53 52
51 53 50 47 49 50 46 54 53 53 52 48
51 55 48 49 48 50 50 51 50 51 47 49
49 49 53 52 51 50 51 53 49 49 49 54
49 51 49 52 50 51 49 51 51 49 55 54
#downspin density
50 49 51 48 54 50 49 46 51 52 49 49
49 52 55 52 53 52 48 51 53 49 50 54
46 54 53 53 52 48 51 53 50 47 49 50
50 51 50 51 47 49 51 55 48 49 48 50
51 53 49 49 49 54 49 49 53 52 51 50
49 51 51 49 55 54 49 51 49 52 50 51
49 46 51 52 49 49 50 49 51 48 54 50
48 51 53 49 50 54 49 52 55 52 53 52
51 53 50 47 49 50 46 54 53 53 52 48
51 55 48 49 48 50 50 51 50 51 47 49
49 49 53 52 51 50 51 53 49 49 49 54
49 51 49 52 50 51 49 51 51 49 55 54
#upspin + downspin
100 98 102 96 107 99 97 91 102 103 97 97
98 103 110 103 105 104 96 101 106 97 99 107
91 108 106 106 103 95 101 105 100 93 97 100
100 101 99 101 93 98 102 109 96 98 95 99
101 105 97 97 98 108 98 98 106 103 102 99
97 102 101 98 109 108 97 102 97 103 100 101
97 91 102 103 97 97 100 98 102 96 107 99
96 101 106 97 99 107 98 103 110 103 105 104
101 105 100 93 97 100 91 108 106 106 103 95
102 109 96 98 95 99 100 101 99 101 93 98
98 98 106 103 102 99 101 105 97 97 98 108
97 102 97 103 100 101 97 102 101 98 109 108
#upspin - downspin
0 0 1 1 0 0 0 0 0 1 1 0
0 0 1 1 0 1 1 0 0 1 0 0
1 1 1 0 1 0 1 1 0 0 0 0
0 0 1 1 1 1 1 1 0 1 0 0
1 1 0 1 0 1 1 1 1 0 1 1
1 0 1 1 1 0 1 0 1 0 1 0
0 1 1 0 1 0 0 1 0 1 0 0
1 1 0 1 1 1 1 0 1 1 1 1
0 1 1 1 1 0 0 0 0 0 0 0
1 1 0 1 1 1 0 1 0 1 1 0
1 0 0 1 1 0 0 0 1 1 1 1
1 0 0 0 1 0 1 0 0 0 0 1
#atom 1
#total upspin density downspin density
50 49 51 48 54 50 49 46 51 52 49 49
49 52 55 52 53 52 48 51 53 49 50 54
46 54 53 53 52 48 51 53 50 47 49 50
50 51 50 51 47 49 51 55 48 49 48 50
51 53 49 49 49 54 49 49 53 52 51 50
49 51 51 49 55 54 49 51 49 52 50 51
49 46 51 52 49 49 50 49 51 48 54 50
48 51 53 49 50 54 49 52 55 52 53 52
51 53 50 47 49 50 46 54 53 53 52 48
51 55 48 49 48 50 50 51 50 51 47 49
49 49 53 52 51 50 51 53 49 49 49 54
49 51 49 52 50 51 49 51 51 49 55 54
#total downspin density
50 49 51 48 54 50 49 46 51 52 49 49
49 52 55 52 53 52 48 51 53 49 50 54
46 54 53 53 52 48 51 53 50 47 49 50
50 51 50 51 47 49 51 55 48 49 48 50
51 53 49 49 49 54 49 49 53 52 51 50
49 51 51 49 55 54 49 51 49 52 50 51
49 46 51 52 49 49 50 49 51 48 54 50
48 51 53 49 50 54 49 52 55 52 53 52
51 53 50 47 49 50 46 54 53 53 52 48
51 55 48 49 48 50 50 51 50 51 47 49
49 49 53 52 51 50 51 53 49 49 49 54
49 51 49 52 50 51 49 51 51 49 55 54
I am trying to write a script that takes these matrices and make an individual "heat map" for each. My issue is that when I run the script I'm getting an error that says the data doesn't represent a grid.My script is below. An additional question is what are the acceptable formats for gnuplot to read a matrix?
set size ratio 1
set cbrange [0:0.5]
set palette defined (0 "red", 1 "blue")
set autoscale xfix
set autoscale yfix
set xtics 1
set ytics 1
set title "8x8 spin"
set tics scale 0,0.001
set mxtics 2
set mytics 2
set grid front mxtics mytics lw 1.5 lt -1 lc rgb 'white'
plot "densityarrays.d" matrix w image notitle
set term png enhanced
set output "/home/thecollective/Desktop/plots/plot1.png"
replot

Related

Python-3 - get values from list by frequency and then by the values with equal counts in descending order

I have list of integers, from which I would first like to get unique numbers, first ordered by their occurrences and then the numbers with equal counts should be ordered in descending order.
example 1:
input1 = [1,2,2,1,6,2,1,7]
expected output = [2,1,7,6]
explanation: both 2 and 1 appear thrice while 6 and 7 appear once. so, the numbers occurring thrice will be placed first and in descending order; and same for the set that appears once.
another example case:
input_2 = list(map(int, '40 29 2 44 30 79 46 85 118 66 113 52 55 63 48 99 123 51 110 66 40 115 107 46 6 114 36 99 13 108 85 39 14 121 42 37 56 11 104 28 24 123 63 51 118 52 120 28 64 43 44 86 42 71 101 78 93 1 6 14 42 33 88 107 35 70 74 30 54 76 27 91 115 71 63 103 94 109 39 4 16 108 97 83 29 57 86 121 53 94 28 7 5 31 123 21 2 17 112 104 75 124 88 30 108 14 65 118 28 81 80 14 14 107 21 60 47 97 50 53 19 112 43 46'.split()))
output_2 = list(map(int, '14 28 123 118 108 107 63 46 42 30 121 115 112 104 99 97 94 88 86 85 71 66 53 52 51 44 43 40 39 29 21 6 2 124 120 114 113 110 109 103 101 93 91 83 81 80 79 78 76 75 74 70 65 64 60 57 56 55 54 50 48 47 37 36 35 33 31 27 24 19 17 16 13 11 7 5 4 1'.split()))
This was from a coding test I took. This must be solved without using functions from imports like collections, itertools etc,. and using functions already available in python's namespace like dict, sorted is allowed. How do I do this as efficiently as possible?
def sort_sort(input1):
a = {i:input1.count(i) for i in set(input1)}
b ={i:[] for i in set(a.values())}
for k,v in a.items():
b[v].append(k)
for v in b.values():
v.sort(reverse=True)
output=[]
quays =list(b.keys())
quays.sort(reverse=True)
for q in quays:
output +=b[q]
print(output)

amend a subarray in place in j?

I've got two ways to amend a subarray in J but I don't like either of them.
(Imagine selecting a rectangle in a paint program and applying some arbitrary
operation to that rectangle in place.)
t =. i. 10 10 NB. table to modify
xy=. 2 3 [ wh =. 3 2 NB. region i want want to modify
u =. -#|. NB. operation to perform on region
I can fetch the subarray and apply the
operation in one step with cut (;.0):
st =. ((,./xy),:(|,./wh)) u;.0 t
Putting it back is easy enough, but seems to require
building a large boxed array of indices:
(,st) (xy&+each,{;&:i./wh) } t
I also tried recursively splitting and glueing
the table into four "window panes" at a time:
split =: {. ; }. NB. split y into 2 subarrays at index x
panes =: {{ 2 2$ ; |:L:0 X split&|:&.> Y split y [ 'Y X'=.x }}
glue =: [: ,&>/ ,.&.>/"1 NB. reassamble
xy panes t
┌────────┬────────────────────┐
│ 0 1 2│ 3 4 5 6 7 8 9│
│10 11 12│13 14 15 16 17 18 19│
├────────┼────────────────────┤
│20 21 22│23 24 25 26 27 28 29│
│30 31 32│33 34 35 36 37 38 39│
│40 41 42│43 44 45 46 47 48 49│
│50 51 52│53 54 55 56 57 58 59│
│60 61 62│63 64 65 66 67 68 69│
│70 71 72│73 74 75 76 77 78 79│
│80 81 82│83 84 85 86 87 88 89│
│90 91 92│93 94 95 96 97 98 99│
└────────┴────────────────────┘
NB. then split the lower right pane again,
NB. extract *its* upper left pane...
s0 =. 1 1 {:: p0 =. xy panes t
s1 =. 0 0 {:: p1 =. wh panes s0
NB. apply the operation and reassemble:
p1a =. (<u s1) (<0 0) } p1
glue (<glue p1a) (<1 1) } p0
The first approach seems to be the quicker and
easier option, but it feels like there ought
to be a more primitive way to apply a verb at
a sub-array without extracting it, or to paste
in a subarray at some coordinates without manually
creating the array of indices for each element.
Have I missed a better option?
I would begin by creating the set of indices that I wanted to amend
[ ind =. < xy + each i. each wh
┌───────────┐
│┌─────┬───┐│
││2 3 4│3 4││
│└─────┴───┘│
└───────────┘
I can use those to select the atoms I want from t
ind { t
23 24
33 34
43 44
And if I can select with them then I can use the same indices to amend t
_ ind } t
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 _ _ 25 26 27 28 29
30 31 32 _ _ 35 36 37 38 39
40 41 42 _ _ 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89
90 91 92 93 94 95 96 97 98 99
and finally I can use a hook with the left tine being ind}~ after preprocessing t with the right tine (ind u#{ ]) to get my result
(ind}~ ind u#{ ]) t
0 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19
20 21 22 _43 _44 25 26 27 28 29
30 31 32 _33 _34 35 36 37 38 39
40 41 42 _23 _24 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89
90 91 92 93 94 95 96 97 98 99
You actually gave me the solution when you asked how you can 'amend' your array in place.

Stacking XRD plot using multiplot : Discussion on random texts appearing in eps terminal

I wish to plot XRD patterns in a multiplot environment. The XRD patterns are plotted separately and they seem to be fine but the stacked plot shows random texts, symbols at various multiplots. Data file is given below.
# XRD
15 117 182 176 189
15.05 129 207 186 166
15.1 129 213 158 144
15.15 137 156 159 167
15.2 148 191 179 150
15.25 116 202 176 142
15.3 162 206 153 139
15.35 125 184 129 147
15.4 130 180 146 150
15.45 145 212 134 137
15.5 119 193 166 127
15.55 118 195 152 161
15.6 148 201 150 131
15.65 122 188 152 154
15.7 121 172 142 155
15.75 125 163 129 141
15.8 121 180 123 151
15.85 124 170 134 135
15.9 118 197 126 147
15.95 135 185 153 142
16 127 161 154 162
16.05 126 196 155 151
16.1 105 184 146 157
16.15 123 191 133 128
16.2 115 185 128 130
16.25 143 184 140 126
16.3 112 164 178 135
16.35 119 174 123 136
16.4 113 168 130 133
16.45 111 188 123 143
16.5 120 179 109 165
16.55 113 156 131 128
16.6 105 175 153 136
16.65 119 170 114 143
16.7 117 155 151 143
16.75 112 144 141 130
16.8 116 153 142 148
16.85 128 166 121 137
16.9 119 136 124 152
16.95 91 160 111 124
17 95 153 123 125
17.05 119 140 133 133
17.1 112 140 134 127
17.15 114 152 118 129
17.2 123 164 113 139
17.25 106 155 134 120
17.3 114 153 121 120
17.35 100 151 118 142
17.4 105 152 119 152
17.45 86 127 117 133
17.5 105 156 118 129
17.55 90 150 117 143
17.6 94 137 116 117
17.65 104 150 95 118
17.7 102 140 89 129
17.75 99 146 114 128
17.8 123 142 115 126
17.85 93 146 149 128
17.9 90 147 125 135
17.95 86 121 102 136
18 91 123 110 124
18.05 99 117 103 140
18.1 106 125 88 138
18.15 93 124 91 118
18.2 94 138 100 133
18.25 108 108 115 110
18.3 97 122 111 118
18.35 92 132 90 124
18.4 88 130 101 129
18.45 94 120 112 118
18.5 108 124 94 150
18.55 100 118 105 110
18.6 87 136 134 112
18.65 121 107 85 130
18.7 94 131 101 124
18.75 86 134 104 117
18.8 108 138 107 122
18.85 101 133 112 113
18.9 83 112 88 126
18.95 94 107 123 123
19 83 137 110 123
19.05 85 136 102 137
19.1 107 110 82 122
19.15 82 121 92 118
19.2 84 128 114 141
19.25 94 109 103 108
19.3 81 119 102 105
19.35 96 119 95 112
19.4 84 82 86 120
19.45 88 105 97 106
19.5 119 114 91 134
19.55 77 91 102 125
19.6 84 124 108 133
19.65 73 117 92 121
19.7 86 119 104 134
19.75 75 125 84 135
19.8 108 122 80 121
19.85 89 91 91 104
19.9 80 90 105 132
19.95 85 108 78 131
20 88 114 93 129
20.05 92 97 78 142
20.1 96 111 105 120
20.15 88 114 94 115
20.2 84 100 86 121
20.25 100 100 80 132
20.3 94 84 88 147
20.35 84 101 78 111
20.4 78 105 89 112
20.45 81 86 98 129
20.5 86 111 89 127
20.55 92 92 83 120
20.6 85 90 86 121
20.65 74 90 89 141
20.7 83 103 71 141
20.75 74 98 99 114
20.8 87 75 83 149
20.85 67 96 82 154
20.9 85 93 80 174
20.95 83 109 95 157
21 90 97 83 211
21.05 81 105 66 277
21.1 87 94 86 446
21.15 84 97 92 443
21.2 83 101 90 446
21.25 84 100 88 421
21.3 86 107 90 357
21.35 92 97 101 297
21.4 92 112 89 352
21.45 73 108 91 321
21.5 97 130 94 346
21.55 96 128 90 480
21.6 88 121 88 663
21.65 95 107 74 941
21.7 93 95 75 1106
21.75 83 83 67 1078
21.8 91 101 70 966
21.85 91 108 78 815
21.9 76 95 87 792
21.95 85 74 94 629
22 89 86 70 593
22.05 87 81 88 402
22.1 72 73 81 289
22.15 85 90 69 240
22.2 71 94 76 188
22.25 68 74 70 160
22.3 75 96 72 146
22.35 63 82 64 156
22.4 64 77 61 145
22.45 76 84 73 140
22.5 72 98 64 128
22.55 78 73 91 126
22.6 62 95 64 113
22.65 80 74 80 119
22.7 80 85 72 132
22.75 78 80 79 98
22.8 85 72 78 140
22.85 62 88 69 115
22.9 74 94 71 126
22.95 84 91 78 131
23 73 69 79 106
23.05 76 78 66 133
23.1 83 84 79 115
23.15 48 84 77 97
23.2 74 91 62 111
23.25 79 99 58 116
23.3 75 77 53 126
23.35 70 94 67 163
23.4 94 84 70 161
23.45 80 74 69 175
23.5 79 74 65 213
23.55 69 75 67 206
23.6 73 91 72 225
23.65 55 78 81 191
23.7 72 99 68 180
23.75 59 87 81 191
23.8 87 100 69 183
23.85 76 95 76 172
23.9 70 97 74 207
23.95 76 90 75 281
24 74 87 69 359
24.05 76 81 67 443
24.1 89 74 68 472
24.15 79 72 53 429
24.2 84 73 72 345
24.25 72 82 59 313
24.3 69 71 71 300
24.35 74 92 85 283
24.4 72 94 65 245
24.45 85 89 69 186
24.5 65 90 80 156
24.55 85 100 69 102
24.6 68 77 69 116
24.65 71 74 76 121
24.7 70 77 61 119
24.75 70 75 70 118
24.8 75 65 70 115
24.85 73 73 80 124
24.9 79 93 62 98
24.95 76 76 78 104
25 78 75 55 95
25.05 68 77 66 107
25.1 67 82 71 83
25.15 62 73 74 106
25.2 72 88 56 113
25.25 65 86 65 108
25.3 78 70 71 103
25.35 74 73 63 93
25.4 67 62 90 110
25.45 77 98 74 88
25.5 70 78 60 101
25.55 82 81 54 107
25.6 80 62 65 97
25.65 64 91 64 95
25.7 71 74 71 91
25.75 67 75 58 81
25.8 70 78 74 76
25.85 73 95 62 94
25.9 80 78 67 96
25.95 69 86 66 88
26 61 71 71 102
26.05 82 72 63 95
26.1 86 75 57 106
26.15 83 80 62 84
26.2 88 74 65 85
26.25 68 76 60 104
26.3 78 70 58 92
26.35 66 74 70 107
26.4 71 68 60 93
26.45 69 81 77 105
26.5 61 74 79 81
26.55 73 81 60 82
26.6 74 79 56 84
26.65 83 97 81 97
26.7 72 78 64 92
26.75 82 79 66 104
26.8 84 77 49 85
26.85 72 79 58 95
26.9 68 77 70 89
26.95 72 82 62 82
27 63 75 68 83
27.05 66 74 66 82
27.1 68 78 48 102
27.15 65 85 52 93
27.2 75 71 64 78
27.25 72 80 83 79
27.3 66 84 57 92
27.35 58 83 56 82
27.4 67 67 51 82
27.45 73 91 54 83
27.5 74 82 67 89
27.55 84 87 68 79
27.6 80 79 73 101
27.65 82 58 70 100
27.7 70 85 62 96
27.75 71 65 76 85
27.8 70 73 68 71
27.85 76 81 55 89
27.9 73 65 58 91
27.95 85 75 65 95
28 82 77 64 79
28.05 75 89 64 74
28.1 70 85 60 88
28.15 85 73 55 96
28.2 80 94 71 86
28.25 96 84 94 114
28.3 126 101 99 130
28.35 173 172 136 133
28.4 219 257 164 189
28.45 270 213 188 258
28.5 214 230 153 232
28.55 158 139 127 192
28.6 105 110 80 171
28.65 78 84 75 122
28.7 75 72 56 112
28.75 82 79 66 97
28.8 83 69 66 97
28.85 74 63 79 81
28.9 79 65 64 93
28.95 77 80 71 77
29 61 55 62 89
29.05 75 71 64 93
29.1 75 81 69 91
29.15 65 93 78 90
29.2 69 75 63 80
29.25 79 86 60 74
29.3 68 89 64 80
29.35 78 73 78 83
29.4 74 73 66 78
29.45 57 88 72 92
29.5 75 63 79 99
29.55 65 70 79 73
29.6 69 87 69 103
29.65 83 75 48 86
29.7 72 72 59 92
29.75 69 60 68 77
29.8 65 66 58 93
29.85 68 82 74 89
29.9 89 76 75 78
29.95 79 69 73 100
30 84 76 73 108
30.05 110 86 84 101
30.1 129 129 102 124
30.15 146 140 114 154
30.2 150 159 127 186
30.25 136 152 124 157
30.3 117 101 88 169
30.35 81 94 77 125
30.4 72 76 77 120
30.45 85 86 69 116
30.5 75 96 78 91
30.55 71 66 61 64
30.6 70 76 61 92
30.65 72 65 74 97
30.7 87 78 53 84
30.75 67 59 64 92
30.8 71 71 81 82
30.85 75 74 72 79
30.9 80 89 81 56
30.95 76 68 67 87
31 78 68 62 80
31.05 72 72 69 65
31.1 66 69 61 82
31.15 85 72 64 80
31.2 61 67 72 75
31.25 62 73 70 79
31.3 69 60 64 73
31.35 75 74 59 77
31.4 51 69 58 76
31.45 48 59 58 75
31.5 55 73 71 76
31.55 77 77 67 64
31.6 66 66 64 90
31.65 84 74 74 81
31.7 64 71 78 88
31.75 69 79 64 85
31.8 74 79 56 65
31.85 53 67 72 72
31.9 77 57 55 68
31.95 68 66 72 89
32 74 74 80 80
32.05 53 82 61 77
32.1 67 63 66 74
32.15 61 72 67 77
32.2 68 56 66 75
32.25 77 74 48 87
32.3 62 71 60 75
32.35 57 38 63 79
32.4 62 62 78 72
32.45 62 59 70 73
32.5 62 69 63 70
32.55 66 71 56 75
32.6 56 66 65 70
32.65 55 71 52 80
32.7 62 69 62 79
32.75 61 75 68 75
32.8 67 76 66 66
32.85 74 66 63 71
32.9 49 87 78 83
32.95 66 64 71 65
33 82 75 74 86
33.05 57 50 74 88
33.1 59 68 60 77
33.15 61 73 66 77
33.2 62 62 82 70
33.25 74 67 62 85
33.3 60 71 76 72
33.35 72 63 52 70
33.4 66 56 66 77
33.45 71 64 55 74
33.5 58 61 42 66
33.55 66 58 52 79
33.6 59 53 52 69
33.65 66 60 46 76
33.7 53 73 51 84
33.75 70 65 66 71
33.8 52 52 49 73
33.85 66 66 86 74
33.9 58 78 62 82
33.95 65 65 63 87
34 47 53 62 75
34.05 51 63 60 80
34.1 56 77 53 74
34.15 55 53 64 69
34.2 77 49 53 63
34.25 70 82 61 86
34.3 64 69 52 52
34.35 59 67 51 73
34.4 62 77 70 71
34.45 51 58 73 65
34.5 62 78 65 55
34.55 48 69 66 74
34.6 45 70 52 66
34.65 59 72 68 77
34.7 65 62 56 69
34.75 64 68 58 64
34.8 83 73 78 75
34.85 75 112 74 88
34.9 125 136 92 95
34.95 149 139 104 120
35 152 129 103 125
35.05 120 142 97 140
35.1 84 104 80 104
35.15 76 66 76 94
35.2 70 84 70 99
35.25 63 67 60 74
35.3 68 60 62 88
35.35 51 70 52 78
35.4 64 57 62 63
35.45 62 56 43 66
35.5 58 71 63 62
35.55 63 66 57 80
35.6 67 53 57 63
35.65 68 56 59 61
35.7 62 49 46 67
35.75 58 55 66 82
35.8 59 49 49 63
35.85 48 70 57 73
35.9 53 45 47 58
35.95 55 64 43 72
36 54 52 46 71
36.05 56 68 51 74
36.1 49 59 62 96
36.15 53 56 49 93
36.2 66 57 59 92
36.25 60 60 49 99
36.3 63 62 52 113
36.35 61 59 57 102
36.4 48 61 51 107
36.45 67 53 45 81
36.5 61 59 65 84
36.55 50 62 42 101
36.6 48 57 51 72
36.65 46 67 59 66
36.7 70 63 54 86
36.75 54 61 55 61
36.8 62 63 40 61
36.85 62 52 60 51
36.9 45 69 43 77
36.95 56 59 45 71
37 44 73 50 72
37.05 59 58 53 64
37.1 58 42 42 48
37.15 53 52 53 57
37.2 49 64 51 52
37.25 49 54 45 54
37.3 54 56 56 62
37.35 51 50 64 64
37.4 48 68 44 67
37.45 49 58 46 61
37.5 56 45 63 64
37.55 47 51 37 55
37.6 53 60 51 79
37.65 50 46 45 69
37.7 47 45 44 60
37.75 48 45 53 68
37.8 64 60 46 65
37.85 61 45 41 71
37.9 56 57 45 66
37.95 44 54 55 70
38 44 43 51 72
38.05 43 52 48 73
38.1 45 52 46 48
38.15 51 57 34 66
38.2 61 59 50 70
38.25 48 57 53 65
38.3 39 51 46 62
38.35 58 48 43 58
38.4 50 57 45 71
38.45 56 57 55 70
38.5 49 54 45 59
38.55 54 49 65 85
38.6 47 47 48 60
38.65 47 49 65 78
38.7 46 45 54 73
38.75 49 55 56 78
38.8 43 50 51 64
38.85 50 51 46 79
38.9 51 51 45 75
38.95 60 44 50 56
39 69 51 64 60
39.05 46 49 46 61
39.1 68 47 42 78
39.15 44 61 44 79
39.2 42 39 46 66
39.25 46 48 45 72
39.3 52 55 48 75
39.35 43 62 44 65
39.4 46 55 47 60
39.45 52 55 48 78
39.5 57 49 50 68
39.55 46 58 54 68
39.6 48 51 41 80
39.65 47 53 53 81
39.7 51 48 43 78
39.75 61 57 51 78
39.8 48 55 45 83
39.85 53 43 64 80
39.9 59 52 55 77
39.95 46 47 46 69
40 53 57 38 83
40.05 51 48 51 79
40.1 49 50 47 66
40.15 56 40 48 71
40.2 49 62 51 91
40.25 50 65 52 91
40.3 52 72 56 87
40.35 58 61 64 109
40.4 62 63 95 83
40.45 99 89 84 105
40.5 119 127 112 112
40.55 161 160 161 185
40.6 135 183 185 206
40.65 163 176 168 220
40.7 130 158 136 213
40.75 105 119 107 190
40.8 80 80 57 168
40.85 68 67 66 125
40.9 53 71 42 110
40.95 55 65 48 100
41 53 48 58 91
41.05 54 53 52 83
41.1 59 50 53 73
41.15 56 56 59 71
41.2 53 57 56 72
41.25 52 49 50 69
41.3 46 51 46 65
41.35 47 56 45 73
41.4 44 46 60 75
41.45 57 56 55 69
41.5 49 47 31 72
41.55 48 45 50 74
41.6 42 54 50 83
41.65 45 59 56 76
41.7 46 44 39 76
41.75 48 53 47 69
41.8 44 62 51 56
41.85 51 51 44 74
41.9 45 57 38 85
41.95 54 44 39 81
42 44 61 46 72
42.05 46 52 41 72
42.1 43 53 35 90
42.15 53 50 50 73
42.2 50 49 58 88
42.25 38 41 55 82
42.3 42 51 46 61
42.35 51 33 42 77
42.4 51 51 59 59
42.45 42 35 46 80
42.5 36 45 44 80
42.55 36 39 47 76
42.6 53 46 66 76
42.65 44 45 50 79
42.7 38 41 43 76
42.75 45 34 31 63
42.8 55 58 50 84
42.85 33 46 42 78
42.9 50 46 43 70
42.95 58 55 58 66
43 48 48 52 72
43.05 46 61 65 81
43.1 51 47 41 77
43.15 44 57 40 74
43.2 58 63 41 80
43.25 47 47 45 73
43.3 47 38 47 79
43.35 59 43 49 70
43.4 42 53 33 78
43.45 50 43 43 59
43.5 50 51 67 62
43.55 45 45 52 89
43.6 48 48 57 74
43.65 51 57 38 62
43.7 38 37 42 84
43.75 51 63 47 80
43.8 57 44 50 93
43.85 49 50 45 93
43.9 59 54 37 93
43.95 40 48 34 77
44 41 63 39 87
44.05 39 50 56 75
44.1 37 49 53 90
44.15 43 49 48 59
44.2 43 59 52 60
44.25 52 60 41 78
44.3 50 44 52 71
44.35 46 47 49 70
44.4 41 44 37 65
44.45 48 45 47 55
44.5 44 46 44 78
44.55 40 42 33 76
44.6 47 58 40 64
44.65 39 49 51 64
44.7 49 48 42 74
44.75 49 62 47 65
44.8 44 48 49 61
44.85 38 53 46 73
44.9 44 41 37 59
44.95 53 47 32 60
45 46 39 44 62
45.05 51 52 32 62
45.1 31 42 49 63
45.15 38 49 41 66
45.2 51 57 46 63
45.25 42 46 38 60
45.3 47 53 46 59
45.35 46 49 45 64
45.4 37 59 45 61
45.45 66 40 46 62
45.5 53 53 45 67
45.55 40 52 36 63
45.6 45 56 48 62
45.65 39 49 42 62
45.7 47 39 45 71
45.75 39 41 54 58
45.8 45 52 42 66
45.85 38 50 38 57
45.9 48 55 43 56
45.95 42 55 45 52
46 35 49 30 59
46.05 46 57 53 58
46.1 45 41 37 60
46.15 34 39 44 55
46.2 55 45 44 65
46.25 39 53 39 63
46.3 35 52 53 61
46.35 50 38 43 55
46.4 32 47 27 67
46.45 49 45 53 49
46.5 50 49 50 59
46.55 36 56 42 70
46.6 46 44 49 54
46.65 51 56 42 64
46.7 41 50 37 63
46.75 41 54 45 55
46.8 53 43 49 51
46.85 54 51 55 54
46.9 50 55 22 64
46.95 43 51 35 58
47 44 47 39 57
47.05 61 57 31 60
47.1 36 43 35 61
47.15 43 42 49 77
47.2 48 49 48 59
47.25 38 41 47 71
47.3 46 49 39 70
47.35 48 59 36 66
47.4 51 40 30 47
47.45 42 42 39 72
47.5 51 55 43 65
47.55 37 36 44 64
47.6 40 49 51 64
47.65 49 41 40 48
47.7 33 41 50 60
47.75 36 46 44 60
47.8 41 51 50 64
47.85 49 48 54 76
47.9 39 39 45 64
47.95 42 53 50 52
48 58 58 38 41
48.05 51 37 51 60
48.1 43 40 51 76
48.15 48 46 50 51
48.2 46 49 42 55
48.25 34 58 37 45
48.3 44 49 26 66
48.35 39 63 54 68
48.4 44 48 47 61
48.45 46 48 46 61
48.5 35 49 36 63
48.55 35 46 39 61
48.6 51 48 44 55
48.65 43 61 53 52
48.7 45 61 50 51
48.75 54 38 45 53
48.8 48 59 52 69
48.85 41 60 50 68
48.9 49 50 41 54
48.95 52 52 49 62
49 36 51 42 59
49.05 42 58 48 57
49.1 38 43 41 44
49.15 44 57 51 56
49.2 44 46 45 71
49.25 38 57 41 58
49.3 49 57 28 69
49.35 54 39 44 63
49.4 52 54 52 50
49.45 39 56 45 59
49.5 41 51 58 58
49.55 66 58 63 57
49.6 51 44 58 76
49.65 38 51 50 54
49.7 34 60 52 55
49.75 52 51 51 47
49.8 46 51 53 53
49.85 60 55 52 51
49.9 47 47 55 54
49.95 45 54 39 57
50 68 73 58 55
50.05 66 86 50 70
50.1 68 87 79 78
50.15 89 98 114 75
50.2 133 156 143 105
50.25 137 152 160 169
50.3 125 162 185 162
50.35 124 141 121 132
50.4 103 113 105 127
50.45 88 78 77 118
50.5 72 74 66 72
50.55 59 65 54 60
50.6 56 57 55 62
50.65 46 46 56 58
50.7 39 53 45 57
50.75 51 57 57 53
50.8 27 58 41 52
50.85 45 53 34 62
50.9 41 54 60 50
50.95 43 55 40 47
51 51 49 52 68
51.05 49 51 47 51
51.1 45 64 54 51
51.15 38 48 52 51
51.2 48 43 48 50
51.25 43 57 37 59
51.3 42 40 54 55
51.35 44 39 63 57
51.4 45 50 41 46
51.45 49 44 58 52
51.5 40 51 56 57
51.55 43 40 56 59
51.6 37 42 42 72
51.65 50 47 53 47
51.7 47 43 48 61
51.75 37 57 44 60
51.8 39 59 46 65
51.85 43 62 42 70
51.9 42 47 41 60
51.95 40 51 41 65
52 45 45 64 56
52.05 34 44 58 61
52.1 32 43 70 62
52.15 43 49 58 62
52.2 37 50 47 66
52.25 47 52 43 82
52.3 62 42 58 62
52.35 36 49 54 62
52.4 45 44 41 67
52.45 36 48 37 68
52.5 37 48 52 65
52.55 38 46 50 63
52.6 37 47 59 62
52.65 35 43 45 56
52.7 38 52 49 69
52.75 47 47 47 66
52.8 40 38 47 67
52.85 50 54 47 62
52.9 50 50 38 56
52.95 44 40 54 59
53 44 58 30 63
53.05 35 56 54 53
53.1 46 43 48 43
53.15 43 49 52 57
53.2 40 40 40 56
53.25 57 47 47 63
53.3 29 45 38 57
53.35 39 49 56 63
53.4 39 38 50 66
53.45 43 44 48 64
53.5 51 52 43 65
53.55 44 61 42 51
53.6 53 59 45 63
53.65 40 57 50 62
53.7 41 56 47 50
53.75 59 23 47 66
53.8 46 47 35 57
53.85 46 42 47 67
53.9 57 60 42 53
53.95 52 43 50 62
54 48 52 44 60
54.05 50 50 31 57
54.1 40 50 54 55
54.15 42 45 43 38
54.2 46 52 47 59
54.25 48 45 40 54
54.3 47 42 44 49
54.35 42 45 47 53
54.4 49 48 47 55
54.45 43 42 48 54
54.5 43 50 49 54
54.55 54 45 41 57
54.6 44 53 42 59
54.65 40 47 41 45
54.7 45 35 49 58
54.75 34 37 47 52
54.8 42 53 45 48
54.85 40 58 41 56
54.9 34 50 47 51
54.95 43 42 37 53
55 51 51 59 63
55.05 56 55 48 55
55.1 42 37 42 39
55.15 37 48 39 67
55.2 41 52 41 61
55.25 49 52 47 61
55.3 53 39 40 71
55.35 46 51 40 61
55.4 47 51 44 53
55.45 39 43 34 57
55.5 43 49 54 57
55.55 43 40 40 58
55.6 41 37 56 57
55.65 38 50 41 56
55.7 36 51 35 56
55.75 55 47 43 62
55.8 45 51 45 59
55.85 37 56 40 45
55.9 47 47 45 54
55.95 50 36 44 44
56 46 44 54 52
56.05 51 47 43 58
56.1 51 48 45 53
56.15 56 42 32 65
56.2 31 43 46 63
56.25 44 53 47 47
56.3 41 35 35 54
56.35 45 49 43 55
56.4 45 47 34 54
56.45 49 44 40 56
56.5 45 45 49 59
56.55 60 61 59 65
56.6 30 52 53 50
56.65 38 51 46 57
56.7 51 54 53 39
56.75 54 54 46 36
56.8 45 39 51 63
56.85 38 55 45 57
56.9 40 57 43 56
56.95 41 38 45 58
57 36 42 37 69
57.05 35 60 45 49
57.1 45 47 38 48
57.15 41 39 46 47
57.2 49 51 42 67
57.25 36 42 29 51
57.3 38 40 29 52
57.35 43 47 45 53
57.4 43 62 32 57
57.45 41 41 45 69
57.5 42 54 39 53
57.55 42 52 30 65
57.6 41 40 47 71
57.65 39 42 45 49
57.7 37 52 53 56
57.75 48 58 38 44
57.8 42 54 51 53
57.85 56 47 35 47
57.9 45 41 30 46
57.95 39 44 54 59
58 51 32 40 53
58.05 40 39 41 60
58.1 47 47 33 41
58.15 39 46 40 59
58.2 46 51 51 41
58.25 37 52 48 58
58.3 41 37 45 49
58.35 36 48 43 44
58.4 50 44 45 54
58.45 42 45 44 41
58.5 58 56 47 58
58.55 36 51 48 52
58.6 59 54 57 74
58.65 57 63 60 72
58.7 57 75 65 68
58.75 68 74 81 79
58.8 61 60 53 77
58.85 68 74 62 94
58.9 58 67 53 67
58.95 54 44 42 67
59 53 39 42 71
59.05 59 47 39 63
59.1 48 38 45 55
59.15 49 48 57 49
59.2 42 52 49 46
59.25 49 41 45 54
59.3 45 52 41 46
59.35 38 48 50 47
59.4 44 50 38 51
59.45 54 55 61 57
59.5 37 49 54 59
59.55 52 66 62 61
59.6 62 65 54 57
59.65 70 87 82 79
59.7 73 97 82 74
59.75 88 87 79 84
59.8 69 97 61 83
59.85 62 71 67 67
59.9 60 55 72 78
59.95 51 56 44 60
60 59 59 52 51
60.05 51 48 57 48
60.1 45 54 48 55
60.15 45 49 38 53
60.2 39 45 45 50
60.25 55 43 39 60
60.3 48 40 38 52
60.35 45 40 55 51
60.4 34 44 35 59
60.45 47 38 39 49
60.5 32 48 53 44
60.55 40 41 51 36
60.6 40 44 36 55
60.65 54 44 55 55
60.7 35 46 29 49
60.75 50 47 37 46
60.8 40 45 40 68
60.85 34 51 54 48
60.9 39 40 63 50
60.95 31 58 39 46
61 27 46 37 43
61.05 45 55 47 46
61.1 47 42 52 48
61.15 41 45 42 60
61.2 34 43 49 47
61.25 46 40 47 57
61.3 42 43 35 51
61.35 33 46 37 62
61.4 45 39 54 50
61.45 41 54 58 56
61.5 31 48 57 49
61.55 42 44 47 49
61.6 40 52 37 52
61.65 32 48 42 76
61.7 35 36 48 59
61.75 33 51 28 46
61.8 45 47 42 50
61.85 48 48 40 55
61.9 50 37 40 41
61.95 44 50 39 41
62 36 31 48 51
62.05 34 51 38 28
62.1 44 48 40 48
62.15 47 43 43 52
62.2 40 45 40 58
62.25 42 40 47 60
62.3 50 35 44 51
62.35 51 57 41 56
62.4 43 58 52 70
62.45 46 51 55 38
62.5 59 64 58 65
62.55 50 52 47 53
62.6 56 72 62 61
62.65 63 57 57 68
62.7 67 68 55 83
62.75 54 72 60 61
62.8 61 57 54 67
62.85 54 53 53 55
62.9 43 50 49 66
62.95 44 55 50 49
63 36 55 45 63
63.05 49 53 46 47
63.1 41 40 42 51
63.15 46 41 47 40
63.2 44 33 51 58
63.25 36 45 43 46
63.3 34 49 46 58
63.35 36 42 40 46
63.4 58 62 37 57
63.45 42 51 40 58
63.5 40 54 36 40
63.55 48 52 51 46
63.6 43 39 41 46
63.65 35 50 51 46
63.7 36 39 42 47
63.75 42 51 36 52
63.8 41 43 54 52
63.85 40 53 42 37
63.9 39 51 51 63
63.95 40 59 42 66
64 32 44 32 43
64.05 46 57 39 53
64.1 44 42 38 68
64.15 41 44 57 51
64.2 44 41 41 50
64.25 35 40 30 61
64.3 45 51 36 41
64.35 46 52 44 42
64.4 37 47 44 51
64.45 43 52 46 41
64.5 36 35 47 63
64.55 40 61 41 59
64.6 36 40 40 49
64.65 45 38 53 58
64.7 38 41 44 50
64.75 42 49 44 43
64.8 37 53 42 41
64.85 39 47 42 55
64.9 50 42 35 53
64.95 40 41 43 45
65 28 43 48 46
65.05 34 38 39 42
65.1 41 44 44 45
65.15 42 54 43 49
65.2 40 38 46 33
65.25 45 45 44 54
65.3 34 46 33 48
65.35 44 41 29 32
65.4 49 41 55 46
65.45 49 45 43 58
65.5 46 40 38 56
65.55 36 44 51 50
65.6 40 48 44 45
65.65 51 32 44 38
65.7 30 35 29 42
65.75 48 60 42 64
65.8 34 55 38 44
65.85 52 43 48 56
65.9 32 47 46 56
65.95 43 60 47 50
66 41 44 40 47
66.05 42 51 34 56
66.1 61 49 44 53
66.15 57 57 45 42
66.2 55 52 50 59
66.25 44 50 42 53
66.3 63 83 63 62
66.35 78 75 85 89
66.4 80 103 120 69
66.45 77 103 96 81
66.5 98 112 114 111
66.55 86 76 85 103
66.6 81 99 80 80
66.65 61 95 64 78
66.7 62 69 65 87
66.75 59 66 50 70
66.8 54 51 44 62
66.85 50 56 38 70
66.9 52 61 45 60
66.95 32 42 46 60
67 35 46 51 57
67.05 39 47 40 46
67.1 47 45 45 52
67.15 39 40 39 53
67.2 51 43 37 46
67.25 53 46 44 53
67.3 35 52 45 48
67.35 41 44 42 50
67.4 38 55 25 49
67.45 25 46 40 45
67.5 48 51 45 54
67.55 41 47 41 46
67.6 37 50 38 44
67.65 45 48 45 53
67.7 37 44 39 51
67.75 29 42 61 66
67.8 32 52 45 51
67.85 28 52 46 48
67.9 31 54 35 58
67.95 41 48 46 45
68 33 37 39 45
68.05 44 36 35 52
68.1 48 41 46 52
68.15 39 55 41 64
68.2 46 51 46 47
68.25 49 31 49 50
68.3 39 53 36 47
68.35 40 41 38 48
68.4 50 61 60 44
68.45 40 31 39 55
68.5 54 37 41 33
68.55 44 43 46 51
68.6 35 48 51 54
68.65 31 51 37 55
68.7 46 40 47 52
68.75 28 58 40 44
68.8 38 52 41 56
68.85 29 50 37 50
68.9 34 47 44 46
68.95 43 45 45 53
69 49 42 42 50
69.05 37 51 61 35
69.1 43 41 54 42
69.15 44 40 48 59
69.2 31 35 41 49
69.25 33 49 35 56
69.3 43 52 49 46
69.35 47 56 44 34
69.4 42 47 29 51
69.45 39 51 46 41
69.5 37 36 30 51
69.55 35 42 50 35
69.6 42 47 40 43
69.65 44 45 40 46
69.7 37 48 31 41
69.75 53 47 34 50
69.8 24 49 41 41
69.85 35 33 49 40
69.9 41 32 34 53
69.95 34 37 33 49
70 42 31 29 39
70.05 37 35 35 38
70.1 22 47 31 49
70.15 47 47 37 40
70.2 35 47 42 50
70.25 31 31 34 39
70.3 52 38 35 46
70.35 37 54 38 49
70.4 41 45 41 43
70.45 40 34 37 49
70.5 47 42 41 48
70.55 44 49 42 41
70.6 39 49 50 46
70.65 47 39 35 54
70.7 30 49 34 51
70.75 39 52 40 43
70.8 41 40 32 41
70.85 36 37 32 40
70.9 25 52 45 44
70.95 41 30 47 40
71 33 38 33 58
71.05 35 53 34 34
71.1 32 36 36 53
71.15 35 57 54 45
71.2 38 47 32 39
71.25 45 52 32 59
71.3 45 45 39 43
71.35 57 37 38 42
71.4 41 43 34 49
71.45 30 48 44 48
71.5 28 41 34 45
71.55 34 47 45 42
71.6 42 39 41 43
71.65 41 52 44 57
71.7 32 46 43 51
71.75 25 44 36 48
71.8 43 49 39 45
71.85 45 61 42 41
71.9 33 40 43 57
71.95 34 39 34 42
72 44 42 37 53
72.05 43 44 40 47
72.1 45 38 43 48
72.15 42 37 37 48
72.2 42 41 43 46
72.25 30 36 39 41
72.3 44 40 37 47
72.35 47 34 45 49
72.4 36 54 33 52
72.45 45 42 42 37
72.5 40 38 36 37
72.55 45 54 45 56
72.6 33 55 37 57
72.65 39 47 27 41
72.7 47 39 40 52
72.75 39 30 45 41
72.8 40 39 30 45
72.85 34 56 46 52
72.9 39 39 43 42
72.95 30 48 32 55
73 31 39 27 49
73.05 37 42 40 39
73.1 35 39 42 42
73.15 39 41 45 53
73.2 37 46 36 55
73.25 34 44 46 51
73.3 38 48 32 51
73.35 41 38 48 44
73.4 34 44 36 38
73.45 50 50 45 63
73.5 46 48 49 63
73.55 44 55 54 63
73.6 54 79 45 60
73.65 57 71 77 66
73.7 81 95 79 66
73.75 71 104 103 102
73.8 83 89 78 84
73.85 80 96 77 99
73.9 70 72 64 83
73.95 50 85 66 89
74 61 71 59 78
74.05 39 76 62 79
74.1 58 58 50 71
74.15 46 52 39 66
74.2 33 48 42 72
74.25 40 55 46 59
74.3 41 41 42 47
74.35 38 46 40 44
74.4 48 40 38 39
74.45 49 48 51 44
74.5 46 44 45 52
74.55 39 44 44 61
74.6 46 42 40 48
74.65 43 39 48 44
74.7 31 44 37 52
74.75 37 53 36 56
74.8 32 49 38 58
74.85 32 42 33 39
74.9 44 43 43 39
74.95 34 49 40 46
75 29 45 37 55
75.05 31 43 35 39
75.1 33 46 36 42
75.15 52 28 43 44
75.2 32 49 41 54
75.25 29 38 41 43
75.3 29 39 41 51
75.35 36 44 34 48
75.4 28 49 40 43
75.45 28 43 42 45
75.5 45 40 38 49
75.55 25 53 35 49
75.6 30 51 35 42
75.65 26 47 45 46
75.7 32 46 44 47
75.75 32 44 33 49
75.8 44 50 35 63
75.85 40 44 39 42
75.9 30 41 44 45
75.95 34 48 34 58
76 44 49 36 60
76.05 41 57 37 50
76.1 46 41 39 49
76.15 30 39 32 49
76.2 39 34 34 70
76.25 38 49 34 43
76.3 43 33 33 42
76.35 30 50 39 55
76.4 47 55 33 44
76.45 31 33 37 46
76.5 34 40 37 35
76.55 36 47 34 51
76.6 45 38 50 51
76.65 36 41 34 41
76.7 32 40 36 46
76.75 30 41 44 38
76.8 34 52 43 43
76.85 37 37 36 51
76.9 37 51 43 48
76.95 41 46 40 52
77 37 54 33 54
77.05 30 44 55 44
77.1 40 46 42 49
77.15 47 40 41 40
77.2 34 44 30 60
77.25 44 52 45 49
77.3 35 48 36 36
77.35 41 35 33 47
77.4 33 43 34 51
77.45 36 42 48 56
77.5 29 36 37 53
77.55 38 47 36 51
77.6 32 37 48 41
77.65 45 49 33 56
77.7 34 42 39 43
77.75 29 45 51 51
77.8 36 43 36 41
77.85 33 43 35 46
77.9 35 46 37 50
77.95 34 39 46 40
78 40 35 36 43
78.05 43 37 44 54
78.1 33 55 43 49
78.15 35 42 27 41
78.2 40 51 46 38
78.25 43 47 41 36
78.3 38 32 37 31
78.35 38 44 44 56
78.4 43 33 41 50
78.45 40 45 37 41
78.5 42 35 32 36
78.55 38 39 38 43
78.6 34 48 43 39
78.65 34 33 36 58
78.7 40 28 36 43
78.75 37 59 41 60
78.8 37 47 51 46
78.85 39 30 39 47
78.9 47 46 41 42
78.95 40 42 34 52
79 35 35 40 33
79.05 34 40 42 42
79.1 40 40 49 49
79.15 39 48 39 52
79.2 33 30 41 43
79.25 38 40 50 60
79.3 32 44 34 46
79.35 48 48 26 47
79.4 39 34 45 48
79.45 35 51 39 51
79.5 37 39 32 36
79.55 32 45 38 46
79.6 40 57 37 51
79.65 36 45 44 46
79.7 40 30 53 50
79.75 40 46 33 45
79.8 26 37 44 54
79.85 39 38 30 58
79.9 49 37 35 47
79.95 36 30 31 43
80 43 38 41 45
My code is as given below
set terminal postscript eps enhanced colour font 'Times-Roman,12' size 5in,8in
set output "XRD_P3.eps"
##
set style line 1 lt 1 lw 1 lc rgb "black"
set xtics out scale 1.5
set ytics out scale 1.5
set format y ''
set tics font ",16"
set xlabel "2{/Symbol \161} (deg.)" font ",16"
set ylabel "Intensity (a.u.)" font ",16"
set key inside right top
set multiplot layout 4,1 rowsfirst
##
set yrange [0:1500]
set key title "LiCl-KCl + 6 wt.% H_{2}O" font ",14"
##
set label 1 '(111)' font ",12" at 24.10, 482 point pt 7 ps 1.75 lt rgb "red" offset -0.50, 0.50 rotate by 90
set label 2 '(200)' font ",12" at 28.45, 268 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 3 '(220)' font ",12" at 40.65, 230 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 4 '(400)' font ",12" at 58.85, 104 point pt 7 ps 1.75 lt rgb "red" offset -1.00,0.50 rotate by 90
set label 5 '(420)' font ",12" at 66.50, 121 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
##
set label 6 '(111)' font ",12" at 30.20, 196 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 7 '(200)' font ",12" at 35.05, 150 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 8 '(220)' font ",12" at 50.25, 179 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 9 '(311)' font ",12" at 59.75, 94 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 11 '(400)' font ",12" at 73.75, 112 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
##
set label 12 '(101)' font ",12" at 21.70, 1116 point pt 7 ps 1.75 lt rgb "#006400" offset -0.50,0.50 rotate by 90
##
set label 13 'LiCl' font ",14" at 72, 1200 point pt 7 ps 1.75 lt rgb "blue" offset 2,-0.10
set label 14 'KCl' font ",14" at 72, 1100 point pt 7 ps 1.75 lt rgb "red" offset 2,-0.10
set label 15 'LiClO_{4}' font ",14" at 72, 1000 point pt 7 ps 1.75 lt rgb "#006400" offset 2,-0.10
##
plot [10:80] 'XRD_P3.dat' u 1:5 w l ls 1 notitle
##
##
set yrange [0:300]
set key title "LiCl-KCl (Vacuum dried)" font ",14"
##
set label 1 '(222)' font ",12" at 50.30, 195 point pt 7 ps 1.75 lt rgb "red" offset -0.50, 0.50 rotate by 90
set label 2 '(200)' font ",12" at 28.45, 198 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 3 '(220)' font ",12" at 40.60, 195 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 4 '(400)' font ",12" at 58.75, 91 point pt 7 ps 1.75 lt rgb "red" offset -1.00,0.50 rotate by 90
set label 5 '(420)' font ",12" at 66.40, 130 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
##
set label 6 '(111)' font ",12" at 30.20, 137 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 7 '(200)' font ",12" at 34.95, 114 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 9 '(311)' font ",12" at 59.65, 92 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 10 '(222)' font ",12" at 62.75, 70 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 11 '(400)' font ",12" at 73.75, 113 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
##
set label 12 'LiCl' font ",14" at 72, 250 point pt 7 ps 1.75 lt rgb "blue" offset 2,-0.10
set label 13 'KCl' font ",14" at 72, 220 point pt 7 ps 1.75 lt rgb "red" offset 2,-0.10
##
plot [10:80] 'XRD_P3.dat' u 1:4 w l ls 1 notitle
##
##
set yrange [0:350]
set key title "LiCl-KCl (Chlorinated)" font ",14"
##
set label 2 '(200)' font ",12" at 28.40, 267 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 3 '(220)' font ",12" at 40.60, 193 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 4 '(400)' font ",12" at 58.70, 85 point pt 7 ps 1.75 lt rgb "red" offset -1.00,0.50 rotate by 90
set label 5 '(420)' font ",12" at 66.50, 122 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
##
set label 6 '(111)' font ",12" at 30.20, 169 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 7 '(200)' font ",12" at 35.05, 152 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 8 '(220)' font ",12" at 50.30, 172 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 9 '(311)' font ",12" at 59.80, 107 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 10 '(222)' font ",12" at 62.60, 82 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 11 '(400)' font ",12" at 73.75, 114 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
##
set label 12 'LiCl' font ",14" at 72, 300 point pt 7 ps 1.75 lt rgb "blue" offset 2,-0.10
set label 13 'KCl' font ",14" at 72, 270 point pt 7 ps 1.75 lt rgb "red" offset 2,-0.10
##
plot [10:80] 'XRD_P3.dat' u 1:3 w l ls 1 notitle
##
##
unset multiplot
In the plot, there are random texts appearing outside the XRD patterns, and in some cases the labels are rotated. PNG version of the plot is attached.
The definition of labels persists in a multiplot environment. It's somewhere in the documentation but I haven't found it right away in help label.
Here is some code to illustrate your "problem".
In the second plot label 4 and label 5 are not defined explicitely, but the definition still exists in memory from the first plot. Hence, label 4 and label 5 will be drawn at the second plot's coordinates 4,4 and 5,5 which are located somewhere in the first plot.
So, either you explicitly unset them unset label 4 and unset label 5 or you unset all labels unset label and newly define all desired labels.
Code:
### setting/unsetting of labels
reset session
set xrange [0:8]
set multiplot layout 2,1
set label 1 at 1,1 "Label1a"
set label 2 at 2,2 "Label2a"
set label 3 at 3,3 "Label3a"
set label 4 at 4,4 "Label4a"
set label 5 at 5,5 "Label5a"
plot x
# unset label # uncomment this line to reset all labels
set label 1 at 1,-1 "Label1b"
set label 2 at 2,-2 "Label2b"
set label 3 at 3,-3 "Label3b"
plot -x
unset multiplot
### end of code
Result:

Aligning lines in python

I have written a code to print a snake and ladder grid.
I want the numbers to be aligned such that they are in a straight vertical line.
My code is:
for i in range(100,0,-1):
if i%20 == 0:
for i in range(i,i-10,-1):
print(i, end = " ")
print()
elif i%10 == 0:
for i in range(i-9,i+1):
print(i, end = " ")
print()
The present output is:
100 99 98 97 96 95 94 93 92 91
81 82 83 84 85 86 87 88 89 90
80 79 78 77 76 75 74 73 72 71
61 62 63 64 65 66 67 68 69 70
60 59 58 57 56 55 54 53 52 51
41 42 43 44 45 46 47 48 49 50
40 39 38 37 36 35 34 33 32 31
21 22 23 24 25 26 27 28 29 30
20 19 18 17 16 15 14 13 12 11
1 2 3 4 5 6 7 8 9 10
If you're using Python3, try replacing your:
print(i, end = " ")
lines with:
print(format(i, '6d'), end='')
If you must have the numbers left-justified, try this instead:
print('{:<6d}'.format(i), end='')
These will account for the fact that not every number has the same amount of digits, yet you want every number to take up the same amount of space.

Can I format n numbers in Python

How can I print all numbers in a given range to given number of columns, where every colums is of width 6 character and there is a space between colums? I tried to use format:
for i in range(0,nolines):
for j in range(0,nocolums):
print("{0:6}{1:6}".format(number1,number2))
but found that this approach won't work as I need more general code to format n, where n is given by user input, numbers instead of two. So can I print n numbers by using format?
For example, if input is
min = 20, max = 104, numbers on one line = 10
the program should print
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89
90 91 92 93 94 95 96 97 98 99
100 101 102 103 104
def print_range(start, stop, ncolumns, width=6):
for i in range(start, stop, ncolumns):
print(' '.join(['{:{}d}'.format(j, width)
for j in range(i, min(i + ncolumns, stop))]))
Example:
>>> print_range(20, 105, ncolumns=10)
20 21 22 23 24 25 26 27 28 29
30 31 32 33 34 35 36 37 38 39
40 41 42 43 44 45 46 47 48 49
50 51 52 53 54 55 56 57 58 59
60 61 62 63 64 65 66 67 68 69
70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89
90 91 92 93 94 95 96 97 98 99
100 101 102 103 104
You could use the str.rjust method:
lines = [
[1, 2, 3],
[111, 222, 333],
]
for line in lines:
for n in line:
print(str(n).rjust(6), end='')
print()

Resources