Skip to content

Commit e5a60b2

Browse files
committed
add legend
1 parent d18efc8 commit e5a60b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/plotting.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Create a 3D plot of wing geometry including panels and filaments.
108108
"""
109109
function create_geometry_plot(wing_aero, title, view_elevation, view_azimuth)
110110
set_plot_style()
111-
111+
112112
panels = wing_aero.panels
113113
va = isa(wing_aero.va, Tuple) ? wing_aero.va[1] : wing_aero.va
114114

@@ -168,6 +168,11 @@ function create_geometry_plot(wing_aero, title, view_elevation, view_azimuth)
168168
va_vector_end = va_vector_begin + 1.5 * va / va_mag
169169
plot_line_segment!(ax, [va_vector_begin, va_vector_end], :lightblue, "va")
170170

171+
# Add legends for the first occurrence of each label
172+
handles, labels = ax.get_legend_handles_labels()
173+
by_label = Dict(zip(labels, handles))
174+
ax.legend(values(by_label), keys(by_label))
175+
171176
# Set labels and make axes equal
172177
ax.set_xlabel("x")
173178
ax.set_ylabel("y")

0 commit comments

Comments
 (0)