DLR-AE / CampbellViewer

Unified plotting tool for Campbell diagrams, processing results of wind turbine simulation tools HAWCStab2 and Bladed
Apache License 2.0
2 stars 1 forks source link

Fix the matplotlib legend #7

Closed hendrikverdonck closed 1 year ago

hendrikverdonck commented 2 years ago

If we do not use tight_layout, the legend is cut partially from the canvas. If we use tight_layout the axes are squeezed together if a lot of datasets are visualized.

Following error appears if we use the same code which is used in STARS (another DLR tool):

Image Pasted at 2022-8-17 09-03

hach-ol-dlr commented 2 years ago

Helpfull resources:

Based on the included propositions I fixed the problem of vertically shrinking axes by using a figure legend and adjusting the axes box accordingly.

I am not sure, if we want to have the same mechanism in the participation factor window. Is it likely that we want to display the PFs for many modes at the same time?

hach-ol-dlr commented 1 year ago

In conjuction with a loaded database, the main canvas may initially look very odd. Needs to be investigated.

grafik

hendrikverdonck commented 1 year ago

Legend positioning works for the Campbell Diagram. Axes are scaled according to size of legend. Legend font is reduced if legend has too many entries. Legend is disabled if legend becomes too large, even if the font is reduced.

Participation diagram legend is only scaled, because we do not expect many lines to be plotted.