File:Julia set, plotted with Matplotlib.svg

Original file(SVG file, nominally 900 × 630 pixels, file size: 5.11 MB)

Summary

Description
English: The Julia set plotted with Matplotlib. The seed coordinates are (-0.512511498387847167, 0.521295573094847167), the same as for File:Julia set (red).png.
Date
Source Own work
Author Morn
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

Source code
from pylab import *
from numpy import NaN
from matplotlib.colors import LogNorm

# seed parameter from https://commons.wikimedia.org/wiki/File:Julia_set_%28red%29.png
s = -0.512511498387847167, 0.521295573094847167

res = .001    # grid resolution
max_it = 1000 # maximum number of iterations

figure(figsize = (10, 7))

def jul(a):
	z = a
	for n in range(1, max_it + 1):
		z = z**2 + s[0] + 1j * s[1]
		if abs(z) > 2:
			return n
	return NaN

X = arange(-2, 2 + res, res)
Y = arange(-1.5,  1.5 + res, res)
Z = zeros((len(Y), len(X)))

for iy, y in enumerate(Y):
	print (iy + 1, "of", len(Y))
	for ix, x in enumerate(X):
		Z[-iy - 1, ix] = jul(x + 1j * y)

save("julia", Z)	# save array to file

imshow(Z, cmap = plt.cm.viridis, interpolation = 'none', norm = LogNorm(),
  extent = (X.min(), X.max(), Y.min(), Y.max()))
xlabel("Re(z)")
ylabel("Im(z)")
axis((-1.5, 1.5, -1, 1))
savefig("julia_python.svg")
show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

Captions

A Julia set

Items portrayed in this file

depicts

20 January 2019

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:09, 20 January 2019Thumbnail for version as of 22:09, 20 January 2019900 × 630 (5.11 MB)MornUser created page with UploadWizard
The following pages on the English Wikipedia use this file (pages on other projects are not listed):

Global file usage

The following other wikis use this file:

Metadata