get_legend_columns | R Documentation |
Gets appropriate number of legend columns based on the plot, font and active graphics device
get_legend_columns( legend_text, y_axis_text, legend_key_width = plot_width/100, legend_key_spacing = plot_width/100, plot_width = 6.8, base_size = 11, base_family = get_font_df()[["family"]], systemfonts_suffix = "_systemfonts" )
legend_text |
Vector with the legend text |
y_axis_text |
Vector with the text labels of the y axis |
legend_key_width |
Legend key width |
legend_key_spacing |
Legend key spacing |
plot_width |
Width of the plot in inches, defaults to 6.8 |
base_size |
base font size, defaults to 11 |
base_family |
base font family, defaults to RubFlama |
systemfonts_suffix |
Suffix attached to the font family name in |
Numeric with the number of columns for the legend
get_legend_columns( legend_text = c( "1 - eigener Verdienst", "2 - Mittel der Eltern/Verwandten", "3 - Förderung nach BAföG", "4 - Stipendium", "5 - Sonstiges" ), y_axis_text = c( "Bachelor 2-Fächer (n=251)", "FG Bachelor 2-Fächer (n=1.310)" ) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.