From d6454d462890bcd257f45f632ac996d93770b7df Mon Sep 17 00:00:00 2001 From: Qian Zhang Date: Tue, 18 Mar 2025 10:34:03 +0000 Subject: [PATCH 1/3] add description to logit_demo.py script --- galleries/examples/scales/logit_demo.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/galleries/examples/scales/logit_demo.py b/galleries/examples/scales/logit_demo.py index 22a56433ccd7..9ed7ae3935f7 100644 --- a/galleries/examples/scales/logit_demo.py +++ b/galleries/examples/scales/logit_demo.py @@ -4,6 +4,20 @@ =========== Examples of plots with logit axes. + +This example visualises how `set_yscale("logit")` works on probability plots +by generating three distributions: normal, laplacian, and cauchy in one plot. + +The advantage of logit scale is that it effectively spreads out values close to 0 and 1. + +In a normal scale plot, probability values near 0 and 1 appear compressed, +making it difficult to see differences in those regions. + +In a logit scale plot, the transformation expands these regions, +making the graph cleaner and easier to compare across different probability values. + +This makes the logit scale especially useful when visalising probabilities in logistic +regression, classification models, and cumulative distribution functions. """ import math From 35bcf3c49731b43cffc02a77ca654edb15921151 Mon Sep 17 00:00:00 2001 From: Qian Zhang Date: Tue, 18 Mar 2025 13:21:40 +0000 Subject: [PATCH 2/3] change function doc style to string doc style --- galleries/examples/scales/logit_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galleries/examples/scales/logit_demo.py b/galleries/examples/scales/logit_demo.py index 9ed7ae3935f7..c8e2f973e656 100644 --- a/galleries/examples/scales/logit_demo.py +++ b/galleries/examples/scales/logit_demo.py @@ -5,7 +5,7 @@ Examples of plots with logit axes. -This example visualises how `set_yscale("logit")` works on probability plots +This example visualises how ``set_yscale("logit")`` works on probability plots by generating three distributions: normal, laplacian, and cauchy in one plot. The advantage of logit scale is that it effectively spreads out values close to 0 and 1. From 30bf06c43939de9c4881039ebaa0e1b946dddf95 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Tue, 18 Mar 2025 14:44:08 +0100 Subject: [PATCH 3/3] Update galleries/examples/scales/logit_demo.py --- galleries/examples/scales/logit_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galleries/examples/scales/logit_demo.py b/galleries/examples/scales/logit_demo.py index c8e2f973e656..e8d42fc35711 100644 --- a/galleries/examples/scales/logit_demo.py +++ b/galleries/examples/scales/logit_demo.py @@ -10,7 +10,7 @@ The advantage of logit scale is that it effectively spreads out values close to 0 and 1. -In a normal scale plot, probability values near 0 and 1 appear compressed, +In a linear scale plot, probability values near 0 and 1 appear compressed, making it difficult to see differences in those regions. In a logit scale plot, the transformation expands these regions,