質問編集履歴

5

ソースコード編集

2022/01/08 02:40

投稿

epsilon
epsilon

スコア2

test CHANGED
File without changes
test CHANGED
@@ -56,17 +56,9 @@
56
56
 
57
57
  # x軸; 角度
58
58
 
59
- # y軸は
60
-
61
- #1; heat-O2
59
+ # y軸は: heat-O2
62
-
63
- #2; thermo-C8H18
60
+
64
-
65
- #3; thermo-radius
61
+
66
-
67
- #4; O2-radius
68
-
69
- #5; C8H18-radiusの5種類
70
62
 
71
63
 
72
64
 
@@ -94,146 +86,20 @@
94
86
 
95
87
 
96
88
 
89
+
90
+
91
+
92
+
97
- #heat-C8H18のグラフ作成(1)
93
+ #第2に付け足すもの↓
98
-
99
- chart_h_C8H18 = ScatterChart()
94
+
100
-
101
- #chart_t.title = ""
95
+
102
-
103
- chart_h_C8H18.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
96
+
104
-
105
- chart_h_C8H18.y_axis.title = "Thermo diffusion [J/m^3/s]"
106
-
107
- chart_h_C8H18.y_axis.scaling.logBase = 10
108
-
109
- chart_h_C8H18.y_axis.numFmt = "0.00E+00"
110
-
111
- chart_h_C8H18.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
112
-
113
- chart_h_C8H18.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
114
-
115
- chart_h_C8H18.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
116
-
117
- chart_h_C8H18.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
118
-
119
-
120
-
121
- #heat-radiusのグラフ作成(第1軸)
122
-
123
- chart_h_r = ScatterChart()
124
-
125
- #chart_t.title = ""
126
-
127
- chart_h_r.x_axis.title = "Angular cordinate [deg.]"
128
-
129
- chart_h_r.y_axis.title = "Thermo diffusion [J/m^3/s]"
130
-
131
- chart_h_r.y_axis.scaling.logBase = 10
132
-
133
- chart_h_r.y_axis.numFmt = "0.00E+00"
134
-
135
- chart_h_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
136
-
137
- chart_h_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
138
-
139
- chart_h_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
140
-
141
- chart_h_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
142
-
143
-
144
-
145
- #C8H18-radiusのグラフ作成(第1軸)
146
-
147
- chart_C8H18_r = ScatterChart()
148
-
149
- #chart_C8H18_r.title = "O2拡散量"
150
-
151
- chart_C8H18_r.x_axis.title = "Angular cordinate [deg.]"
152
-
153
- chart_C8H18_r.y_axis.title = "C8H18 diffusion [kg/m^3/s]"
154
-
155
- chart_C8H18_r.y_axis.numFmt = "0.00E+00"
156
-
157
- chart_C8H18_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
158
-
159
- chart_C8H18_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
160
-
161
- chart_C8H18_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
162
-
163
- chart_C8H18_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
164
-
165
-
166
-
167
- #O2-radiusのグラフ作成(第1軸)
97
+ #O2のグラフ作成(第2軸)
168
-
98
+
169
- chart_O2_r = ScatterChart()
99
+ chart_O2_2 = ScatterChart()
170
100
 
171
101
  #chart_C8H18.title = "O2拡散量"
172
102
 
