Skip to content

Commit 1c49f85

Browse files
committed
Fixes for PythonPlot
1 parent 86ae21a commit 1c49f85

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

ext/VortexStepMethodControlPlotsExt.jl

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -378,16 +378,16 @@ function VortexStepMethod.plot_distribution(y_coordinates_list, results_list, la
378378
else
379379
label = label_i * L" $C_\mathrm{L}$: " * value
380380
end
381-
axs[1, 1].plot(
381+
axs[0, 0].plot(
382382
y_coordinates_i,
383383
result_i["cl_distribution"],
384384
label=label
385385
)
386386
end
387-
axs[1, 1].set_title(L"$C_\mathrm{L}$ Distribution", size=16)
388-
axs[1, 1].set_xlabel(L"Spanwise Position $y/b$")
389-
axs[1, 1].set_ylabel(L"Lift Coefficient $C_\mathrm{L}$")
390-
axs[1, 1].legend()
387+
axs[0, 0].set_title(L"$C_\mathrm{L}$ Distribution", size=16)
388+
axs[0, 0].set_xlabel(L"Spanwise Position $y/b$")
389+
axs[0, 0].set_ylabel(L"Lift Coefficient $C_\mathrm{L}$")
390+
axs[0, 0].legend()
391391

392392
# CD plot
393393
for (y_coordinates_i, result_i, label_i) in zip(y_coordinates_list, results_list, label_list)
@@ -397,74 +397,74 @@ function VortexStepMethod.plot_distribution(y_coordinates_list, results_list, la
397397
else
398398
label = label_i * L" $C_\mathrm{D}$: " * value
399399
end
400-
axs[1, 2].plot(
400+
axs[0, 1].plot(
401401
y_coordinates_i,
402402
result_i["cd_distribution"],
403403
label=label
404404
)
405405
end
406-
axs[1, 2].set_title(L"$C_\mathrm{D}$ Distribution", size=16)
407-
axs[1, 2].set_xlabel(L"Spanwise Position $y/b$")
408-
axs[1, 2].set_ylabel(L"Drag Coefficient $C_\mathrm{D}$")
409-
axs[1, 2].legend()
406+
axs[0, 1].set_title(L"$C_\mathrm{D}$ Distribution", size=16)
407+
axs[0, 1].set_xlabel(L"Spanwise Position $y/b$")
408+
axs[0, 1].set_ylabel(L"Drag Coefficient $C_\mathrm{D}$")
409+
axs[0, 1].legend()
410410

411411
# Gamma Distribution
412412
for (y_coordinates_i, result_i, label_i) in zip(y_coordinates_list, results_list, label_list)
413-
axs[1, 3].plot(
413+
axs[0, 2].plot(
414414
y_coordinates_i,
415415
result_i["gamma_distribution"],
416416
label=label_i
417417
)
418418
end
419-
axs[1, 3].set_title(L"\Gamma~Distribution", size=16)
420-
axs[1, 3].set_xlabel(L"Spanwise Position $y/b$")
421-
axs[1, 3].set_ylabel(L"Circulation~\Gamma")
422-
axs[1, 3].legend()
419+
axs[0, 2].set_title(L"\Gamma~Distribution", size=16)
420+
axs[0, 2].set_xlabel(L"Spanwise Position $y/b$")
421+
axs[0, 2].set_ylabel(L"Circulation~\Gamma")
422+
axs[0, 2].legend()
423423

424424
# Geometric Alpha
425425
for (y_coordinates_i, result_i, label_i) in zip(y_coordinates_list, results_list, label_list)
426-
axs[2, 1].plot(
426+
axs[1, 0].plot(
427427
y_coordinates_i,
428428
result_i["alpha_geometric"],
429429
label=label_i
430430
)
431431
end
432-
axs[2, 1].set_title(L"$\alpha$ Geometric", size=16)
433-
axs[2, 1].set_xlabel(L"Spanwise Position $y/b$")
434-
axs[2, 1].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
435-
axs[2, 1].legend()
432+
axs[1, 0].set_title(L"$\alpha$ Geometric", size=16)
433+
axs[1, 0].set_xlabel(L"Spanwise Position $y/b$")
434+
axs[1, 0].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
435+
axs[1, 0].legend()
436436

437437
# Calculated/ Corrected Alpha
438438
for (y_coordinates_i, result_i, label_i) in zip(y_coordinates_list, results_list, label_list)
439-
axs[2, 2].plot(
439+
axs[1, 1].plot(
440440
y_coordinates_i,
441441
result_i["alpha_at_ac"],
442442
label=label_i
443443
)
444444
end
445-
axs[2, 2].set_title(L"$\alpha$ result (corrected to aerodynamic center)", size=16)
446-
axs[2, 2].set_xlabel(L"Spanwise Position $y/b$")
447-
axs[2, 2].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
448-
axs[2, 2].legend()
445+
axs[1, 1].set_title(L"$\alpha$ result (corrected to aerodynamic center)", size=16)
446+
axs[1, 1].set_xlabel(L"Spanwise Position $y/b$")
447+
axs[1, 1].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
448+
axs[1, 1].legend()
449449

450450
# Uncorrected Alpha plot
451451
for (y_coordinates_i, result_i, label_i) in zip(y_coordinates_list, results_list, label_list)
452-
axs[2, 3].plot(
452+
axs[1, 2].plot(
453453
y_coordinates_i,
454454
result_i["alpha_uncorrected"],
455455
label=label_i
456456
)
457457
end
458-
axs[2, 3].set_title(L"$\alpha$ Uncorrected (if VSM, at the control point)", size=16)
459-
axs[2, 3].set_xlabel(L"Spanwise Position $y/b$")
460-
axs[2, 3].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
461-
axs[2, 3].legend()
458+
axs[1, 2].set_title(L"$\alpha$ Uncorrected (if VSM, at the control point)", size=16)
459+
axs[1, 2].set_xlabel(L"Spanwise Position $y/b$")
460+
axs[1, 2].set_ylabel(L"Angle of Attack $\alpha$ (deg)")
461+
axs[1, 2].legend()
462462

463463
# Force Components
464464
for (idx, component) in enumerate(["x", "y", "z"])
465-
axs[3, idx].set_title("Force in $component direction", size=16)
466-
axs[3, idx].set_xlabel(L"Spanwise Position $y/b$")
467-
axs[3, idx].set_ylabel(raw"$F_\mathrm" * "{$component}" * raw"$")
465+
axs[2, idx-1].set_title("Force in $component direction", size=16)
466+
axs[2, idx-1].set_xlabel(L"Spanwise Position $y/b$")
467+
axs[2, idx-1].set_ylabel(raw"$F_\mathrm" * "{$component}" * raw"$")
468468
for (y_coords, results, label) in zip(y_coordinates_list, results_list, label_list)
469469
# Extract force components for the current direction (idx)
470470
forces = results["F_distribution"][idx, :]
@@ -477,13 +477,13 @@ function VortexStepMethod.plot_distribution(y_coordinates_list, results_list, la
477477
if label == "LLT"
478478
space = "~"
479479
end
480-
axs[3, idx].plot(
480+
axs[2, idx-1].plot(
481481
y_coords,
482482
forces,
483483
label="$label" * space * raw"$~\Sigma~F_\mathrm" * "{$component}:~" *
484484
raw"$" * "$(round(results["F$component"], digits=2)) N"
485485
)
486-
axs[3, idx].legend()
486+
axs[2, idx-1].legend()
487487
end
488488
end
489489

0 commit comments

Comments
 (0)