Related
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:
I have a .dat file which I tried to do analysis upon. This is the code
catalog=ascii.read("table6.dat",Reader=ascii.NoHeader,guess=False,fast_reader=False,delimiter='\s')
The problem is that there are missing values(empty) within the file which does not allow me to do analysis on the data.
output:
astropy.io.ascii.core.InconsistentTableError: Number of header columns (23) inconsistent with data columns (24) at data line 3
changing the delimiter from '\s' to '\n' gives me this
col1
-------------------------------------------------------------------------------------------------------------------------------------
1 33 Psc 28 00 05 20.1 -05 42 27 93.73 -65.93 111 -6.6 -13 89 (44) -3 45 -101 -16.7 37.4 24.6
2 ADS 48A 38 00 05 41.2 45 48 35 114.64 -16.32 11 -9.0 886 -207 (737) -4 10 -3 -33.6 -31.1 -15.4
3 5 Cet 352 00 08 12.0 -02 26 52 98.32 -63.23 140 -0.4 6 -4 (77) -9 62 -125 -2.1 -4.1 -1.4
4 BD Cet 1833 00 22 46.7 -09 13 49 100.84 -70.86 71 -4.8 3 -51 (409) -4 23 -67 8.1 -15.9 -0.9
5 13 Cet A 3196 00 35 14.8 -03 35 34 112.87 -66.15 21 10.6 410 -21 (409) -3 8 -19 -36.0 -19.3 -12.7
6 FF And 00 42 47.3 35 32 50 120.95 -27.29 24 -0.5 250 90 (380) -11 18 -11 -26.3 -11.6 8.6
7 zeta And 4502 00 47 20.3 24 16 02 121.73 -38.60 31 -23.7 -100 -83 (737) -13 21 -19 26.5 -14.0 5.2
8 CF Tuc 5303 00 52 58.3 -74 39 07 302.81 -42.48 54 0.5 19 28 (409) 22 -33 -36 -6.6 1.0 -5.5
9 BD+25 161 6286 01 04 07.1 26 35 13 126.44 -36.20 55 -20.0 -12 -18 (737) -26 36 -32 13.7 -13.5 7.7
10 AY Cet 7672 01 16 36.2 -02 30 01 137.72 -64.65 67 -30.1 -108 -59 (409) -21 19 -60 46.6 -2.7 15.6
...
196 IM Peg 216489 22 53 02.3 16 50 28 86.36 -37.48 50 -12.8 -19 -24 (737) 3 40 -30 6.3 -11.9 6.0
197 AZ Psc 217188 22 58 52.7 00 18 58 73.71 -51.46 260 -20.5 39 16 (409) 45 156 -203 -54.2 -12.3 5.5
198 TZ PsA 217344 23 00 27.7 -33 44 34 10.64 -65.25 46 36.9 -44 -132 (409) 19 4 -42 32.1 -21.4 -28.2
199 KU Peg 218153 23 05 29.3 26 00 33 95.03 -31.05 950 -80.4 51 -9 (737) -71 811 -490 -171.4 -159.1 -78.5
200 KZ And 218738 23 09 57.4 47 57 30 105.90 -11.53 23 -6.9 157 -5 (737) -6 22 -5 -12.7 -12.2 -5.5
201 RT And 23 11 10.0 53 01 33 108.06 -6.92 95 20.0 -12 -18 (737) -29 90 -11 1.5 20.8 -7.9
202 SZ Psc 219113 23 13 23.8 02 40 32 80.66 -51.96 125 12.0 12 29 (737) 13 76 -98 -13.5 17.2 -3.5
203 EZ Peg 23 16 53.4 25 43 09 97.58 -32.45 83 -27.2 -70 13 (409) -9 69 -45 24.8 -10.9 28.1
204 lambda And 222107 23 37 33.9 46 27 29 109.90 -14.53 23 6.8 162 -421 (737) -8 21 -6 -1.8 -6.7 -49.2
205 KT Peg 222317 23 39 31.0 28 14 47 104.22 -32.00 25 -3.1 299 226 (737) -5 21 -13 -41.9 -6.0 13.8
206 II Peg 224085 23 55 04.0 28 38 01 108.22 -32.62 29 -18.1 574 27 (737) -8 24 -16 -66.5 -48.1 -3.8
but the header cannot be separately allocated to the columns.
there is a missing value in rows 6, 201, 203 in the third column(shown values).
the problem could be solved if false values could be given to these missing empty fields.
I can't find any documentation relating to this...
The problem is that there is fundamentally no way for the table parser to unambiguously know where the column boundaries are for your data file. Your table data are in fixed-width format, meaning that each column lives within certain character bounds in each line. You need to specify those bounds in some way.
This is documented here with examples:
https://docs.astropy.org/en/latest/io/ascii/fixed_width_gallery.html#fixed-width-gallery
If you can modify the file, the easiest way is to add a header line which tells the parser what the column boundaries are. For example:
Col1 Col2 Col3 Col4
---- --------- ---- ----
1.2 "hello" 1 a
2.4 's worlds 2 2
If you cannot modify the file itself, then you can explicitly specify the column starts and stops, as shown in the second example in this section: https://docs.astropy.org/en/latest/io/ascii/fixed_width_gallery.html#fixedwidthnoheader
I wish to plot a XRD pattern using Gnuplot. The data file is given below
# User :
# Journal :
# Sample Details :
# Col 1: 2theta (deg.), Col 2: Intensity (a.u.)
20 88
20.05 92
20.1 96
20.15 88
20.2 84
20.25 100
20.3 94
20.35 84
20.4 78
20.45 81
20.5 86
20.55 92
20.6 85
20.65 74
20.7 83
20.75 74
20.8 87
20.85 67
20.9 85
20.95 83
21 90
21.05 81
21.1 87
21.15 84
21.2 83
21.25 84
21.3 86
21.35 92
21.4 92
21.45 73
21.5 97
21.55 96
21.6 88
21.65 95
21.7 93
21.75 83
21.8 91
21.85 91
21.9 76
21.95 85
22 89
22.05 87
22.1 72
22.15 85
22.2 71
22.25 68
22.3 75
22.35 63
22.4 64
22.45 76
22.5 72
22.55 78
22.6 62
22.65 80
22.7 80
22.75 78
22.8 85
22.85 62
22.9 74
22.95 84
23 73
23.05 76
23.1 83
23.15 48
23.2 74
23.25 79
23.3 75
23.35 70
23.4 94
23.45 80
23.5 79
23.55 69
23.6 73
23.65 55
23.7 72
23.75 59
23.8 87
23.85 76
23.9 70
23.95 76
24 74
24.05 76
24.1 89
24.15 79
24.2 84
24.25 72
24.3 69
24.35 74
24.4 72
24.45 85
24.5 65
24.55 85
24.6 68
24.65 71
24.7 70
24.75 70
24.8 75
24.85 73
24.9 79
24.95 76
25 78
25.05 68
25.1 67
25.15 62
25.2 72
25.25 65
25.3 78
25.35 74
25.4 67
25.45 77
25.5 70
25.55 82
25.6 80
25.65 64
25.7 71
25.75 67
25.8 70
25.85 73
25.9 80
25.95 69
26 61
26.05 82
26.1 86
26.15 83
26.2 88
26.25 68
26.3 78
26.35 66
26.4 71
26.45 69
26.5 61
26.55 73
26.6 74
26.65 83
26.7 72
26.75 82
26.8 84
26.85 72
26.9 68
26.95 72
27 63
27.05 66
27.1 68
27.15 65
27.2 75
27.25 72
27.3 66
27.35 58
27.4 67
27.45 73
27.5 74
27.55 84
27.6 80
27.65 82
27.7 70
27.75 71
27.8 70
27.85 76
27.9 73
27.95 85
28 82
28.05 75
28.1 70
28.15 85
28.2 80
28.25 96
28.3 126
28.35 173
28.4 219
28.45 270
28.5 214
28.55 158
28.6 105
28.65 78
28.7 75
28.75 82
28.8 83
28.85 74
28.9 79
28.95 77
29 61
29.05 75
29.1 75
29.15 65
29.2 69
29.25 79
29.3 68
29.35 78
29.4 74
29.45 57
29.5 75
29.55 65
29.6 69
29.65 83
29.7 72
29.75 69
29.8 65
29.85 68
29.9 89
29.95 79
30 84
30.05 110
30.1 129
30.15 146
30.2 150
30.25 136
30.3 117
30.35 81
30.4 72
30.45 85
30.5 75
30.55 71
30.6 70
30.65 72
30.7 87
30.75 67
30.8 71
30.85 75
30.9 80
30.95 76
31 78
31.05 72
31.1 66
31.15 85
31.2 61
31.25 62
31.3 69
31.35 75
31.4 51
31.45 48
31.5 55
31.55 77
31.6 66
31.65 84
31.7 64
31.75 69
31.8 74
31.85 53
31.9 77
31.95 68
32 74
32.05 53
32.1 67
32.15 61
32.2 68
32.25 77
32.3 62
32.35 57
32.4 62
32.45 62
32.5 62
32.55 66
32.6 56
32.65 55
32.7 62
32.75 61
32.8 67
32.85 74
32.9 49
32.95 66
33 82
33.05 57
33.1 59
33.15 61
33.2 62
33.25 74
33.3 60
33.35 72
33.4 66
33.45 71
33.5 58
33.55 66
33.6 59
33.65 66
33.7 53
33.75 70
33.8 52
33.85 66
33.9 58
33.95 65
34 47
34.05 51
34.1 56
34.15 55
34.2 77
34.25 70
34.3 64
34.35 59
34.4 62
34.45 51
34.5 62
34.55 48
34.6 45
34.65 59
34.7 65
34.75 64
34.8 83
34.85 75
34.9 125
34.95 149
35 152
35.05 120
35.1 84
35.15 76
35.2 70
35.25 63
35.3 68
35.35 51
35.4 64
35.45 62
35.5 58
35.55 63
35.6 67
35.65 68
35.7 62
35.75 58
35.8 59
35.85 48
35.9 53
35.95 55
36 54
36.05 56
36.1 49
36.15 53
36.2 66
36.25 60
36.3 63
36.35 61
36.4 48
36.45 67
36.5 61
36.55 50
36.6 48
36.65 46
36.7 70
36.75 54
36.8 62
36.85 62
36.9 45
36.95 56
37 44
37.05 59
37.1 58
37.15 53
37.2 49
37.25 49
37.3 54
37.35 51
37.4 48
37.45 49
37.5 56
37.55 47
37.6 53
37.65 50
37.7 47
37.75 48
37.8 64
37.85 61
37.9 56
37.95 44
38 44
38.05 43
38.1 45
38.15 51
38.2 61
38.25 48
38.3 39
38.35 58
38.4 50
38.45 56
38.5 49
38.55 54
38.6 47
38.65 47
38.7 46
38.75 49
38.8 43
38.85 50
38.9 51
38.95 60
39 69
39.05 46
39.1 68
39.15 44
39.2 42
39.25 46
39.3 52
39.35 43
39.4 46
39.45 52
39.5 57
39.55 46
39.6 48
39.65 47
39.7 51
39.75 61
39.8 48
39.85 53
39.9 59
39.95 46
40 53
40.05 51
40.1 49
40.15 56
40.2 49
40.25 50
40.3 52
40.35 58
40.4 62
40.45 99
40.5 119
40.55 161
40.6 135
40.65 163
40.7 130
40.75 105
40.8 80
40.85 68
40.9 53
40.95 55
41 53
41.05 54
41.1 59
41.15 56
41.2 53
41.25 52
41.3 46
41.35 47
41.4 44
41.45 57
41.5 49
41.55 48
41.6 42
41.65 45
41.7 46
41.75 48
41.8 44
41.85 51
41.9 45
41.95 54
42 44
42.05 46
42.1 43
42.15 53
42.2 50
42.25 38
42.3 42
42.35 51
42.4 51
42.45 42
42.5 36
42.55 36
42.6 53
42.65 44
42.7 38
42.75 45
42.8 55
42.85 33
42.9 50
42.95 58
43 48
43.05 46
43.1 51
43.15 44
43.2 58
43.25 47
43.3 47
43.35 59
43.4 42
43.45 50
43.5 50
43.55 45
43.6 48
43.65 51
43.7 38
43.75 51
43.8 57
43.85 49
43.9 59
43.95 40
44 41
44.05 39
44.1 37
44.15 43
44.2 43
44.25 52
44.3 50
44.35 46
44.4 41
44.45 48
44.5 44
44.55 40
44.6 47
44.65 39
44.7 49
44.75 49
44.8 44
44.85 38
44.9 44
44.95 53
45 46
45.05 51
45.1 31
45.15 38
45.2 51
45.25 42
45.3 47
45.35 46
45.4 37
45.45 66
45.5 53
45.55 40
45.6 45
45.65 39
45.7 47
45.75 39
45.8 45
45.85 38
45.9 48
45.95 42
46 35
46.05 46
46.1 45
46.15 34
46.2 55
46.25 39
46.3 35
46.35 50
46.4 32
46.45 49
46.5 50
46.55 36
46.6 46
46.65 51
46.7 41
46.75 41
46.8 53
46.85 54
46.9 50
46.95 43
47 44
47.05 61
47.1 36
47.15 43
47.2 48
47.25 38
47.3 46
47.35 48
47.4 51
47.45 42
47.5 51
47.55 37
47.6 40
47.65 49
47.7 33
47.75 36
47.8 41
47.85 49
47.9 39
47.95 42
48 58
48.05 51
48.1 43
48.15 48
48.2 46
48.25 34
48.3 44
48.35 39
48.4 44
48.45 46
48.5 35
48.55 35
48.6 51
48.65 43
48.7 45
48.75 54
48.8 48
48.85 41
48.9 49
48.95 52
49 36
49.05 42
49.1 38
49.15 44
49.2 44
49.25 38
49.3 49
49.35 54
49.4 52
49.45 39
49.5 41
49.55 66
49.6 51
49.65 38
49.7 34
49.75 52
49.8 46
49.85 60
49.9 47
49.95 45
50 68
50.05 66
50.1 68
50.15 89
50.2 133
50.25 137
50.3 125
50.35 124
50.4 103
50.45 88
50.5 72
50.55 59
50.6 56
50.65 46
50.7 39
50.75 51
50.8 27
50.85 45
50.9 41
50.95 43
51 51
51.05 49
51.1 45
51.15 38
51.2 48
51.25 43
51.3 42
51.35 44
51.4 45
51.45 49
51.5 40
51.55 43
51.6 37
51.65 50
51.7 47
51.75 37
51.8 39
51.85 43
51.9 42
51.95 40
52 45
52.05 34
52.1 32
52.15 43
52.2 37
52.25 47
52.3 62
52.35 36
52.4 45
52.45 36
52.5 37
52.55 38
52.6 37
52.65 35
52.7 38
52.75 47
52.8 40
52.85 50
52.9 50
52.95 44
53 44
53.05 35
53.1 46
53.15 43
53.2 40
53.25 57
53.3 29
53.35 39
53.4 39
53.45 43
53.5 51
53.55 44
53.6 53
53.65 40
53.7 41
53.75 59
53.8 46
53.85 46
53.9 57
53.95 52
54 48
54.05 50
54.1 40
54.15 42
54.2 46
54.25 48
54.3 47
54.35 42
54.4 49
54.45 43
54.5 43
54.55 54
54.6 44
54.65 40
54.7 45
54.75 34
54.8 42
54.85 40
54.9 34
54.95 43
55 51
55.05 56
55.1 42
55.15 37
55.2 41
55.25 49
55.3 53
55.35 46
55.4 47
55.45 39
55.5 43
55.55 43
55.6 41
55.65 38
55.7 36
55.75 55
55.8 45
55.85 37
55.9 47
55.95 50
56 46
56.05 51
56.1 51
56.15 56
56.2 31
56.25 44
56.3 41
56.35 45
56.4 45
56.45 49
56.5 45
56.55 60
56.6 30
56.65 38
56.7 51
56.75 54
56.8 45
56.85 38
56.9 40
56.95 41
57 36
57.05 35
57.1 45
57.15 41
57.2 49
57.25 36
57.3 38
57.35 43
57.4 43
57.45 41
57.5 42
57.55 42
57.6 41
57.65 39
57.7 37
57.75 48
57.8 42
57.85 56
57.9 45
57.95 39
58 51
58.05 40
58.1 47
58.15 39
58.2 46
58.25 37
58.3 41
58.35 36
58.4 50
58.45 42
58.5 58
58.55 36
58.6 59
58.65 57
58.7 57
58.75 68
58.8 61
58.85 68
58.9 58
58.95 54
59 53
59.05 59
59.1 48
59.15 49
59.2 42
59.25 49
59.3 45
59.35 38
59.4 44
59.45 54
59.5 37
59.55 52
59.6 62
59.65 70
59.7 73
59.75 88
59.8 69
59.85 62
59.9 60
59.95 51
60 59
60.05 51
60.1 45
60.15 45
60.2 39
60.25 55
60.3 48
60.35 45
60.4 34
60.45 47
60.5 32
60.55 40
60.6 40
60.65 54
60.7 35
60.75 50
60.8 40
60.85 34
60.9 39
60.95 31
61 27
61.05 45
61.1 47
61.15 41
61.2 34
61.25 46
61.3 42
61.35 33
61.4 45
61.45 41
61.5 31
61.55 42
61.6 40
61.65 32
61.7 35
61.75 33
61.8 45
61.85 48
61.9 50
61.95 44
62 36
62.05 34
62.1 44
62.15 47
62.2 40
62.25 42
62.3 50
62.35 51
62.4 43
62.45 46
62.5 59
62.55 50
62.6 56
62.65 63
62.7 67
62.75 54
62.8 61
62.85 54
62.9 43
62.95 44
63 36
63.05 49
63.1 41
63.15 46
63.2 44
63.25 36
63.3 34
63.35 36
63.4 58
63.45 42
63.5 40
63.55 48
63.6 43
63.65 35
63.7 36
63.75 42
63.8 41
63.85 40
63.9 39
63.95 40
64 32
64.05 46
64.1 44
64.15 41
64.2 44
64.25 35
64.3 45
64.35 46
64.4 37
64.45 43
64.5 36
64.55 40
64.6 36
64.65 45
64.7 38
64.75 42
64.8 37
64.85 39
64.9 50
64.95 40
65 28
65.05 34
65.1 41
65.15 42
65.2 40
65.25 45
65.3 34
65.35 44
65.4 49
65.45 49
65.5 46
65.55 36
65.6 40
65.65 51
65.7 30
65.75 48
65.8 34
65.85 52
65.9 32
65.95 43
66 41
66.05 42
66.1 61
66.15 57
66.2 55
66.25 44
66.3 63
66.35 78
66.4 80
66.45 77
66.5 98
66.55 86
66.6 81
66.65 61
66.7 62
66.75 59
66.8 54
66.85 50
66.9 52
66.95 32
67 35
67.05 39
67.1 47
67.15 39
67.2 51
67.25 53
67.3 35
67.35 41
67.4 38
67.45 25
67.5 48
67.55 41
67.6 37
67.65 45
67.7 37
67.75 29
67.8 32
67.85 28
67.9 31
67.95 41
68 33
68.05 44
68.1 48
68.15 39
68.2 46
68.25 49
68.3 39
68.35 40
68.4 50
68.45 40
68.5 54
68.55 44
68.6 35
68.65 31
68.7 46
68.75 28
68.8 38
68.85 29
68.9 34
68.95 43
69 49
69.05 37
69.1 43
69.15 44
69.2 31
69.25 33
69.3 43
69.35 47
69.4 42
69.45 39
69.5 37
69.55 35
69.6 42
69.65 44
69.7 37
69.75 53
69.8 24
69.85 35
69.9 41
69.95 34
70 42
70.05 37
70.1 22
70.15 47
70.2 35
70.25 31
70.3 52
70.35 37
70.4 41
70.45 40
70.5 47
70.55 44
70.6 39
70.65 47
70.7 30
70.75 39
70.8 41
70.85 36
70.9 25
70.95 41
71 33
71.05 35
71.1 32
71.15 35
71.2 38
71.25 45
71.3 45
71.35 57
71.4 41
71.45 30
71.5 28
71.55 34
71.6 42
71.65 41
71.7 32
71.75 25
71.8 43
71.85 45
71.9 33
71.95 34
72 44
72.05 43
72.1 45
72.15 42
72.2 42
72.25 30
72.3 44
72.35 47
72.4 36
72.45 45
72.5 40
72.55 45
72.6 33
72.65 39
72.7 47
72.75 39
72.8 40
72.85 34
72.9 39
72.95 30
73 31
73.05 37
73.1 35
73.15 39
73.2 37
73.25 34
73.3 38
73.35 41
73.4 34
73.45 50
73.5 46
73.55 44
73.6 54
73.65 57
73.7 81
73.75 71
73.8 83
73.85 80
73.9 70
73.95 50
74 61
74.05 39
74.1 58
74.15 46
74.2 33
74.25 40
74.3 41
74.35 38
74.4 48
74.45 49
74.5 46
74.55 39
74.6 46
74.65 43
74.7 31
74.75 37
74.8 32
74.85 32
74.9 44
74.95 34
75 29
75.05 31
75.1 33
75.15 52
75.2 32
75.25 29
75.3 29
75.35 36
75.4 28
75.45 28
75.5 45
75.55 25
75.6 30
75.65 26
75.7 32
75.75 32
75.8 44
75.85 40
75.9 30
75.95 34
76 44
76.05 41
76.1 46
76.15 30
76.2 39
76.25 38
76.3 43
76.35 30
76.4 47
76.45 31
76.5 34
76.55 36
76.6 45
76.65 36
76.7 32
76.75 30
76.8 34
76.85 37
76.9 37
76.95 41
77 37
77.05 30
77.1 40
77.15 47
77.2 34
77.25 44
77.3 35
77.35 41
77.4 33
77.45 36
77.5 29
77.55 38
77.6 32
77.65 45
77.7 34
77.75 29
77.8 36
77.85 33
77.9 35
77.95 34
78 40
78.05 43
78.1 33
78.15 35
78.2 40
78.25 43
78.3 38
78.35 38
78.4 43
78.45 40
78.5 42
78.55 38
78.6 34
78.65 34
78.7 40
78.75 37
78.8 37
78.85 39
78.9 47
78.95 40
79 35
79.05 34
79.1 40
79.15 39
79.2 33
79.25 38
79.3 32
79.35 48
79.4 39
79.45 35
79.5 37
79.55 32
79.6 40
79.65 36
79.7 40
79.75 40
79.8 26
79.85 39
79.9 49
79.95 36
80 43
My script is provided below
set terminal postscript eps enhanced colour font 'Times-Roman,12' size 4in,3in
set output "XRD_E1.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 yrange [0:350]
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 key title "As prepared LiCl-KCl \n " font ",14"
##
set label 1 '(200)' font ",12" at 28.45, 280 point pt 7 ps 1.75 lt rgb "red" offset -0.50, 0.50 rotate by 90
set label 2 '(111)' font ",12" at 30.20, 160 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 3 '(200)' font ",12" at 35.00, 160 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 4 '(220)' font ",12" at 40.65, 173 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 5 '(220)' font ",12" at 50.25, 147 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 6 '(400)' font ",12" at 58.85, 78 point pt 7 ps 1.75 lt rgb "red" offset -1.00,0.50 rotate by 90
set label 7 '(311)' font ",12" at 59.75, 98 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 8 '(222)' font ",12" at 62.70, 77 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
set label 9 '(420)' font ",12" at 66.50, 108 point pt 7 ps 1.75 lt rgb "red" offset -0.50,0.50 rotate by 90
set label 10 '(222)' font ",12" at 73.80, 93 point pt 7 ps 1.75 lt rgb "blue" offset -0.50,0.50 rotate by 90
##
plot [10:90] 'XRD_E1.dat' u 1:2 w l ls 1 notitle
The script works fine. I only need to include the point types used in the plot in the key title with a proper spacing.
Secondly, is there a better way to plot and label than what is provided in the script?
Thank you
#Suddhasattwa Ghosh, in case this is still of interest, you can simply plot your marks with labels point (check help labels). Put your peak data into a datablock or in separate files.
Script:
### print with labels and points
reset session
FILE = 'XRD_E1.dat'
set tics font ",16"
set xlabel "2{/Symbol \161} (deg.)" font ",16"
set xtics out scale 1.5
set ylabel "Intensity (a.u.)" font ",16"
set yrange [0:350]
set format y ''
set ytics out scale 1.5
set key inside right top noautotitle font ",12" title "As prepared LiCl-KCl \n " font ",14"
$LiCl <<EOD
(200) 28.45 280
(220) 40.65 173
(400) 58.85 78
(420) 66.50 108
EOD
$KCl <<EOD
(111) 30.20 160
(200) 35.00 160
(220) 50.25 147
(311) 59.75 98
(222) 62.70 77
(222) 73.80 93
EOD
plot FILE u 1:2 w l lc "black", \
$LiCl u 2:3:1 w labels point pt 7 lc "red" offset -0.5,0.5 left rotate by 90 font ",12" ti "LiCl", \
$KCl u 2:3:1 w labels point pt 7 lc "blue" offset -0.5,0.5 left rotate by 90 font ",12" ti "KCl"
### end of script
Result:
If I understand well, you want something like this:
To achieve this, extend your code with:
set key horizontal
plot [10:90] 'XRD_E1.dat' u 1:2 w l ls 1 notitle, 1/0 w p pt 7 ps 1.75 lc rgb "red" t 'LiCl', 1/0 w p pt 7 ps 1.75 lc rgb "blue" t 'KCl'
I have added the awk format to show the ascii character in bash script. But how can we actually display the ascii value in decimal, octal and hexadecimal in bash script?
awk -F":" '
BEGIN {
print "## The chart below represents ASCII value from 0 to 127 in decimal, octal and hexadecimal format"
printf "%-8s %-15s %-15s %-15s\n","Value","Decimal","Octal","Hexadecimal"
}
'
Desired Output:
Value Oct Dec Hex
! 041 33 21
Likewise for 0 to 127 ascii characters.
Thanks for the help.
If your distro sources the man pages from the man-pages project you can use the following
$ man ascii | sed -n '/Oct/,/Tables/p' | head -n -2
Oct Dec Hex Char Oct Dec Hex Char
────────────────────────────────────────────────────────────────────────
000 0 00 NUL '\0' (null character) 100 64 40 #
001 1 01 SOH (start of heading) 101 65 41 A
002 2 02 STX (start of text) 102 66 42 B
003 3 03 ETX (end of text) 103 67 43 C
004 4 04 EOT (end of transmission) 104 68 44 D
005 5 05 ENQ (enquiry) 105 69 45 E
006 6 06 ACK (acknowledge) 106 70 46 F
007 7 07 BEL '\a' (bell) 107 71 47 G
010 8 08 BS '\b' (backspace) 110 72 48 H
011 9 09 HT '\t' (horizontal tab) 111 73 49 I
012 10 0A LF '\n' (new line) 112 74 4A J
013 11 0B VT '\v' (vertical tab) 113 75 4B K
014 12 0C FF '\f' (form feed) 114 76 4C L
015 13 0D CR '\r' (carriage ret) 115 77 4D M
016 14 0E SO (shift out) 116 78 4E N
017 15 0F SI (shift in) 117 79 4F O
020 16 10 DLE (data link escape) 120 80 50 P
021 17 11 DC1 (device control 1) 121 81 51 Q
022 18 12 DC2 (device control 2) 122 82 52 R
023 19 13 DC3 (device control 3) 123 83 53 S
024 20 14 DC4 (device control 4) 124 84 54 T
025 21 15 NAK (negative ack.) 125 85 55 U
026 22 16 SYN (synchronous idle) 126 86 56 V
027 23 17 ETB (end of trans. blk) 127 87 57 W
030 24 18 CAN (cancel) 130 88 58 X
031 25 19 EM (end of medium) 131 89 59 Y
032 26 1A SUB (substitute) 132 90 5A Z
033 27 1B ESC (escape) 133 91 5B [
034 28 1C FS (file separator) 134 92 5C \ '\\'
035 29 1D GS (group separator) 135 93 5D ]
036 30 1E RS (record separator) 136 94 5E ^
037 31 1F US (unit separator) 137 95 5F _
040 32 20 SPACE 140 96 60 `
041 33 21 ! 141 97 61 a
042 34 22 " 142 98 62 b
043 35 23 # 143 99 63 c
044 36 24 $ 144 100 64 d
045 37 25 % 145 101 65 e
046 38 26 & 146 102 66 f
047 39 27 ' 147 103 67 g
050 40 28 ( 150 104 68 h
051 41 29 ) 151 105 69 i
052 42 2A * 152 106 6A j
053 43 2B + 153 107 6B k
054 44 2C , 154 108 6C l
055 45 2D - 155 109 6D m
056 46 2E . 156 110 6E n
057 47 2F / 157 111 6F o
060 48 30 0 160 112 70 p
061 49 31 1 161 113 71 q
062 50 32 2 162 114 72 r
063 51 33 3 163 115 73 s
064 52 34 4 164 116 74 t
065 53 35 5 165 117 75 u
066 54 36 6 166 118 76 v
067 55 37 7 167 119 77 w
070 56 38 8 170 120 78 x
071 57 39 9 171 121 79 y
072 58 3A : 172 122 7A z
073 59 3B ; 173 123 7B {
074 60 3C < 174 124 7C |
075 61 3D = 175 125 7D }
076 62 3E > 176 126 7E ~
077 63 3F ? 177 127 7F DEL
$
Here is another that provides a nice 4-column ASCII chart with special characters.
#!/bin/bash
special=( "(nul)" "(soh)" "(stx)" "(etx)"
"(eot)" "(enq)" "(ack)" "(bel)"
"(bs)" "(ht)" "(nl)" "(vt)"
"(np)" "(cr)" "(so)" "(si)"
"(dle)" "(dc1)" "(dc2)" "(dc3)"
"(dc4)" "(nak)" "(syn)" "(etb)"
"(can)" "(em)" "(sub)" "(esc)"
"(fs)" "(gs)" "(rs)" "(us)"
"(sp)" "(del)" )
## print heading
printf "Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex\n"
printf -- "-------------------------------------------------------------------------------------\n"
## print table of chars
for ((i = 0; i < 32; i++)); do
c1="${special[i]}"
[ "$i" -gt 0 ] && c2="$(printf "\\$(printf '%03o' "$((i+32))")")" || c2="${special[32]}"
c3="$(printf "\\$(printf '%03o' "$((i+64))")")"
[ "$i" -lt 31 ] && c4="$(printf "\\$(printf '%03o' "$((i+96))")")" || c4="${special[33]}"
printf "%-5s %3d %04o 0x%02x | %-5s %3d %04o 0x%02x | %-5s %3d %04o 0x%02x | %-5s %3d %04o 0x%02x\n" \
"$c1" $i $i $i \
"$c2" $((i+32)) $((i+32)) $((i+32)) \
"$c3" $((i+64)) $((i+64)) $((i+64)) \
"$c4" $((i+96)) $((i+96)) $((i+96))
done
Example Use/Output
$ bash asciichart.sh
Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex | Char Dec Oct Hex
-------------------------------------------------------------------------------------
(nul) 0 0000 0x00 | (sp) 32 0040 0x20 | # 64 0100 0x40 | ` 96 0140 0x60
(soh) 1 0001 0x01 | ! 33 0041 0x21 | A 65 0101 0x41 | a 97 0141 0x61
(stx) 2 0002 0x02 | " 34 0042 0x22 | B 66 0102 0x42 | b 98 0142 0x62
(etx) 3 0003 0x03 | # 35 0043 0x23 | C 67 0103 0x43 | c 99 0143 0x63
(eot) 4 0004 0x04 | $ 36 0044 0x24 | D 68 0104 0x44 | d 100 0144 0x64
(enq) 5 0005 0x05 | % 37 0045 0x25 | E 69 0105 0x45 | e 101 0145 0x65
(ack) 6 0006 0x06 | & 38 0046 0x26 | F 70 0106 0x46 | f 102 0146 0x66
(bel) 7 0007 0x07 | ' 39 0047 0x27 | G 71 0107 0x47 | g 103 0147 0x67
(bs) 8 0010 0x08 | ( 40 0050 0x28 | H 72 0110 0x48 | h 104 0150 0x68
(ht) 9 0011 0x09 | ) 41 0051 0x29 | I 73 0111 0x49 | i 105 0151 0x69
(nl) 10 0012 0x0a | * 42 0052 0x2a | J 74 0112 0x4a | j 106 0152 0x6a
(vt) 11 0013 0x0b | + 43 0053 0x2b | K 75 0113 0x4b | k 107 0153 0x6b
(np) 12 0014 0x0c | , 44 0054 0x2c | L 76 0114 0x4c | l 108 0154 0x6c
(cr) 13 0015 0x0d | - 45 0055 0x2d | M 77 0115 0x4d | m 109 0155 0x6d
(so) 14 0016 0x0e | . 46 0056 0x2e | N 78 0116 0x4e | n 110 0156 0x6e
(si) 15 0017 0x0f | / 47 0057 0x2f | O 79 0117 0x4f | o 111 0157 0x6f
(dle) 16 0020 0x10 | 0 48 0060 0x30 | P 80 0120 0x50 | p 112 0160 0x70
(dc1) 17 0021 0x11 | 1 49 0061 0x31 | Q 81 0121 0x51 | q 113 0161 0x71
(dc2) 18 0022 0x12 | 2 50 0062 0x32 | R 82 0122 0x52 | r 114 0162 0x72
(dc3) 19 0023 0x13 | 3 51 0063 0x33 | S 83 0123 0x53 | s 115 0163 0x73
(dc4) 20 0024 0x14 | 4 52 0064 0x34 | T 84 0124 0x54 | t 116 0164 0x74
(nak) 21 0025 0x15 | 5 53 0065 0x35 | U 85 0125 0x55 | u 117 0165 0x75
(syn) 22 0026 0x16 | 6 54 0066 0x36 | V 86 0126 0x56 | v 118 0166 0x76
(etb) 23 0027 0x17 | 7 55 0067 0x37 | W 87 0127 0x57 | w 119 0167 0x77
(can) 24 0030 0x18 | 8 56 0070 0x38 | X 88 0130 0x58 | x 120 0170 0x78
(em) 25 0031 0x19 | 9 57 0071 0x39 | Y 89 0131 0x59 | y 121 0171 0x79
(sub) 26 0032 0x1a | : 58 0072 0x3a | Z 90 0132 0x5a | z 122 0172 0x7a
(esc) 27 0033 0x1b | ; 59 0073 0x3b | [ 91 0133 0x5b | { 123 0173 0x7b
(fs) 28 0034 0x1c | < 60 0074 0x3c | \ 92 0134 0x5c | | 124 0174 0x7c
(gs) 29 0035 0x1d | = 61 0075 0x3d | ] 93 0135 0x5d | } 125 0175 0x7d
(rs) 30 0036 0x1e | > 62 0076 0x3e | ^ 94 0136 0x5e | ~ 126 0176 0x7e
(us) 31 0037 0x1f | ? 63 0077 0x3f | _ 95 0137 0x5f | (del) 127 0177 0x7f
I have the following in my .bash_profile:
command -v ascii &> /dev/null || function ascii { awk 'BEGIN {for (i = 32; i < 127; i++) printf "%3d 0x%02x %c\n", i, i, i}' | pr -t6 -w78; }
I know it doesn't really answer your question, especially because it doesn't list the octal representation, but it's quite useful.
Please note that the characters with codes from 0 to 31 and 127 are control characters, so it makes no sense to display them.
Anyway, to match the format of your example (which is different from the format of your attempt), it seems that the following is what you need:
awk 'BEGIN {print "Value Oct Dec Hex"; for (i = 32; i < 127; i++) printf "%c %03o %-3d %02x\n", i, i, i, i}'
You may change the range of the for to also display the control characters, but you will quickly see that the extra output is not of much use.
Awk is not a particularly suitable tool for this. But here goes.
awk 'BEGIN {
for (i=0; i<128; ++i)
printf "%-8c %-15i %-15o %-15x\n", i, i, i, i
}' /dev/null
Many of the first 31 character codes are control characters which will mess up the tabular formatting.
Demo: https://ideone.com/mngMak
Some of the arrays I made ahead of time, but this is what i use :
The "=" is shown as "EQL" instead because i'm usually too lazy to perfectly escape everything and simply use the equal sign "=" as my delimiter for everything —- (it's a lot easier to just find a custom way to escape the equal sign than deal with the plethora of quotation escaping rules)
mawk2x '{
for(__ in dec2byte) {
print \
sprintf("%+04.f:%+04.f:%+04.f",\
byte2dec[_=dec2byte[__]],\
byte2sgned[_],\
byte2neg[_]),\
("["(__==4^3-2-1?"EQL"\
:(32<__)&&(__-2)<(3+2)^3\
?" "(_)" ":"_^_"))\
("|"byte2hex[_]"|"byte2oct[_]"]") } }' <<< '' |
LC_ALL=C gsort -t= -k 1,1n | rs -t -c$'\n' -C= 0 2 | column -s= -t
+000:+000:-256 [_^_|%00|\000] +128:-128:-128 [_^_|%80|\200]
+001:+001:-255 [_^_|%01|\001] +129:-127:-127 [_^_|%81|\201]
+002:+002:-254 [_^_|%02|\002] +130:-126:-126 [_^_|%82|\202]
+003:+003:-253 [_^_|%03|\003] +131:-125:-125 [_^_|%83|\203]
+004:+004:-252 [_^_|%04|\004] +132:-124:-124 [_^_|%84|\204]
+005:+005:-251 [_^_|%05|\005] +133:-123:-123 [_^_|%85|\205]
+006:+006:-250 [_^_|%06|\006] +134:-122:-122 [_^_|%86|\206]
+007:+007:-249 [_^_|%07|\007] +135:-121:-121 [_^_|%87|\207]
+008:+008:-248 [_^_|%08|\010] +136:-120:-120 [_^_|%88|\210]
+009:+009:-247 [_^_|%09|\011] +137:-119:-119 [_^_|%89|\211]
+010:+010:-246 [_^_|%0A|\012] +138:-118:-118 [_^_|%8A|\212]
+011:+011:-245 [_^_|%0B|\013] +139:-117:-117 [_^_|%8B|\213]
+012:+012:-244 [_^_|%0C|\014] +140:-116:-116 [_^_|%8C|\214]
+013:+013:-243 [_^_|%0D|\015] +141:-115:-115 [_^_|%8D|\215]
+014:+014:-242 [_^_|%0E|\016] +142:-114:-114 [_^_|%8E|\216]
+015:+015:-241 [_^_|%0F|\017] +143:-113:-113 [_^_|%8F|\217]
+016:+016:-240 [_^_|%10|\020] +144:-112:-112 [_^_|%90|\220]
+017:+017:-239 [_^_|%11|\021] +145:-111:-111 [_^_|%91|\221]
+018:+018:-238 [_^_|%12|\022] +146:-110:-110 [_^_|%92|\222]
+019:+019:-237 [_^_|%13|\023] +147:-109:-109 [_^_|%93|\223]
+020:+020:-236 [_^_|%14|\024] +148:-108:-108 [_^_|%94|\224]
+021:+021:-235 [_^_|%15|\025] +149:-107:-107 [_^_|%95|\225]
+022:+022:-234 [_^_|%16|\026] +150:-106:-106 [_^_|%96|\226]
+023:+023:-233 [_^_|%17|\027] +151:-105:-105 [_^_|%97|\227]
+024:+024:-232 [_^_|%18|\030] +152:-104:-104 [_^_|%98|\230]
+025:+025:-231 [_^_|%19|\031] +153:-103:-103 [_^_|%99|\231]
+026:+026:-230 [_^_|%1A|\032] +154:-102:-102 [_^_|%9A|\232]
+027:+027:-229 [_^_|%1B|\033] +155:-101:-101 [_^_|%9B|\233]
+028:+028:-228 [_^_|%1C|\034] +156:-100:-100 [_^_|%9C|\234]
+029:+029:-227 [_^_|%1D|\035] +157:-099:-099 [_^_|%9D|\235]
+030:+030:-226 [_^_|%1E|\036] +158:-098:-098 [_^_|%9E|\236]
+031:+031:-225 [_^_|%1F|\037] +159:-097:-097 [_^_|%9F|\237]
+032:+032:-224 [_^_|%20|\040] +160:-096:-096 [_^_|%A0|\240]
+033:+033:-223 [ ! |%21|\041] +161:-095:-095 [_^_|%A1|\241]
+034:+034:-222 [ " |%22|\042] +162:-094:-094 [_^_|%A2|\242]
+035:+035:-221 [ # |%23|\043] +163:-093:-093 [_^_|%A3|\243]
+036:+036:-220 [ $ |%24|\044] +164:-092:-092 [_^_|%A4|\244]
+037:+037:-219 [ % |%25|\045] +165:-091:-091 [_^_|%A5|\245]
+038:+038:-218 [ & |%26|\046] +166:-090:-090 [_^_|%A6|\246]
+039:+039:-217 [ ' |%27|\047] +167:-089:-089 [_^_|%A7|\247]
+040:+040:-216 [ ( |%28|\050] +168:-088:-088 [_^_|%A8|\250]
+041:+041:-215 [ ) |%29|\051] +169:-087:-087 [_^_|%A9|\251]
+042:+042:-214 [ * |%2A|\052] +170:-086:-086 [_^_|%AA|\252]
+043:+043:-213 [ + |%2B|\053] +171:-085:-085 [_^_|%AB|\253]
+044:+044:-212 [ , |%2C|\054] +172:-084:-084 [_^_|%AC|\254]
+045:+045:-211 [ - |%2D|\055] +173:-083:-083 [_^_|%AD|\255]
+046:+046:-210 [ . |%2E|\056] +174:-082:-082 [_^_|%AE|\256]
+047:+047:-209 [ / |%2F|\057] +175:-081:-081 [_^_|%AF|\257]
+048:+048:-208 [ 0 |%30|\060] +176:-080:-080 [_^_|%B0|\260]
+049:+049:-207 [ 1 |%31|\061] +177:-079:-079 [_^_|%B1|\261]
+050:+050:-206 [ 2 |%32|\062] +178:-078:-078 [_^_|%B2|\262]
+051:+051:-205 [ 3 |%33|\063] +179:-077:-077 [_^_|%B3|\263]
+052:+052:-204 [ 4 |%34|\064] +180:-076:-076 [_^_|%B4|\264]
+053:+053:-203 [ 5 |%35|\065] +181:-075:-075 [_^_|%B5|\265]
+054:+054:-202 [ 6 |%36|\066] +182:-074:-074 [_^_|%B6|\266]
+055:+055:-201 [ 7 |%37|\067] +183:-073:-073 [_^_|%B7|\267]
+056:+056:-200 [ 8 |%38|\070] +184:-072:-072 [_^_|%B8|\270]
+057:+057:-199 [ 9 |%39|\071] +185:-071:-071 [_^_|%B9|\271]
+058:+058:-198 [ : |%3A|\072] +186:-070:-070 [_^_|%BA|\272]
+059:+059:-197 [ ; |%3B|\073] +187:-069:-069 [_^_|%BB|\273]
+060:+060:-196 [ < |%3C|\074] +188:-068:-068 [_^_|%BC|\274]
+061:+061:-195 [EQL|%3D|\075] +189:-067:-067 [_^_|%BD|\275]
+062:+062:-194 [ > |%3E|\076] +190:-066:-066 [_^_|%BE|\276]
+063:+063:-193 [ ? |%3F|\077] +191:-065:-065 [_^_|%BF|\277]
+064:+064:-192 [ # |%40|\100] +192:-064:-064 [_^_|%C0|\300]
+065:+065:-191 [ A |%41|\101] +193:-063:-063 [_^_|%C1|\301]
+066:+066:-190 [ B |%42|\102] +194:-062:-062 [_^_|%C2|\302]
+067:+067:-189 [ C |%43|\103] +195:-061:-061 [_^_|%C3|\303]
+068:+068:-188 [ D |%44|\104] +196:-060:-060 [_^_|%C4|\304]
+069:+069:-187 [ E |%45|\105] +197:-059:-059 [_^_|%C5|\305]
+070:+070:-186 [ F |%46|\106] +198:-058:-058 [_^_|%C6|\306]
+071:+071:-185 [ G |%47|\107] +199:-057:-057 [_^_|%C7|\307]
+072:+072:-184 [ H |%48|\110] +200:-056:-056 [_^_|%C8|\310]
+073:+073:-183 [ I |%49|\111] +201:-055:-055 [_^_|%C9|\311]
+074:+074:-182 [ J |%4A|\112] +202:-054:-054 [_^_|%CA|\312]
+075:+075:-181 [ K |%4B|\113] +203:-053:-053 [_^_|%CB|\313]
+076:+076:-180 [ L |%4C|\114] +204:-052:-052 [_^_|%CC|\314]
+077:+077:-179 [ M |%4D|\115] +205:-051:-051 [_^_|%CD|\315]
+078:+078:-178 [ N |%4E|\116] +206:-050:-050 [_^_|%CE|\316]
+079:+079:-177 [ O |%4F|\117] +207:-049:-049 [_^_|%CF|\317]
+080:+080:-176 [ P |%50|\120] +208:-048:-048 [_^_|%D0|\320]
+081:+081:-175 [ Q |%51|\121] +209:-047:-047 [_^_|%D1|\321]
+082:+082:-174 [ R |%52|\122] +210:-046:-046 [_^_|%D2|\322]
+083:+083:-173 [ S |%53|\123] +211:-045:-045 [_^_|%D3|\323]
+084:+084:-172 [ T |%54|\124] +212:-044:-044 [_^_|%D4|\324]
+085:+085:-171 [ U |%55|\125] +213:-043:-043 [_^_|%D5|\325]
+086:+086:-170 [ V |%56|\126] +214:-042:-042 [_^_|%D6|\326]
+087:+087:-169 [ W |%57|\127] +215:-041:-041 [_^_|%D7|\327]
+088:+088:-168 [ X |%58|\130] +216:-040:-040 [_^_|%D8|\330]
+089:+089:-167 [ Y |%59|\131] +217:-039:-039 [_^_|%D9|\331]
+090:+090:-166 [ Z |%5A|\132] +218:-038:-038 [_^_|%DA|\332]
+091:+091:-165 [ [ |%5B|\133] +219:-037:-037 [_^_|%DB|\333]
+092:+092:-164 [ \ |%5C|\134] +220:-036:-036 [_^_|%DC|\334]
+093:+093:-163 [ ] |%5D|\135] +221:-035:-035 [_^_|%DD|\335]
+094:+094:-162 [ ^ |%5E|\136] +222:-034:-034 [_^_|%DE|\336]
+095:+095:-161 [ _ |%5F|\137] +223:-033:-033 [_^_|%DF|\337]
+096:+096:-160 [ ` |%60|\140] +224:-032:-032 [_^_|%E0|\340]
+097:+097:-159 [ a |%61|\141] +225:-031:-031 [_^_|%E1|\341]
+098:+098:-158 [ b |%62|\142] +226:-030:-030 [_^_|%E2|\342]
+099:+099:-157 [ c |%63|\143] +227:-029:-029 [_^_|%E3|\343]
+100:+100:-156 [ d |%64|\144] +228:-028:-028 [_^_|%E4|\344]
+101:+101:-155 [ e |%65|\145] +229:-027:-027 [_^_|%E5|\345]
+102:+102:-154 [ f |%66|\146] +230:-026:-026 [_^_|%E6|\346]
+103:+103:-153 [ g |%67|\147] +231:-025:-025 [_^_|%E7|\347]
+104:+104:-152 [ h |%68|\150] +232:-024:-024 [_^_|%E8|\350]
+105:+105:-151 [ i |%69|\151] +233:-023:-023 [_^_|%E9|\351]
+106:+106:-150 [ j |%6A|\152] +234:-022:-022 [_^_|%EA|\352]
+107:+107:-149 [ k |%6B|\153] +235:-021:-021 [_^_|%EB|\353]
+108:+108:-148 [ l |%6C|\154] +236:-020:-020 [_^_|%EC|\354]
+109:+109:-147 [ m |%6D|\155] +237:-019:-019 [_^_|%ED|\355]
+110:+110:-146 [ n |%6E|\156] +238:-018:-018 [_^_|%EE|\356]
+111:+111:-145 [ o |%6F|\157] +239:-017:-017 [_^_|%EF|\357]
+112:+112:-144 [ p |%70|\160] +240:-016:-016 [_^_|%F0|\360]
+113:+113:-143 [ q |%71|\161] +241:-015:-015 [_^_|%F1|\361]
+114:+114:-142 [ r |%72|\162] +242:-014:-014 [_^_|%F2|\362]
+115:+115:-141 [ s |%73|\163] +243:-013:-013 [_^_|%F3|\363]
+116:+116:-140 [ t |%74|\164] +244:-012:-012 [_^_|%F4|\364]
+117:+117:-139 [ u |%75|\165] +245:-011:-011 [_^_|%F5|\365]
+118:+118:-138 [ v |%76|\166] +246:-010:-010 [_^_|%F6|\366]
+119:+119:-137 [ w |%77|\167] +247:-009:-009 [_^_|%F7|\367]
+120:+120:-136 [ x |%78|\170] +248:-008:-008 [_^_|%F8|\370]
+121:+121:-135 [ y |%79|\171] +249:-007:-007 [_^_|%F9|\371]
+122:+122:-134 [ z |%7A|\172] +250:-006:-006 [_^_|%FA|\372]
+123:+123:-133 [ { |%7B|\173] +251:-005:-005 [_^_|%FB|\373]
+124:+124:-132 [ | |%7C|\174] +252:-004:-004 [_^_|%FC|\374]
+125:+125:-131 [ } |%7D|\175] +253:-003:-003 [_^_|%FD|\375]
+126:+126:-130 [ ~ |%7E|\176] +254:-002:-002 [_^_|%FE|\376]
+127:+127:-129 [_^_|%7F|\177] +255:-001:-001 [_^_|%FF|\377]
if u don't need the fanciness, the jot + od does plenty :
jot -n -s '' -c - 0 255 | od -bac -t x1u1 | lgp3 5
0000000 000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017
nul soh stx etx eot enq ack bel bs ht nl vt ff cr so si
\0 001 002 003 004 005 006 \a \b \t \n \v \f \r 016 017
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0000020 020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us
020 021 022 023 024 025 026 027 030 031 032 033 034 035 036 037
10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
0000040 040 041 042 043 044 045 046 047 050 051 052 053 054 055 056 057
sp ! " # $ % & ' ( ) * + , - . /
! " # $ % & ' ( ) * + , - . /
20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
0000060 060 061 062 063 064 065 066 067 070 071 072 073 074 075 076 077
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
0000100 100 101 102 103 104 105 106 107 110 111 112 113 114 115 116 117
# A B C D E F G H I J K L M N O
# A B C D E F G H I J K L M N O
40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
0000120 120 121 122 123 124 125 126 127 130 131 132 133 134 135 136 137
P Q R S T U V W X Y Z [ \ ] ^ _
P Q R S T U V W X Y Z [ \ ] ^ _
50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
0000140 140 141 142 143 144 145 146 147 150 151 152 153 154 155 156 157
` a b c d e f g h i j k l m n o
` a b c d e f g h i j k l m n o
60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
0000160 160 161 162 163 164 165 166 167 170 171 172 173 174 175 176 177
p q r s t u v w x y z { | } ~ del
p q r s t u v w x y z { | } ~ 177
70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
0000200 200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f
200 201 202 203 204 205 206 207 210 211 212 213 214 215 216 217
80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
0000220 220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f
220 221 222 223 224 225 226 227 230 231 232 233 234 235 236 237
90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
0000240 240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
240 241 242 243 244 245 246 247 250 251 252 253 254 255 256 257
a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
0000260 260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
260 261 262 263 264 265 266 267 270 271 272 273 274 275 276 277
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
0000300 300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
300 301 302 303 304 305 306 307 310 311 312 313 314 315 316 317
c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
0000320 320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
320 321 322 323 324 325 326 327 330 331 332 333 334 335 336 337
d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
0000340 340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
340 341 342 343 344 345 346 347 350 351 352 353 354 355 356 357
e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
0000360 360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
360 361 362 363 364 365 366 367 370 371 372 373 374 375 376 377
f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
0000400
When I am trying to provide a large input, it is truncating to a specific number.
eg. If I input around 50k-100k inputs(156 repeated number of times), its truncates to 1023. But when I provide input around 200k(shown below), it truncates to 1187.
if __name__ == '__main__':
iplist = list(map(int, input().rstrip().split()))
print("len of exp: ",len(iplist))
1) provide very large input:
eg. below is 1686 numbers input , but if you run the above code, it says length is : 1187:
Seems there is some character limit in shell as if I change a few numbers from 3 digit to 2 digit, or 1 digit, this length increases
0 82 180 55 168 41 179 59 139 71 6 12 135 139 73 157 4 74 195 60 45 28 67 136 58 55 22 60 33 84 48 185 118 29 41 86 22 172 145 114 43 103 126 130 43 152 87 199 26 34 59 24 63 79 160 73 86 134 133 71 18 182 57 89 163 98 175 137 70 73 3 113 176 130 43 19 34 83 170 12 117 30 36 132 61 197 5 99 131 91 171 102 25 28 143 188 126 118 77 148 143 81 61 120 163 56 91 149 91 62 161 161 44 198 93 57 195 51 156 78 142 127 132 119 107 75 59 33 146 136 133 89 169 146 161 84 3 5 33 46 67 195 7 63 193 53 120 140 56 28 170 150 156 103 69 63 178 128 49 124 64 182 166 186 129 79 70 84 84 104 82 103 51 42 166 44 95 38 136 103 67 106 53 175 161 122 190 140 50 39 16 66 174 134 52 55 14 123 91 98 179 173 2 30 15 120 26 62 159 114 165 178 172 18 153 134 140 143 26 142 135 42 9 61 129 61 68 143 136 159 193 67 132 195 49 100 68 27 114 27 141 80 157 66 50 110 0 191 5 26 133 92 20 142 105 149 156 173 44 44 84 38 112 169 185 113 69 53 141 183 32 34 15 189 100 66 51 52 9 57 78 94 101 51 37 159 152 145 132 197 189 17 187 53 138 172 167 159 26 108 142 58 94 110 48 195 176 51 47 137 108 78 31 162 129 20 121 33 165 5 182 107 174 169 112 112 142 79 71 120 139 166 178 34 76 178 181 4 30 28 93 90 58 124 4 139 145 125 173 62 131 155 121 57 125 34 170 19 65 41 139 5 159 69 191 187 0 172 143 182 152 36 24 163 161 29 102 58 154 27 120 37 183 194 95 60 28 17 79 93 10 170 50 170 39 193 157 191 117 101 173 22 89 198 185 50 27 87 108 133 115 181 123 50 175 170 62 155 187 141 0 197 63 3 119 102 196 29 46 66 82 19 88 171 169 73 22 196 112 82 82 179 15 157 181 142 127 43 97 66 136 50 15 199 53 135 54 1 116 100 67 198 119 155 121 89 180 95 37 93 178 71 24 145 28 6 88 107 1 137 173 138 139 141 137 192 28 191 146 144 43 13 94 163 169 15 4 101 111 193 146 41 17 171 138 197 129 178 105 130 116 30 68 7 171 158 152 151 149 98 95 193 111 141 108 32 157 64 134 20 57 80 61 26 3 199 24 132 178 129 63 46 111 83 53 35 41 5 186 143 55 34 88 119 175 148 151 132 12 37 104 21 70 165 48 25 117 72 158 47 153 173 93 16 56 98 51 50 56 38 193 63 24 81 182 199 29 134 84 193 123 188 166 145 106 14 171 23 38 129 22 143 54 67 160 62 165 11 112 173 1 105 37 25 138 19 25 119 105 61 64 181 49 31 126 155 45 97 130 36 178 152 179 32 19 139 47 137 151 159 62 152 17 51 130 107 23 155 27 128 168 91 109 17 74 188 125 120 85 7 108 16 160 87 48 131 27 95 20 130 7 35 34 24 86 164 131 109 71 110 190 39 154 99 9 28 39 134 100 125 93 8 141 5 96 141 137 75 189 109 157 196 144 143 172 31 60 103 92 83 166 82 75 120 134 84 148 173 170 1 98 63 9 191 69 57 133 158 84 74 19 41 70 164 137 42 147 197 97 39 80 63 122 155 135 56 191 36 29 113 37 80 129 46 71 150 56 156 108 140 30 127 134 100 43 71 94 190 68 144 182 100 159 104 8 95 112 151 131 141 65 168 21 146 166 45 96 22 1 156 163 184 35 97 36 79 120 131 21 140 27 3 192 186 59 0 81 171 152 12 113 169 132 86 115 99 83 163 121 37 119 36 21 154 85 57 185 157 140 7 97 167 162 90 154 22 42 35 193 146 0 58 115 84 97 182 183 180 145 57 17 64 45 190 171 83 48 156 40 188 163 138 156 78 180 62 100 22 49 45 169 49 104 36 134 153 171 69 133 116 78 103 133 124 93 104 7 93 12 199 82 128 137 190 6 69 52 106 92 101 151 13 103 7 1 189 160 172 10 46 89 89 101 174 165 194 30 124 40 42 123 74 170 13 64 176 82 68 34 126 169 186 139 24 193 141 13 106 113 24 152 154 65 53 128 182 199 158 106 39 1 181 113 123 194 129 100 29 197 134 155 119 72 95 143 18 188 109 124 101 85 76 8 102 81 136 84 32 47 142 72 0 123 137 123 70 67 175 99 16 110 6 135 134 101 31 152 89 92 76 143 129 104 151 31 185 39 115 170 38 57 42 190 132 131 114 154 150 41 53 167 103 60 54 38 113 37 190 155 81 19 98 10 123 1 41 61 192 108 31 31 117 25 21 50 108 87 4 59 129 10 178 184 22 32 22 135 22 165 42 103 184 92 66 59 93 107 72 86 168 55 69 85 80 42 87 189 130 92 0 11 54 178 195 76 162 170 163 184 135 6 40 119 98 106 130 192 165 3 30 133 58 51 171 91 93 58 32 175 150 32 138 4 162 86 32 124 56 196 61 191 2 53 62 52 111 192 44 76 147 26 162 6 29 133 49 75 191 81 50 94 65 141 50 179 27 83 103 83 31 116 26 185 121 88 37 32 32 34 61 180 12 175 138 42 108 139 117 51 172 119 97 37 12 148 168 39 183 23 74 14 140 100 151 61 140 188 46 125 22 107 57 35 34 147 29 142 86 98 145 58 17 43 47 30 143 15 21 126 38 96 92 130 148 43 144 41 183 190 118 158 49 127 145 83 74 174 177 160 72 74 170 41 117 17 23 60 32 45 138 22 93 182 153 193 177 97 186 161 39 104 119 40 183 64 123 57 38 52 17 62 126 187 103 196 156 79 8 140 76 147 163 169 81 68 114 59 117 101 20 156 157 139 196 141 155 71 150 145 123 168 7 1 107 62 197 16 141 158 156 17 105 119 138 138 187 53 197 56 106 17 12 15 108 160 108 63 31 59 8 106 179 167 60 38 182 9 54 75 167 11 45 24 82 183 163 22 188 160 78 46 178 43 14 38 3 122 54 187 181 14 45 112 182 105 151 116 115 5 191 34 168 36 59 51 172 22 25 112 182 103 111 112 146 125 151 102 199 157 89 133 171 134 45 153 192 196 21 59 154 13 93 74 1 152 125 125 126 150 190 61 6 101 173 104 178 76 6 177 33 95 110 5 182 156 110 174 104 132 185 10 97 78 85 50 183 162 176 109 65 166 170 71 19 96 127 197 124 134 126 110 29 37 67 163 145 129 137 1 61 122 164 110 153 1 161 136 163 89 197 180 7 120 51 26 16 131 175 92 65 101 2 46 90 69 10 187 199 99 141 12 174 57 75 127 58 36 15 21 125 164 2 84 84 5 110 52 136 37 145 153 90 99 0 181 121 10 120 72 61 13 36 35 70 111 114 128 99 81 102 176 46 104 60 130 61 122 135 150 159 32 103 50 83 55 183 4 65 103 28 79 69 65 114 139 128 181 20 28 62 122 4 108 178 17 191 191 139 78 141 99 110 197 149 193 52 132 150 70 187 178 149 56 43 63 148 172 44 168 152 59 42 108 167 172 125 110 163 65 188 105 164 50 54 65 44 106 149 146 176 88 124 125 145 120 141 45 44 137 165 196 196 159 56 116 131 182 178 94 47 167 151 163 169 5 180 165 112 129 111 40 17 36 166 114 108 59 111 152 196 76 100 145 35 156 61 166 90 39 13 89 158 164 4 128 170 184 45 34 65 157 74 35 145 192 149 53 51 13 157 0 41 9 145 29 117 6 195 8 197 160 97 108 125 102 188
Could you please explain this? If this is python/shell issue and how can I overcome it ? I am trying to run a hackerrank test case which is having very large input around 200000. But I am not able to run that testcase in my terminal due to this limitation.
This is indeed a limitation specific to the shell, rather than Python. Just to bring your attention to some things, here is what you can do in the future:
Initial hint - if you paste this and attempt to add characters in a modern shell you see you can't!
paste your input into a file, preferably with one item on a line.
Add a few debug lines
if __name__ == '__main__':
iplist = list(map(int, input().rstrip().split()))
with open('test.dat','w') as fd:
fd.write('\n'.join(str(x) for x in iplist))
print("len of exp: ",len(iplist),iplist[0],iplist[-1])
So now you have a quick reference to the first and last read items in the list, and a file containing the entire read list. Immediately you see the last item is 188 - suspicious.
If you pasted your input into a file in (1) you can easily check line 1187 is indeed 188.
Using the test file above you can count characters in the input actually read using a tool such as wc -c test.dat.
I get 4095, which is suspiciously close to 4096 = 4 KiB (often written as kB)
This is a clear hint for a "system" level limitation, likely your shell, limiting the amount of characters you are allowed to put in a single line. This specific limitation is pretty standard, and you can probably find somewhere the documentation for the limit.
Jack's answer is the way to go here - this is no way to read large input.
You are correct that there is a character limit in shell commands which it looks like you are hitting with that much of data on the command line.
I would refer you to the man page for that but you will not need to know it precisely hopefully ever.
The reason for that is you'll never want to put yourself in this position and to avoid that, all you need to do is save your input to a file, and change your python to open that file and read it line by line. Many examples on SO how to do something like that.
I hope that helps.