Skip to content

Commit

Permalink
Set grid behind in plot_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
breimanntools committed Sep 26, 2023
1 parent 396136a commit 122ec40
Show file tree
Hide file tree
Showing 37 changed files with 52 additions and 46 deletions.
Binary file modified aaanalysis/plotting/__pycache__/plot_settings_.cpython-39.pyc
Binary file not shown.
20 changes: 13 additions & 7 deletions aaanalysis/plotting/plot_settings_.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,38 @@ def plot_settings(font_scale: float = 1,
if show_options:
print(plt.rcParams.keys)

# Set embedded fonts in PDF
# Set all values to matplotlib default
mpl.rcParams.update(mpl.rcParamsDefault)
mpl.rcParams["pdf.fonttype"] = 42

# Change only font style
if adjust_only_font:
mpl.rcParams['pdf.fonttype'] = 42 # Set embedded fonts in PDF via TrueType
mpl.rcParams['ps.fonttype'] = 42
mpl.rcParams['svg.fonttype'] = 'none'
plt.rcParams["font.family"] = "sans-serif"
plt.rcParams["font.sans-serif"] = font
return

# Apply all changes
sns.set_context("talk", font_scale=font_scale)

# Handle storing of vectorized figure format
mpl.rcParams['pdf.fonttype'] = 42 # Set embedded fonts in PDF via TrueType
mpl.rcParams['ps.fonttype'] = 42
mpl.rcParams['svg.fonttype'] = 'none'

# Font settings
plt.rcParams["font.family"] = "sans-serif"
plt.rcParams["font.sans-serif"] = font
font_settings = {'family': 'sans-serif', "weight": "bold"} if weight_bold else {'family': 'sans-serif'}
mpl.rc('font', **font_settings)

# Grid
plt.rcParams["axes.grid.axis"] = grid_axis
plt.rcParams["axes.grid"] = grid
plt.rcParams["grid.linewidth"] = 1 if weight_bold else 0.8
plt.rcParams["axes.axisbelow"] = True

# Adjust weight of text and lines
if weight_bold:
plt.rcParams["axes.labelweight"] = "bold"
Expand Down Expand Up @@ -210,11 +221,6 @@ def plot_settings(font_scale: float = 1,
else:
set_tick_size(axis="y", major_size=default_major_size, minor_size=default_minor_size)

# Handle storing of vectorized figure format
mpl.rcParams['pdf.fonttype'] = 42 # TrueType
mpl.rcParams['ps.fonttype'] = 42
mpl.rcParams['svg.fonttype'] = 'none'

# Additional adjustments
if adjust_further_elements:
# Error bars
Expand Down
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/generated/aaanalysis.plot_settings.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/generated/plotting_prelude.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/build/html/_images/output_3_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/build/html/_images/output_7_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Plotting prelude
Plotting Prelude
================

These are some of our utility plotting functions to make
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/generated/aaanalysis.plot_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<h1>aaanalysis.plot_settings<a class="headerlink" href="#aaanalysis-plot-settings" title="Permalink to this heading"></a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="aaanalysis.plot_settings">
<span class="sig-prename descclassname"><span class="pre">aaanalysis.</span></span><span class="sig-name descname"><span class="pre">plot_settings</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">font_scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">font</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'Arial'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight_bold</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">adjust_only_font</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">adjust_further_elements</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">grid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">grid_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'y'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks_x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks_x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks_y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks_y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/plotting/plot_settings_.py#L42-L225"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.plot_settings" title="Permalink to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">aaanalysis.</span></span><span class="sig-name descname"><span class="pre">plot_settings</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">font_scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">font</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'Arial'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">weight_bold</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">adjust_only_font</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">adjust_further_elements</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">grid</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">grid_axis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'y'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks_x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks_x</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">no_ticks_y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">short_ticks_y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">show_options</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/breimanntools/aaanalysis/tree/master/aaanalysis/plotting/plot_settings_.py#L42-L231"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#aaanalysis.plot_settings" title="Permalink to this definition"></a></dt>
<dd><p>Configures general settings for plot visualization.</p>
<p>This function modifies the global settings of <a class="reference external" href="https://matplotlib.org/stable/index.html#module-matplotlib" title="(in Matplotlib v3.8.0)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib</span></code></a> and <code class="xref py py-mod docutils literal notranslate"><span class="pre">seaborn</span></code> libraries.
It adjusts font embedding for vector formats like PDF and SVG, ensuring compatibility and
Expand Down
12 changes: 6 additions & 6 deletions docs/build/html/generated/plotting_prelude.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18: http://docutils.sourceforge.net/" />
<meta property="og:title" content="Plotting prelude" />
<meta property="og:title" content="Plotting Prelude" />
<meta property="og:type" content="website" />
<meta property="og:url" content="generated/plotting_prelude.html" />
<meta property="og:site_name" content="AAanalysis" />
<meta property="og:description" content="These are some of our utility plotting functions to make publication-ready visualizations with a view extra lines of code. Let us first make all imports and create some data The default seaborn out..." />
<meta property="og:image:width" content="1146" />
<meta property="og:image:height" content="600" />
<meta property="og:image" content="/_images/social_previews/summary_generated_plotting_prelude_53cbcc27.png" />
<meta property="og:image" content="/_images/social_previews/summary_generated_plotting_prelude_11ec0463.png" />
<meta property="og:image:alt" content="These are some of our utility plotting functions to make publication-ready visualizations with a view extra lines of code. Let us first make all imports and..." />
<meta name="description" content="These are some of our utility plotting functions to make publication-ready visualizations with a view extra lines of code. Let us first make all imports and create some data The default seaborn out..." />
<meta name="twitter:card" content="summary_large_image" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Plotting prelude &mdash; AAanalysis</title>
<title>Plotting Prelude &mdash; AAanalysis</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/copybutton.css" type="text/css" />
Expand Down Expand Up @@ -79,7 +79,7 @@
<li class="toctree-l1 current"><a class="reference internal" href="../tutorials.html">Tutorials</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../tutorials.html#quick-start">Quick start</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="tutorial1_quick_start.html">Quick Start with AAanalysis</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Plotting prelude</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">Plotting Prelude</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials.html#further-tutorials">Further Tutorials</a></li>
Expand Down Expand Up @@ -110,7 +110,7 @@
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item"><a href="../tutorials.html">Tutorials</a></li>
<li class="breadcrumb-item active">Plotting prelude</li>
<li class="breadcrumb-item active">Plotting Prelude</li>
<li class="wy-breadcrumbs-aside">
<a href="https://github.com/breimanntools/aaanalysis/blob/master/generated/plotting_prelude.rst" class="fa fa-github"> Edit on GitHub</a>
</li>
Expand All @@ -121,7 +121,7 @@
<div itemprop="articleBody">

<section id="plotting-prelude">
<h1>Plotting prelude<a class="headerlink" href="#plotting-prelude" title="Permalink to this heading"></a></h1>
<h1>Plotting Prelude<a class="headerlink" href="#plotting-prelude" title="Permalink to this heading"></a></h1>
<p>These are some of our utility plotting functions to make
publication-ready visualizations with a view extra lines of code.</p>
<p>Let us first make all imports and create some data</p>
Expand Down
6 changes: 3 additions & 3 deletions docs/build/html/generated/tutorial1_quick_start.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Plotting prelude" href="plotting_prelude.html" />
<link rel="next" title="Plotting Prelude" href="plotting_prelude.html" />
<link rel="prev" title="Tutorials" href="../tutorials.html" />
</head>

Expand Down Expand Up @@ -79,7 +79,7 @@
<li class="toctree-l1 current"><a class="reference internal" href="../tutorials.html">Tutorials</a><ul class="current">
<li class="toctree-l2 current"><a class="reference internal" href="../tutorials.html#quick-start">Quick start</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">Quick Start with AAanalysis</a></li>
<li class="toctree-l3"><a class="reference internal" href="plotting_prelude.html">Plotting prelude</a></li>
<li class="toctree-l3"><a class="reference internal" href="plotting_prelude.html">Plotting Prelude</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../tutorials.html#further-tutorials">Further Tutorials</a></li>
Expand Down Expand Up @@ -774,7 +774,7 @@ <h3>Explainable AI on individual level<a class="headerlink" href="#explainable-a
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="../tutorials.html" class="btn btn-neutral float-left" title="Tutorials" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="plotting_prelude.html" class="btn btn-neutral float-right" title="Plotting prelude" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="plotting_prelude.html" class="btn btn-neutral float-right" title="Plotting Prelude" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>
Expand Down
4 changes: 2 additions & 2 deletions docs/build/html/generated/tutorial2a_data_loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Scale Loading Tutorial" href="tutorial2b_scales_loader.html" />
<link rel="prev" title="Plotting prelude" href="plotting_prelude.html" />
<link rel="prev" title="Plotting Prelude" href="plotting_prelude.html" />
</head>

<body class="wy-body-for-nav">
Expand Down Expand Up @@ -907,7 +907,7 @@ <h2>Loading of protein benchmarks: Positive-Unlabeled (PU) datasets<a class="hea
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="plotting_prelude.html" class="btn btn-neutral float-left" title="Plotting prelude" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="plotting_prelude.html" class="btn btn-neutral float-left" title="Plotting Prelude" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="tutorial2b_scales_loader.html" class="btn btn-neutral float-right" title="Scale Loading Tutorial" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/build/html/tutorials.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="tutorials.html" />
<meta property="og:site_name" content="AAanalysis" />
<meta property="og:description" content="Quick start: Quick Start with AAanalysis, Plotting prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta property="og:description" content="Quick start: Quick Start with AAanalysis, Plotting Prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta property="og:image:width" content="1146" />
<meta property="og:image:height" content="600" />
<meta property="og:image" content="/_images/social_previews/summary_tutorials_2c8534e9.png" />
<meta property="og:image:alt" content="Quick start: Quick Start with AAanalysis, Plotting prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta name="description" content="Quick start: Quick Start with AAanalysis, Plotting prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta property="og:image" content="/_images/social_previews/summary_tutorials_156b1d6c.png" />
<meta property="og:image:alt" content="Quick start: Quick Start with AAanalysis, Plotting Prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta name="description" content="Quick start: Quick Start with AAanalysis, Plotting Prelude. Further Tutorials: Data Loading Tutorial, Scale Loading Tutorial." />
<meta name="twitter:card" content="summary_large_image" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Expand Down Expand Up @@ -79,7 +79,7 @@
<li class="toctree-l1 current"><a class="current reference internal" href="#">Tutorials</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#quick-start">Quick start</a><ul>
<li class="toctree-l3"><a class="reference internal" href="generated/tutorial1_quick_start.html">Quick Start with AAanalysis</a></li>
<li class="toctree-l3"><a class="reference internal" href="generated/plotting_prelude.html">Plotting prelude</a></li>
<li class="toctree-l3"><a class="reference internal" href="generated/plotting_prelude.html">Plotting Prelude</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#further-tutorials">Further Tutorials</a><ul>
Expand Down Expand Up @@ -130,7 +130,7 @@ <h2>Quick start<a class="headerlink" href="#quick-start" title="Permalink to thi
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="generated/tutorial1_quick_start.html">Quick Start with AAanalysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/plotting_prelude.html">Plotting prelude</a></li>
<li class="toctree-l1"><a class="reference internal" href="generated/plotting_prelude.html">Plotting Prelude</a></li>
</ul>
</div>
</section>
Expand Down
Binary file modified docs/build/plot_directive/generated/aaanalysis-plot_gcfs-1.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/source/generated/output_3_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/generated/output_7_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/generated/plotting_prelude.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Plotting prelude
Plotting Prelude
================

These are some of our utility plotting functions to make
Expand Down
Loading

0 comments on commit 122ec40

Please sign in to comment.