Skip to content

Commit 59c9f36

Browse files
authored
Merge pull request matplotlib#7473 from tacaswell/doc_fix_mandelbort_demo
DOC: fix py2 compatibility issue
2 parents 39c7d1e + 6a38195 commit 59c9f36

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/showcase/mandelbrot.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
4747
# This line will generate warnings for null values but it is faster to
4848
# process them afterwards using the nan_to_num
4949
with np.errstate(invalid='ignore'):
50-
M = np.nan_to_num(N + 1 - np.log(np.log(abs(Z)))/np.log(2) + log_horizon)
50+
M = np.nan_to_num(N + 1 -
51+
np.log(np.log(abs(Z)))/np.log(2) +
52+
log_horizon)
5153

5254
dpi = 72
5355
width = 10
@@ -65,9 +67,9 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):
6567

6668
# Some advertisement for matplotlib
6769
year = time.strftime("%Y")
68-
major, minor, micro = matplotlib.__version__.split('.', maxsplit=2)
70+
major, minor, micro = matplotlib.__version__.split('.', 2)
6971
text = ("The Mandelbrot fractal set\n"
70-
"Rendered with matplotlib %s.%s, %s http://matplotlib.org"
72+
"Rendered with matplotlib %s.%s, %s - http://matplotlib.org"
7173
% (major, minor, year))
7274
ax.text(xmin+.025, ymin+.025, text, color="white", fontsize=12, alpha=0.5)
7375

0 commit comments

Comments
 (0)