@@ -226,38 +226,52 @@ function plot_geometry(wing_aero, title;
226226 end
227227end
228228
229- # """
230- # plot_distribution(y_coordinates_list, results_list, label_list; kwargs...)
229+ """
230+ plot_distribution(y_coordinates_list, results_list, label_list; kwargs...)
231231
232- # Plot spanwise distributions of aerodynamic properties.
232+ Plot spanwise distributions of aerodynamic properties.
233233
234- # # Arguments
235- # - `y_coordinates_list`: List of spanwise coordinates
236- # - `results_list`: List of result dictionaries
237- # - `label_list`: List of labels for different results
238- # - `title`: Plot title (default: "spanwise_distribution")
239- # - `data_type`: File extension for saving (default: ".pdf")
240- # - `save_path`: Path to save plots
241- # - `is_save`: Whether to save plots (default: true)
242- # - `is_show`: Whether to display plots (default: true)
243- # """
244- # function plot_distribution(y_coordinates_list, results_list, label_list;
245- # title="spanwise_distribution",
246- # data_type=".pdf",
247- # save_path=nothing,
248- # is_save=true,
249- # is_show=true)
234+ # Arguments
235+ - `y_coordinates_list`: List of spanwise coordinates
236+ - `results_list`: List of result dictionaries
237+ - `label_list`: List of labels for different results
238+ - `title`: Plot title (default: "spanwise_distribution")
239+ - `data_type`: File extension for saving (default: ".pdf")
240+ - `save_path`: Path to save plots
241+ - `is_save`: Whether to save plots (default: true)
242+ - `is_show`: Whether to display plots (default: true)
243+ """
244+ function plot_distribution (y_coordinates_list, results_list, label_list;
245+ title= " spanwise_distribution" ,
246+ data_type= " .pdf" ,
247+ save_path= nothing ,
248+ is_save= true ,
249+ is_show= true )
250250
251- # length(results_list) == length(label_list) || throw(ArgumentError(
252- # "Number of results ($(length(results_list))) must match number of labels ($(length(label_list)))"
253- # ))
251+ length (results_list) == length (label_list) || throw (ArgumentError (
252+ " Number of results ($(length (results_list)) ) must match number of labels ($(length (label_list)) )"
253+ ))
254254
255- # # Create plot with layout
256- # res = plot(
257- # layout=(3,3),
258- # size=(1200, 800),
259- # plot_title=title
260- # )
255+ # Set the plot style
256+ set_plot_style ()
257+
258+ # Initializing plot
259+ fig, axs = plt. subplots (3 , 3 , figsize= (16 , 10 ))
260+ fig. suptitle (title, fontsize= 16 )
261+
262+ # CL plot
263+ for (y_coordinates_i, result_i, label_i) in zip (y_coordinates_list, results_list, label_list)
264+ value = " $(round (result_i[" cl" ], digits= 2 )) "
265+ axs[1 , 1 ]. plot (
266+ y_coordinates_i,
267+ result_i[" cl_distribution" ],
268+ label= label_i * L " $C_L$: " * value
269+ )
270+ end
271+ axs[1 , 1 ]. set_title (L " $C_L$ Distribution" )
272+ axs[1 , 1 ]. set_xlabel (L " Spanwise Position $y/b$" )
273+ axs[1 , 1 ]. set_ylabel (L " Lift Coefficient $C_L$" )
274+ axs[1 , 1 ]. legend ()
261275
262276# # CL Distribution
263277# plot!(res[1],
343357# end
344358
345359# return res
346- # end
360+ end
347361
348362# """
349363# generate_polar_data(solver, wing_aero, angle_range; kwargs...)
0 commit comments