173
- chart_O2_r.x_axis.title = "Angular cordinate [deg.]"
174
-
175
- chart_O2_r.y_axis.title = "O2 diffusion [kg/m^3/s]"
176
-
177
- chart_O2_r.y_axis.numFmt = "0.00E+00"
178
-
179
- chart_O2_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
180
-
181
- chart_O2_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
182
-
183
- chart_O2_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
184
-
185
- chart_O2_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
186
-
187
-
188
-
189
- #第2軸に付け足すもの↓
190
-
191
- #radiusのグラフ作成(第2軸)
192
-
193
- chart_r_2 = ScatterChart()
194
-
195
- #chart_r.title = "熱拡散量"
196
-
197
- chart_r_2.y_axis.title = "Flame radius [m]"
198
-
199
- #chart_r_2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
200
-
201
- chart_r_2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
202
-
203
- #chart_r_2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
204
-
205
- chart_r_2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
206
-
207
-
208
-
209
- #C8H18のグラフ作成(第2軸)
210
-
211
- chart_C8H18_2 = ScatterChart()
212
-
213
- #chart_C8H18_2.title = "C8H18拡散量"
214
-
215
- #chart_C8H18_2.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
216
-
217
- chart_C8H18_2.y_axis.title = "C8H18 diffusion [kg/m^3/s]"
218
-
219
- chart_C8H18_2.y_axis.numFmt = "0.00E+00"
220
-
221
- #chart_C8H18_2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
222
-
223
- chart_C8H18_2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
224
-
225
- #chart_C8H18_2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
226
-
227
- chart_C8H18_2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
228
-
229
-
230
-
231
- #O2のグラフ作成(第2軸)
232
-
233
- chart_O2_2 = ScatterChart()
234
-
235
- #chart_C8H18.title = "O2拡散量"
236
-
237
103
  #chart_O2.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
238
104
 
239
105
  chart_O2_2.y_axis.title = "O2 diffusion [kg/m^3/s]"
@@ -284,15 +150,13 @@
284
150
 
285
151
  # 系列のデータをSeriesオブジェクトとして定義する
286
152
 
287
- series_r = Series(rvalues, agvalues, title = " Location from "+ str(temp_min) + "K to " + str(temp_max) + "K (Flame radius)" )
153
+
288
154
 
289
155
  series_h = Series(thermovalues, agvalues, title = "Thermo diffusion")
290
156
 
291
157
  series_O2 = Series(O2values, agvalues, title = "O2 diffusion" )
292
158
 
293
- series_C8H18 = Series(C8H18values, agvalues, title = "C8H18 diffusion")
159
+
294
-
295
-
296
160
 
297
161
  serieslist = [series_r, series_h, series_O2, series_C8H18]
298
162
 
@@ -356,47 +220,25 @@
356
220
 
357
221
  chart_h_O2.series.append(series_h)
358
222
 
359
- chart_h_C8H18.series.append(series_h)
223
+
360
-
361
- chart_h_r.series.append(series_h)
362
-
363
- chart_C8H18_r.series.append(series_C8H18)
364
-
365
- chart_O2_r.series.append(series_O2)
366
-
367
-
368
224
 
369
225
  #第2軸となるグラフ
370
226
 
371
227
  chart_O2_2.series.append(series_O2)
372
228
 
373
- chart_C8H18_2.series.append(series_C8H18)
229
+
374
-
375
- chart_r_2.series.append(series_r)
376
-
377
-
378
230
 
379
231
  #第2軸のグラフを第1軸のグラフに合成
380
232
 
381
233
  chart_h_O2 += chart_O2_2
382
234
 
383
- chart_h_C8H18 += chart_C8H18_2
235
+
384
-
385
- chart_h_r += chart_r_2
236
+
386
-
387
- chart_C8H18_r += chart_r_2
237
+
388
-
389
- chart_O2_r += chart_r_2
238
+
390
-
391
-
392
-
393
-  #第1軸となるグラフのリスト
239
+  #第1軸となるグラフに凡例を追加
394
-
395
- chartlist = [chart_h_O2, chart_h_C8H18, chart_h_r, chart_C8H18_r, chart_O2_r]
240
+
396
-
397
- for chart in chartlist:
398
-
399
- chart.legend.legendPos = "b"
241
+ chart_h_O2.legend.legendPos = "b"
400
242
 
401
243
 
402
244
 
@@ -414,15 +256,11 @@
414
256
 
415
257
 
416
258
 
