File:Exemple superposition de pics large et etroit.svg
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search

Size of this PNG preview of this SVG file: 800 × 480 pixels. Other resolutions: 320 × 192 pixels | 1,024 × 614 pixels | 1,280 × 768 pixels | 2,560 × 1,536 pixels | 900 × 540 pixels.
Original file (SVG file, nominally 900 × 540 pixels, file size: 29 KB)
File information
Structured data
Captions
Captions
Example of overlapping peaks, with a large and low peak, and a high and narrow peak.
Exemple de superposition de pics, avec un pics large et bas, et un pic étroit et haut.
Summary
[edit]DescriptionExemple superposition de pics large et etroit.svg |
Français : Exemple de superposition de pics, avec un pics large et bas, et un pic étroit et haut.
English: Example of overlapping peaks, with a large and low peak, and a high and narrow peak. |
Date | |
Source | Own work |
Author | Cdang |
Other versions | Noisy curve and peaks detection with the Savitzky-Golay algorithm: File:Detection pics savitzky golay.svg ; use of the scipy peakgfind algorithm: File:Detection pics scipy signal find peaks.svg |
![]() |

This W3C-invalid plot was created with Matplotlib.

This W3C-invalid vector image was created with Python by cdang.
Source code
InfoField
Creation of the data file.
Python code
#!/usr/bin/python3
# coding: utf-8
"""nom : superpositionPics.py
auteur : User:cdang
date de création : 2023-04-20
dates de modification :
----------------------------------------------------------------------------
version de Python : 3
module requis : NumPy, Pandas
----------------------------------------------------------------------------
Objectif : crée un graphique montrant la superposition de pics.
Entrées
-------
Paramètres de la fonction générant le nuage de points (codé en dur).
Sorties
-------
fichier SVG.
"""
import numpy as np
import matplotlib.pyplot as plt
# ****************
# ****************
# ** Paramètres **
# ****************
# ****************
facteurSigma = 0.03/np.sqrt(2*np.pi) # rapport entre la hauteur et la largeur d'un pic
x1 = 0.3 ; h1 = 0.5 # position et hauteur des pics
x2 = 0.75 ; h2 = 0.1
x3 = 0.8 ; h3 = 1
n = 400 # nombre de points
# chemin d'accès et nom du fichier à créer
chemin = "~/dummypath/"
nomFichier = "exemple_superposition_de_pics_large_et_etroit.svg"
# **************
# **************
# ** Fonction **
# **************
# **************
def f(x, mu, sigma):
"""Fonction pour générer un pic.
Entrées :
— x : vecteur de réels (abscisses) ;
— mu : réel, position du pic ;
— sigma : réel, écart type de la fonction gaussienne.
Sortie : y, vecteur de réels (ordonnées) de même dimension que x.
y = 1/(σ × √(2π)) × exp((x - μ)²/(2σ²))."""
unSurSigma = 1/sigma
y = (unSurSigma*facteurSigma)*np.exp(-0.5*unSurSigma*unSurSigma*(x - mu)*(x - mu))
return y
# *************************
# *************************
# ** Programme principal **
# *************************
# *************************
X = np.linspace(0, 1, n)
Y1 = f(X, x1, facteurSigma/h1)
Y2 = f(X, x2, facteurSigma/h2)
Y3 = f(X, x3, facteurSigma/h3)
Y = Y1 + Y2 + Y3
fig = plt.figure(figsize = [10, 6])
plt.plot(X, Y, "k", linewidth = 1, label = "somme")
plt.plot(X, Y1, "r", linewidth = 0.5, label = "pic 1")
plt.plot(X, Y2, "g", linewidth = 0.5, label = "pic 2")
plt.plot(X, Y3, "b", linewidth = 0.5, label = "pic 3")
plt.xlabel("x (u.a.)")
plt.ylabel("y (u.a.)")
plt.legend()
plt.savefig(chemin+nomFichier, format="svg")
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:



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.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 07:51, 20 April 2023 | ![]() | 900 × 540 (29 KB) | Cdang (talk | contribs) | Uploaded own work with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Width | 720pt |
---|---|
Height | 432pt |