From bc3b5629d3a95b8f4eb4e7732eb763d8e2d86e4b Mon Sep 17 00:00:00 2001 From: Kanza Date: Thu, 25 Aug 2022 00:09:15 +0500 Subject: [PATCH 1/3] update: grid in line plots for all style sheets --- examples/style_sheets/style_sheets_reference.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/style_sheets/style_sheets_reference.py b/examples/style_sheets/style_sheets_reference.py index 657c73aadb10..d18dd0884324 100644 --- a/examples/style_sheets/style_sheets_reference.py +++ b/examples/style_sheets/style_sheets_reference.py @@ -39,6 +39,7 @@ def sigmoid(t, t0): amplitudes = np.linspace(1, 1.5, nb_colors) for t0, a in zip(shifts, amplitudes): ax.plot(t, a * sigmoid(t, t0), '-') + ax.grid(linewidth=1) ax.set_xlim(-10, 10) return ax From 334219ab470ed03b823de027fc4073800fb2b27a Mon Sep 17 00:00:00 2001 From: Kanza Date: Thu, 25 Aug 2022 00:27:01 +0500 Subject: [PATCH 2/3] update: set visible to True --- examples/style_sheets/style_sheets_reference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/style_sheets/style_sheets_reference.py b/examples/style_sheets/style_sheets_reference.py index d18dd0884324..87c0ec31031f 100644 --- a/examples/style_sheets/style_sheets_reference.py +++ b/examples/style_sheets/style_sheets_reference.py @@ -39,7 +39,7 @@ def sigmoid(t, t0): amplitudes = np.linspace(1, 1.5, nb_colors) for t0, a in zip(shifts, amplitudes): ax.plot(t, a * sigmoid(t, t0), '-') - ax.grid(linewidth=1) + ax.grid(visible=True) ax.set_xlim(-10, 10) return ax From c36a1b1e0e277c5dbba39687dda91d2db60e1ff7 Mon Sep 17 00:00:00 2001 From: Kanza Date: Sat, 27 Aug 2022 20:29:18 +0500 Subject: [PATCH 3/3] updated: annotation for gridlines --- examples/style_sheets/style_sheets_reference.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/style_sheets/style_sheets_reference.py b/examples/style_sheets/style_sheets_reference.py index 87c0ec31031f..78ed588c398c 100644 --- a/examples/style_sheets/style_sheets_reference.py +++ b/examples/style_sheets/style_sheets_reference.py @@ -40,6 +40,12 @@ def sigmoid(t, t0): for t0, a in zip(shifts, amplitudes): ax.plot(t, a * sigmoid(t, t0), '-') ax.grid(visible=True) + # Add annotation for enabling grid + ax.annotate('ax.grid(True)', xy=(-5.0, 0.5), + xytext=(1.4, 1.4), + va="top", ha="right", + bbox=dict(boxstyle="round", alpha=0.2), + ) ax.set_xlim(-10, 10) return ax