xomics.plot_settings
- xomics.plot_settings(font_scale=1, font='Arial', weight_bold=True, adjust_only_font=False, adjust_further_elements=True, grid=False, grid_axis='y', no_ticks=False, short_ticks=False, no_ticks_x=False, short_ticks_x=False, no_ticks_y=False, short_ticks_y=False, show_options=False)[source]
Configures general plot settings.
This function modifies the global settings of
matplotlibandseabornlibraries. It adjusts font embedding for vector formats like PDF and SVG, ensuring compatibility and editability across various viewers and editing software.- Parameters:
font_scale (
float) – Scaling factor to scale the size of font elements. Consistent withseaborn.set_context().font (
str) – Name of text font. Common options are ‘Arial’, ‘Verdana’, ‘Helvetica’, or ‘DejaVu Sans’ (Matplotlib default).weight_bold (
bool) – IfTrue, font and line elements are bold.adjust_only_font (
bool) – IfTrue, only the font style will be adjusted, leaving other elements unchanged.adjust_further_elements (
bool) – IfTrue, makes additional visual and layout adjustments to the plot (errorbars, legend).grid (
bool) – IfTrue, display the grid in plots.grid_axis (
str) – Choose the axis (‘y’, ‘x’, ‘both’) to apply the grid to.no_ticks (
bool) – IfTrue, remove all tick marks on both x and y axes.short_ticks (
bool) – IfTrue, display short tick marks on both x and y axes. Is ignored ifno_ticks=True.no_ticks_x (
bool) – IfTrue, remove tick marks on the x-axis.short_ticks_x (
bool) – IfTrue, display short tick marks on the x-axis. Is ignored ifno_ticks=True.no_ticks_y (
bool) – IfTrue, remove tick marks on the y-axis.short_ticks_y (
bool) – IfTrue, display short tick marks on the y-axis. Is ignored ifno_ticks=True.show_options (
bool) – IfTrue, show all plot runtime configurations of matplotlib.
Examples
Create default seaborn plot:
>>> import matplotlib.pyplot as plt >>> import seaborn as sns >>> import xomics as xo >>> data = {'Classes': ['Class A', 'Class B', 'Class C'], 'Values': [23, 27, 43]} >>> sns.barplot(x='Classes', y='Values', data=data) >>> sns.despine() >>> plt.title("Seaborn default") >>> plt.tight_layout() >>> plt.show()
(
Source code,png,hires.png,pdf)
Adjust polts with xOmics:
>>> import matplotlib.pyplot as plt >>> import seaborn as sns >>> import xomics as xo >>> data = {'Classes': ['Class A', 'Class B', 'Class C'], 'Values': [23, 27, 43]} >>> colors = xo.plot_get_clist() >>> xo.plot_settings() >>> sns.barplot(data=data, x='Classes', y='Values', palette=colors, hue="Classes", legend=False) >>> sns.despine() >>> plt.title("Adjusted") >>> plt.tight_layout() >>> plt.show()
(
Source code,png,hires.png,pdf)
See also
More examples in Plotting Prelude.
seaborn.set_context(), wherefont_scaleis utilized.matplotlib.rcParams, which manages the global settings inmatplotlib.