Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 59c9f36

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

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed

‎examples/showcase/mandelbrot.py

Copy file name to clipboardExpand all lines: examples/showcase/mandelbrot.py
+5-3Lines changed: 5 additions & 3 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.