417
- ws.add_chart(chart_h_r, 'AH2')
259
+
418
-
419
- ws.add_chart(chart_O2_r, 'AH20')
260
+
420
-
421
- ws.add_chart(chart_C8H18_r, 'AH38')
422
-
423
- ws.add_chart(chart_h_O2, 'AH56')
261
+ ws.add_chart(chart_h_O2, 'AH2')
424
-
425
- ws.add_chart(chart_h_C8H18, 'AH74')
262
+
263
+
426
264
 
427
265
 
428
266
 

4

タグ追加

2022/01/08 02:40

投稿

epsilon
epsilon

スコア2

test CHANGED
File without changes
test CHANGED
File without changes

3

補足

2021/12/30 05:16

投稿

epsilon
epsilon

スコア2

test CHANGED
File without changes
test CHANGED
@@ -36,6 +36,12 @@
36
36
 
37
37
 
38
38
 
39
+ ここから横軸はタイトル1,縦軸にタイトル2,3のデータを使用して,
40
+
41
+ グラフを作成したいと思っています。
42
+
43
+
44
+
39
45
  必要な設定など,何か分かる方いたらよろしくお願いします。
40
46
 
41
47
 

2

補足

2021/12/27 08:42

投稿

epsilon
epsilon

スコア2

test CHANGED
File without changes
test CHANGED
@@ -46,7 +46,21 @@
46
46
 
