File:MandelbrotMapOrbitTimeSeries 0p24.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 864 × 432 pixels, file size: 63 KB)

Captions

Captions

Time series of an orbit of the Mandelbrot map

Summary[edit]

Description
English: Time series of an orbit of the Mandelbrot map.

Plotting code:

# Argument: floating point c, or "selection"
import sys, decimal, matplotlib.pyplot as plt
decimal.getcontext().prec=100
dpi=300
cSelection = ["0.2501", "0.24", "-0.4", "-0.74", "-0.8", "-1.24", "-1.26", "-1.38", "-1.42", "-1.74991",
              "-1.74992", "-1.75", "-1.8", "-1.99"]
imageSuffix = ".svg" # can be ".svg", ".png", etc.
cStr = sys.argv[1]
seriesLen = 300
if len(sys.argv) > 2:
  seriesLen = int(sys.argv[2])
def plotC(cStr):
  c = decimal.Decimal(cStr)
  xSeries = [0] * seriesLen
  x = decimal.Decimal(0)
  xSeries[0] = float(x)
  for i in xrange(seriesLen - 1):
    try:
      x = x * x + c
      xSeries[i + 1] = float(x)
    except decimal.Overflow:
      xSeries[i + 1] = float("nan")
  # Output
  for i in xrange(seriesLen):
    print xSeries[i]
  # Plot
  fig, biax = plt.subplots()
  figSize = fig.get_size_inches()
  fig.set_size_inches(figSize[0] * 3/2, figSize[1])
  plt.rc('font', size=8)
  biax.plot(range(seriesLen), xSeries, ".-", linewidth=0.5, markersize=1)
  biax.set(xlabel="i", ylabel="x", title="Orbit time series for $f(x) = x^2 + c$; c=" + str(c))
  plt.grid(linewidth=0.25, color="#DDDDDD")
  cStr = str(c).replace(".", "p").replace("-", "m")
  fileName = "MandelbrotMapOrbitTimeSeries_" + cStr + imageSuffix
  plt.savefig(fileName, dpi=dpi)
if cStr == "selection":
  for cStr in cSelection:
    plotC(cStr)
else:
  plotC(cStr)
Date
Source Own work
Author Dan Polansky

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution
This file is licensed under the Creative Commons Attribution 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.

File history

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

Date/TimeThumbnailDimensionsUserComment
current12:10, 20 February 2024Thumbnail for version as of 12:10, 20 February 2024864 × 432 (63 KB)Dan Polansky (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata