File:Illustration of discontinuity with sgn(x) (version 2).svg

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

Original file(SVG file, nominally 720 × 540 pixels, file size: 20 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Illustration that the signum function is not continuous at the point with and .
Date
Source Own work
Author Stephan Kulla (User:Stephan Kulla)
Other versions
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

from matplotlib.patches import Rectangle

import matplotlib.pyplot as plt
import numpy as np

def save_plot(filename, bound, eps, delta):
	f, ax = plt.subplots()

	ax.axhline(color="black")
	ax.axvline(color="black")

	ax.set_xlim(-bound,bound)
	ax.set_ylim(-2,2)

	ax.add_patch(
		Rectangle((-delta,-eps), 2*delta, 2*eps, edgecolor="black",
		          alpha=0.6, linestyle="solid", facecolor="#dddddd", lw=1.5))

	ax.plot([-bound,0],[-1,-1], color="blue")
	ax.plot([0,bound],[1,1], color="blue")

	ax.plot([-delta,0],[-1,-1], color="red", lw=2)
	ax.plot([0,delta],[1,1], color="red", lw=2)

	ax.plot([0,0],[1,-1], "o", color="white")
	ax.plot([0], [0], "o", color="green")

	plt.savefig(filename)

save_plot("Illustration of discontinuity with sgn(x).svg", bound=2, eps=0.5, delta=0.5)
save_plot("Illustration of discontinuity with sgn(x) (version 2).svg", bound=2, eps=0.5, delta=1)

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

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

Date/TimeThumbnailDimensionsUserComment
current18:00, 9 March 2017Thumbnail for version as of 18:00, 9 March 2017720 × 540 (20 KB)Stephan Kulla (talk | contribs)update
15:48, 26 February 2017Thumbnail for version as of 15:48, 26 February 2017720 × 540 (20 KB)Stephan Kulla (talk | contribs)User created page with UploadWizard

File usage on other wikis

Metadata