47
47
  ```python
48
48
 
49
-
49
+ #生成されるグラフは
50
+
51
+ # x軸; 角度
52
+
53
+ # y軸は
54
+
55
+ #1; heat-O2
56
+
57
+ #2; thermo-C8H18
58
+
59
+ #3; thermo-radius
60
+
61
+ #4; O2-radius
62
+
63
+ #5; C8H18-radiusの5種類
50
64
 
51
65
 
52
66
 

1

書式の改善

2021/12/23 08:50

投稿

epsilon
epsilon

スコア2

test CHANGED
@@ -1 +1 @@
1
- openpyxlを利用して,Excelで縦軸が2つあるグラフ作成した
1
+ openpyxlを利用して,Excelで縦軸が2つあるグラフ作成できな
test CHANGED
@@ -1,9 +1,413 @@
1
+ ### 前提・実現したいこと
2
+
1
- python3.9でopenpyxlを利用して,縦軸が2つあるグラフを作成したいのでが,
3
+ python3.9でopenpyxlを利用して,縦軸が2つある散布図グラフを作成したいと思っていま
4
+
5
+
6
+
2
-
7
+ ### 発生している問題・エラーメッセージ
8
+
9
+ 下のリンクを参考に書いても,エラーなどは無く動くのですが,
10
+
3
- リンクの通りに書いても,第2軸が来るはずの左側の縦軸が表示されない状態です。
11
+ 結果グラフで,第2軸が来るはずの左側の縦軸が表示されない状態です。
12
+
13
+
4
14
 
5
15
  https://stackoverflow.com/questions/63696835/python-openpyxl-scatter-plots-with-secondary-y-axis
6
16
 
7
17
 
8
18
 
19
+
20
+
21
+ 生データは,1行目に項目名のタイトル,
22
+
23
+ 2行目以降にデータが行方向に並んだexcelファイルです
24
+
25
+
26
+
27
+ タイトル1 タイトル2 タイトル3
28
+
29
+ 〇 △    ◆
30
+
31
+ 〇 △    ◆ 
32
+
33
+ 〇 △    ◆
34
+
35
+ 〇 △    ◆
36
+
37
+
38
+
9
39
  必要な設定など,何か分かる方いたらよろしくお願いします。
40
+
41
+
42
+
43
+ ### ソースコード
44
+
45
+
46
+
47
+ ```python
48
+
49
+
50
+
51
+
52
+
53
+ #heat-O2のグラフ作成(第1軸)
54
+
55
+ chart_h_O2 = ScatterChart()
56
+
57
+ #chart_t.title = ""
58
+
59
+ chart_h_O2.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
60
+
61
+ chart_h_O2.y_axis.title = "Thermo diffusion [J/m^3/s]"
62
+
63
+ chart_h_O2.y_axis.scaling.logBase = 10
64
+
65
+ chart_h_O2.y_axis.numFmt = "0.00E+00"
66
+
67
+ chart_h_O2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
68
+
69
+ chart_h_O2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
70
+
71
+ chart_h_O2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
72
+
73
+ chart_h_O2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
74
+
75
+
76
+
77
+ #heat-C8H18のグラフ作成(第1軸)
78
+
79
+ chart_h_C8H18 = ScatterChart()
80
+
81
+ #chart_t.title = ""
82
+
83
+ chart_h_C8H18.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
84
+
85
+ chart_h_C8H18.y_axis.title = "Thermo diffusion [J/m^3/s]"
86
+
87
+ chart_h_C8H18.y_axis.scaling.logBase = 10
88
+
89
+ chart_h_C8H18.y_axis.numFmt = "0.00E+00"
90
+
91
+ chart_h_C8H18.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
92
+
93
+ chart_h_C8H18.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
94
+
95
+ chart_h_C8H18.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
96
+
97
+ chart_h_C8H18.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
98
+
99
+
100
+
101
+ #heat-radiusのグラフ作成(第1軸)
102
+
103
+ chart_h_r = ScatterChart()
104
+
105
+ #chart_t.title = ""
106
+
107
+ chart_h_r.x_axis.title = "Angular cordinate [deg.]"
108
+
109
+ chart_h_r.y_axis.title = "Thermo diffusion [J/m^3/s]"
110
+
111
+ chart_h_r.y_axis.scaling.logBase = 10
112
+
113
+ chart_h_r.y_axis.numFmt = "0.00E+00"
114
+
115
+ chart_h_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
116
+
117
+ chart_h_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
118
+
119
+ chart_h_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
120
+
121
+ chart_h_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
122
+
123
+
124
+
125
+ #C8H18-radiusのグラフ作成(第1軸)
126
+
127
+ chart_C8H18_r = ScatterChart()
128
+
129
+ #chart_C8H18_r.title = "O2拡散量"
130
+
131
+ chart_C8H18_r.x_axis.title = "Angular cordinate [deg.]"
132
+
133
+ chart_C8H18_r.y_axis.title = "C8H18 diffusion [kg/m^3/s]"
134
+
135
+ chart_C8H18_r.y_axis.numFmt = "0.00E+00"
136
+
137
+ chart_C8H18_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
138
+
139
+ chart_C8H18_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
140
+
141
+ chart_C8H18_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
142
+
143
+ chart_C8H18_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
144
+
145
+
146
+
147
+ #O2-radiusのグラフ作成(第1軸)
148
+
149
+ chart_O2_r = ScatterChart()
150
+
151
+ #chart_C8H18.title = "O2拡散量"
152
+
153
+ chart_O2_r.x_axis.title = "Angular cordinate [deg.]"
154
+
155
+ chart_O2_r.y_axis.title = "O2 diffusion [kg/m^3/s]"
156
+
157
+ chart_O2_r.y_axis.numFmt = "0.00E+00"
158
+
159
+ chart_O2_r.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
160
+
161
+ chart_O2_r.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
162
+
163
+ chart_O2_r.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
164
+
165
+ chart_O2_r.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
166
+
167
+
168
+
169
+ #第2軸に付け足すもの↓
170
+
171
+ #radiusのグラフ作成(第2軸)
172
+
173
+ chart_r_2 = ScatterChart()
174
+
175
+ #chart_r.title = "熱拡散量"
176
+
177
+ chart_r_2.y_axis.title = "Flame radius [m]"
178
+
179
+ #chart_r_2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
180
+
181
+ chart_r_2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
182
+
183
+ #chart_r_2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
184
+
185
+ chart_r_2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
186
+
187
+
188
+
189
+ #C8H18のグラフ作成(第2軸)
190
+
191
+ chart_C8H18_2 = ScatterChart()
192
+
193
+ #chart_C8H18_2.title = "C8H18拡散量"
194
+
195
+ #chart_C8H18_2.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
196
+
197
+ chart_C8H18_2.y_axis.title = "C8H18 diffusion [kg/m^3/s]"
198
+
199
+ chart_C8H18_2.y_axis.numFmt = "0.00E+00"
200
+
201
+ #chart_C8H18_2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
202
+
203
+ chart_C8H18_2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
204
+
205
+ #chart_C8H18_2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
206
+
207
+ chart_C8H18_2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
208
+
209
+
210
+
211
+ #O2のグラフ作成(第2軸)
212
+
213
+ chart_O2_2 = ScatterChart()
214
+
215
+ #chart_C8H18.title = "O2拡散量"
216
+
217
+ #chart_O2.x_axis.title = "Angular cordinate [deg.] (from"+ str(temp_min) + "K to " + str(temp_max) + "K)"
218
+
219
+ chart_O2_2.y_axis.title = "O2 diffusion [kg/m^3/s]"
220
+
221
+ chart_O2_2.y_axis.numFmt = "0.00E+00"
222
+
223
+ #chart_O2.x_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
224
+
225
+ chart_O2_2.y_axis.spPr = GraphicalProperties(ln =LineProperties(solidFill="E6E6E6", w=1*12700))
226
+
227
+ #chart_O2.x_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
228
+
229
+ chart_O2_2.y_axis.majorGridlines.spPr = GraphicalProperties(ln=LineProperties(solidFill= "E6E6E6", w=0.01*12700))
230
+
231
+
232
+
233
+ # 凡例の配置位置
234
+
235
+ #chart1.legend.position = 'b'
236
+
237
+ #r,l,t,b and tr for right, left, top, bottom and top right. default is right.
238
+
239
+
240
+
241
+ nrow=ws.max_row
242
+
243
+ ncol=ws.max_column
244
+
245
+
246
+
247
+ # 系列のY軸の値の参照する
248
+
249
+ rvalues = Reference(ws, min_col=r+1, max_col=r+1, min_row=2, max_row=73)
250
+
251
+ thermovalues = Reference(ws, min_col=h+1, max_col=h+1, min_row=2, max_row=73)
252
+
253
+ O2values = Reference(ws, min_col=O2+1, max_col=O2+1, min_row=2, max_row=73)
254
+
255
+ C8H18values = Reference(ws, min_col=C8H18+1, max_col=C8H18+1, min_row=2, max_row=73)
256
+
257
+
258
+
259
+ # 系列のX軸の値の参照する
260
+
261
+ agvalues = Reference(ws, min_col=ag+1, max_col=ag+1, min_row=2, max_row=73)
262
+
263
+
264
+
265
+ # 系列のデータをSeriesオブジェクトとして定義する
266
+
267
+ series_r = Series(rvalues, agvalues, title = " Location from "+ str(temp_min) + "K to " + str(temp_max) + "K (Flame radius)" )
268
+
269
+ series_h = Series(thermovalues, agvalues, title = "Thermo diffusion")
270
+
271
+ series_O2 = Series(O2values, agvalues, title = "O2 diffusion" )
272
+
273
+ series_C8H18 = Series(C8H18values, agvalues, title = "C8H18 diffusion")
274
+
275
+
276
+
277
+ serieslist = [series_r, series_h, series_O2, series_C8H18]
278
+
279
+
280
+
281
+ # 各系列のプロットを表現するマーカーのシンボルの指定を辞書形式で用意
282
+
283
+ #marker_symbol = {1:"triangle", 2:"diamond", 3:"square", 4:"star", 5:"circle", 6:"plus"}
284
+
285
+
286
+
287
+ # マーカーを塗り潰す色を同様に辞書形式で用意
288
+
289
+ # 色の指定はRGBのHex指定とColorChoiceオブジェクト指定による2タイプで指定
290
+
291
+ #marker_solidFill = {1:"00bFFF", 2:"FF4500", 3:"FFF0F",
292
+
293
+ # 4:ColorChoice(prstClr="midnightBlue"),
294
+
295
+ # 5:ColorChoice(prstClr="yellowGreen"),
296
+
297
+ # 6:ColorChoice(prstClr="cornflowerBlue")}
298
+
299
+
300
+
301
+
302
+
303
+ #各系列のマーカーの形状,色を指定
304
+
305
+ marker_solidFill = {1:"4169e1", 2:"ffc0cb", 3:"90ee90", 4:"90ee90"}
306
+
307
+ marker_linesolidFill = {1:"191970", 2:"ff4500", 3:"228b22", 4:"228b22"}
308
+
309
+ for i, obj in enumerate(serieslist, 1):
310
+
311
+
312
+
313
+ # ラインの設定
314
+
315
+ #obj.graphicalProperties.line.noFill = True
316
+
317
+ obj.spPr.ln.solidFill = marker_linesolidFill[i]
318
+
319
+ # 以下マーカーの設定
320
+
321
+ obj.marker.symbol = "circle" # シンボルを指定
322
+
323
+ obj.marker.size = 5 # サイズを指定
324
+
325
+ obj.marker.graphicalProperties.solidFill = marker_solidFill[i] # 塗りつぶし色
326
+
327
+ obj.marker.graphicalProperties.line.solidFill = marker_linesolidFill[i] # 枠線色
328
+
329
+
330
+
331
+ #各系列をグラフに追加
332
+
333
+
334
+
335
+ #第1軸となるグラフ
336
+
337
+ chart_h_O2.series.append(series_h)
338
+
339
+ chart_h_C8H18.series.append(series_h)
340
+
341
+ chart_h_r.series.append(series_h)
342
+
343
+ chart_C8H18_r.series.append(series_C8H18)
344
+
345
+ chart_O2_r.series.append(series_O2)
346
+
347
+
348
+
349
+ #第2軸となるグラフ
350
+
351
+ chart_O2_2.series.append(series_O2)
352
+
353
+ chart_C8H18_2.series.append(series_C8H18)
354
+
355
+ chart_r_2.series.append(series_r)
356
+
357
+
358
+
359
+ #第2軸のグラフを第1軸のグラフに合成
360
+
361
+ chart_h_O2 += chart_O2_2
362
+
363
+ chart_h_C8H18 += chart_C8H18_2
364
+
365
+ chart_h_r += chart_r_2
366
+
367
+ chart_C8H18_r += chart_r_2
368
+
369
+ chart_O2_r += chart_r_2
370
+
371
+
372
+
373
+  #第1軸となるグラフのリスト
374
+
375
+ chartlist = [chart_h_O2, chart_h_C8H18, chart_h_r, chart_C8H18_r, chart_O2_r]
376
+
377
+ for chart in chartlist:
378
+
379
+ chart.legend.legendPos = "b"
380
+
381
+
382
+
383
+
384
+
385
+ #第2軸となるグラフのリスト
386
+
387
+ chartlist2 = [chart_O2_2, chart_C8H18_2, chart_r_2]
388
+
389
+ for chart in chartlist2:
390
+
391
+ #自分のソースコードでは,第2軸が右に来るようにしています.
392
+
393
+  chart.y_axis.crosses = "max"
394
+
395
+
396
+
397
+ ws.add_chart(chart_h_r, 'AH2')
398
+
399
+ ws.add_chart(chart_O2_r, 'AH20')
400
+
401
+ ws.add_chart(chart_C8H18_r, 'AH38')
402
+
403
+ ws.add_chart(chart_h_O2, 'AH56')
404
+
405
+ ws.add_chart(chart_h_C8H18, 'AH74')
406
+
407
+
408
+
409
+ wb.save(file)
410
+
411
+ wb.close
412
+
413
+ ```