From 5b236d6a977c40d5b16ebc2efc324e65039615b1 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 19 Dec 2024 17:02:52 -0500 Subject: [PATCH] Backport PR #29348: DOC: Cleanup scales examples --- galleries/examples/scales/asinh_demo.py | 6 ++--- galleries/examples/scales/log_bar.py | 29 ------------------------- galleries/examples/scales/logit_demo.py | 6 ++--- galleries/examples/scales/scales.py | 6 ++--- 4 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 galleries/examples/scales/log_bar.py diff --git a/galleries/examples/scales/asinh_demo.py b/galleries/examples/scales/asinh_demo.py index a464d4546ea8..bc8b010c47ce 100644 --- a/galleries/examples/scales/asinh_demo.py +++ b/galleries/examples/scales/asinh_demo.py @@ -1,7 +1,7 @@ """ -============ -Asinh Demo -============ +=========== +Asinh scale +=========== Illustration of the `asinh <.scale.AsinhScale>` axis scaling, which uses the transformation diff --git a/galleries/examples/scales/log_bar.py b/galleries/examples/scales/log_bar.py deleted file mode 100644 index 239069806c5c..000000000000 --- a/galleries/examples/scales/log_bar.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -======= -Log Bar -======= - -Plotting a bar chart with a logarithmic y-axis. -""" -import matplotlib.pyplot as plt -import numpy as np - -data = ((3, 1000), (10, 3), (100, 30), (500, 800), (50, 1)) - -dim = len(data[0]) -w = 0.75 -dimw = w / dim - -fig, ax = plt.subplots() -x = np.arange(len(data)) -for i in range(len(data[0])): - y = [d[i] for d in data] - b = ax.bar(x + i * dimw, y, dimw, bottom=0.001) - -ax.set_xticks(x + dimw / 2, labels=map(str, x)) -ax.set_yscale('log') - -ax.set_xlabel('x') -ax.set_ylabel('y') - -plt.show() diff --git a/galleries/examples/scales/logit_demo.py b/galleries/examples/scales/logit_demo.py index a21abf5b64fb..22a56433ccd7 100644 --- a/galleries/examples/scales/logit_demo.py +++ b/galleries/examples/scales/logit_demo.py @@ -1,7 +1,7 @@ """ -================ -Logit Demo -================ +=========== +Logit scale +=========== Examples of plots with logit axes. """ diff --git a/galleries/examples/scales/scales.py b/galleries/examples/scales/scales.py index 8df4d2fdd4a9..e932609bb7f9 100644 --- a/galleries/examples/scales/scales.py +++ b/galleries/examples/scales/scales.py @@ -1,7 +1,7 @@ """ -====== -Scales -====== +=============== +Scales overview +=============== Illustrate the scale transformations applied to axes, e.g. log, symlog, logit.