Skip to content

Commit a9377cd

Browse files
takimataQuLogic
andcommitted
Use descriptive names
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent 18c06c3 commit a9377cd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/backends/backend_pgf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -611,16 +611,16 @@ def _print_pgf_path(self, gc, path, transform, rgbFace=None):
611611
# -> Use "randomness" as PRNG seed to allow the user to force the
612612
# same shape on multiple sketched lines
613613
scale, length, randomness = sketch_params
614-
# make PGF output visually similar to matplotlib's sketched lines
615-
adjustment_a = 0.5
616-
adjustment_b = 2
617614
if scale is not None:
615+
# make PGF output visually similar to matplotlib's sketched lines
616+
length *= 0.5
617+
scale *= 2
618618
# PGF guarantees that repeated loading is a no-op
619619
writeln(self.fh, r"\usepgfmodule{decorations}")
620620
writeln(self.fh, r"\usepgflibrary{decorations.pathmorphing}")
621621
writeln(self.fh, r"\pgfkeys{/pgf/decoration/.cd, "
622-
f"segment length = {(length * f * adjustment_a):f}in, "
623-
f"amplitude = {(scale * f * adjustment_b):f}in}}")
622+
f"segment length = {(length * f):f}in, "
623+
f"amplitude = {(scale * f):f}in}}")
624624
writeln(self.fh, f"\\pgfmathsetseed{{{int(randomness)}}}")
625625
writeln(self.fh, r"\pgfdecoratecurrentpath{random steps}")
626626

0 commit comments

Comments
 (0)