Description:
This PR introduces the adjust_title_height function to dynamically position the title in feature importance plots based on the specified figure height. This adjustment helps prevent title overlap with the plot content when custom figure heights are used.
Changes Made:
New adjust_title_height Function:
The adjust_title_height function calculates the title height position relative to the figure height, ensuring that titles remain positioned above the plot even with custom figure dimensions.
Title Position Adjustment:
By scaling the title height position inversely with figure height, this function ensures that the title’s relative position is dynamically adjusted, reducing overlap with the plot and improving readability.
How It Works:
The function calculates the title’s height relative to a default figure height of 500 pixels using the formula:
1 - 0.1 * 500 / figure_height
The resulting value positions the title proportionally higher for smaller figures and closer to the plot for larger figures, ensuring adaptability for various figure sizes.
Steps to Test:
Create a feature importance plot and set different figure heights.
Observe that the title adjusts its position based on the figure height, reducing overlap with the plot content.
Fixes: #606
Description:
This PR introduces the
adjust_title_height
function to dynamically position the title in feature importance plots based on the specified figure height. This adjustment helps prevent title overlap with the plot content when custom figure heights are used.Changes Made:
New
adjust_title_height
Function:The
adjust_title_height
function calculates the title height position relative to the figure height, ensuring that titles remain positioned above the plot even with custom figure dimensions.Title Position Adjustment:
By scaling the title height position inversely with figure height, this function ensures that the title’s relative position is dynamically adjusted, reducing overlap with the plot and improving readability.
How It Works:
The function calculates the title’s height relative to a default figure height of 500 pixels using the formula:
The resulting value positions the title proportionally higher for smaller figures and closer to the plot for larger figures, ensuring adaptability for various figure sizes.
Steps to Test: