Skip to content

Commit 4dc4e6b

Browse files
authored
Merge pull request #184 from cphyc/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 273a9fd + fe1a12c commit 4dc4e6b

File tree

2 files changed

+16
-17
lines changed

2 files changed

+16
-17
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ repos:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
1111
- repo: https://github.com/pre-commit/mirrors-mypy
12-
rev: v1.10.1
12+
rev: v1.11.2
1313
hooks:
1414
- id: mypy
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
16-
rev: v0.5.0
16+
rev: v0.6.2
1717
hooks:
1818
- id: ruff
1919
args: ["--fix", "--show-fixes"]

example/matplotlib_label_lines.ipynb

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"source": [
6464
"import numpy as np\n",
6565
"from matplotlib import pyplot as plt\n",
66-
"from scipy.stats import loglaplace,chi2\n",
66+
"from scipy.stats import loglaplace, chi2\n",
6767
"\n",
6868
"from labellines import labelLine, labelLines"
6969
]
@@ -125,7 +125,7 @@
125125
],
126126
"source": [
127127
"for a in A:\n",
128-
" plt.plot(X, np.arctan(a*X), label=str(a))\n",
128+
" plt.plot(X, np.arctan(a * X), label=str(a))\n",
129129
"\n",
130130
"labelLines(plt.gca().get_lines(), zorder=2.5)"
131131
]
@@ -171,7 +171,7 @@
171171
],
172172
"source": [
173173
"for a in A:\n",
174-
" plt.plot(X, np.sin(a*X), label=str(a))\n",
174+
" plt.plot(X, np.sin(a * X), label=str(a))\n",
175175
"\n",
176176
"labelLines(plt.gca().get_lines(), align=False, fontsize=14)"
177177
]
@@ -217,10 +217,10 @@
217217
],
218218
"source": [
219219
"for a in A:\n",
220-
" plt.plot(X, loglaplace(4).pdf(a*X), label=str(a))\n",
220+
" plt.plot(X, loglaplace(4).pdf(a * X), label=str(a))\n",
221221
"\n",
222222
"xvals = [0.8, 0.55, 0.22, 0.104, 0.045]\n",
223-
"labelLines(plt.gca().get_lines(), align=False, xvals=xvals, color='k')"
223+
"labelLines(plt.gca().get_lines(), align=False, xvals=xvals, color=\"k\")"
224224
]
225225
},
226226
{
@@ -263,12 +263,11 @@
263263
],
264264
"source": [
265265
"for a in A:\n",
266-
" plt.plot(X, chi2(5).pdf(a*X), label=str(a))\n",
266+
" plt.plot(X, chi2(5).pdf(a * X), label=str(a))\n",
267267
"\n",
268268
"lines = plt.gca().get_lines()\n",
269-
"l1=lines[-1]\n",
270-
"labelLine(l1, 0.6, label=r'$Re=${}'.format(l1.get_label()), ha='left',\n",
271-
" va='bottom', align=False)\n",
269+
"l1 = lines[-1]\n",
270+
"labelLine(l1, 0.6, label=rf\"$Re=${l1.get_label()}\", ha=\"left\", va=\"bottom\", align=False)\n",
272271
"labelLines(lines[:-1], align=False)"
273272
]
274273
},
@@ -313,7 +312,7 @@
313312
],
314313
"source": [
315314
"for a in A:\n",
316-
" plt.semilogx(X, np.arctan(5*a*X), label=str(a))\n",
315+
" plt.semilogx(X, np.arctan(5 * a * X), label=str(a))\n",
317316
"\n",
318317
"labelLines(plt.gca().get_lines(), zorder=2.5)"
319318
]
@@ -359,7 +358,7 @@
359358
],
360359
"source": [
361360
"for a in A:\n",
362-
" plt.semilogx(X, chi2(5).pdf(a*X), label=str(a))\n",
361+
" plt.semilogx(X, chi2(5).pdf(a * X), label=str(a))\n",
363362
"\n",
364363
"labelLines(plt.gca().get_lines(), xvals=(0.1, 1), zorder=2.5)"
365364
]
@@ -396,19 +395,19 @@
396395
"for j, ax in enumerate(axes):\n",
397396
" fig.sca(ax)\n",
398397
" for i in range(1, 5):\n",
399-
" plt.plot(X, X**(-2)/i, label='$x^2/%s$' % i)\n",
398+
" plt.plot(X, X ** (-2) / i, label=f\"$x^2/{i}$\")\n",
400399
" plt.ylim(0, 10)\n",
401400
"\n",
402401
" lines = []\n",
403402
" for i in range(-8, 12, 2):\n",
404-
" lines.extend(plt.plot(X, 10*X + i, '--', color='gray', label='i=%s' % i))\n",
403+
" lines.extend(plt.plot(X, 10 * X + i, \"--\", color=\"gray\", label=f\"i={i}\"))\n",
405404
"\n",
406405
" if j == 0:\n",
407406
" labelLines(lines, zorder=2.5)\n",
408-
" plt.title('$\\mathtt{drop\\_label=False}$')\n",
407+
" plt.title(\"$\\mathtt{drop\\_label=False}$\")\n",
409408
" else:\n",
410409
" labelLines(lines, zorder=2.5, drop_label=True)\n",
411-
" plt.title('$\\mathtt{drop\\_label=True}$')\n",
410+
" plt.title(\"$\\mathtt{drop\\_label=True}$\")\n",
412411
" plt.legend()"
413412
]
414413
},

0 commit comments

Comments
 (0)