<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://wiki.electroniciens.cnrs.fr/index.php?action=history&amp;feed=atom&amp;title=Le_groupe_Python_%3A_Module_PyQtGraph</id>
	<title>Le groupe Python : Module PyQtGraph - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.electroniciens.cnrs.fr/index.php?action=history&amp;feed=atom&amp;title=Le_groupe_Python_%3A_Module_PyQtGraph"/>
	<link rel="alternate" type="text/html" href="https://wiki.electroniciens.cnrs.fr/index.php?title=Le_groupe_Python_:_Module_PyQtGraph&amp;action=history"/>
	<updated>2026-04-18T18:16:05Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.electroniciens.cnrs.fr/index.php?title=Le_groupe_Python_:_Module_PyQtGraph&amp;diff=3617&amp;oldid=prev</id>
		<title>William.benharbone le 11 novembre 2018 à 23:42</title>
		<link rel="alternate" type="text/html" href="https://wiki.electroniciens.cnrs.fr/index.php?title=Le_groupe_Python_:_Module_PyQtGraph&amp;diff=3617&amp;oldid=prev"/>
		<updated>2018-11-11T23:42:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;div&amp;gt;[[Accueil]] - [[Le groupe Python|Python]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;[[Le groupe Python| Accueil]] - [[Le_groupe_Python_:_Installation|Installation]] - [[Le_groupe_Python_:_Premiers_pas|Premiers pas]] - [[Le_groupe_Python_:_Module_PyQtGraph|PyQtGraph]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;hr/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[Image:Nuvola apps edu miscellaneous.png|40px|link=|]] Introduction ==&lt;br /&gt;
&lt;br /&gt;
Le module [http://pyqtgraph.org/ PyQtGraph], à l&amp;#039;heure à laquelle j&amp;#039;écris cette page, fonctionne avec le Framework Qt dans sa version 4. Il nous impose d&amp;#039;utiliser la version d&amp;#039;Anaconda 4.1.1. Pourquoi tant de sacrifice pour un module de tracer ? Regardons ce qu&amp;#039;il nous permet de faire...&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
Au cas où, vous ne l&amp;#039;auriez pas installer, je vous renvoie à la page d&amp;#039;[[Le_groupe_Python_:_Installation|Installation]]&lt;br /&gt;
&lt;br /&gt;
Le module PyQtGraph va plus loin que la réalisation de graphique en 2D. Si vous souhaitez voir ou mettre en œuvre un graphique 3D, il vous faudra installer le module &amp;#039;&amp;#039;&amp;#039;pyopengl&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
   activate py35Qt4&lt;br /&gt;
   pip install pyopengl&lt;br /&gt;
&lt;br /&gt;
== Que peut-on faire avec ce module ? ==&lt;br /&gt;
&lt;br /&gt;
Je vous invite à regarder directement la [http://pyqtgraph.readthedocs.io/en/develop/index.html documentation] du module et plus particulièrement la section [http://pyqtgraph.readthedocs.io/en/develop/introduction.html#examples Exemples] qui nous invite à lancer les commandes suivantes :&lt;br /&gt;
&lt;br /&gt;
  import pyqtgraph.examples&lt;br /&gt;
  pyqtgraph.examples.run()&lt;br /&gt;
&lt;br /&gt;
[[Fichier:ExamplesPyQtGraph.PNG|780px]]&lt;br /&gt;
[[Fichier:BasicPlotsPyQtGraph.PNG|700px]]&lt;br /&gt;
&lt;br /&gt;
== Réalisation d&amp;#039;un exemple ==&lt;br /&gt;
&lt;br /&gt;
Je vous propose de créer une interface graphique en utilisant le Framework Qt dans laquelle nous intégrerons un tracé rafraichis et deux boutons pour lancer le tracé et l&amp;#039;arrêt.&lt;br /&gt;
&lt;br /&gt;
=== Traçons l&amp;#039;interface sous Designer ===&lt;br /&gt;
&lt;br /&gt;
* Commençons par ouvrir Designer et dessinons notre interface.&lt;br /&gt;
&lt;br /&gt;
[[Fichier:01_Designer.PNG|center|900px]]&lt;br /&gt;
&lt;br /&gt;
* Intégrons les deux boutons poussoirs et un Graphics View.&lt;br /&gt;
&lt;br /&gt;
[[Fichier:02_Designer_PB_GV.PNG|center|900px]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Pourquoi un Graphics View ?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
Dans la [http://pyqtgraph.readthedocs.io/en/develop/how_to_use.html#embedding-widgets-inside-pyqt-applications documentation] du module PyQtGraph, tout est expliqué pour intégrer un objet graphique qui sera relié à une classe du module PyQtGrah. Rappelons ici les instructions de la documentation :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:03_Instructions_PyQtGraph.PNG|center|700px]]&lt;br /&gt;
&lt;br /&gt;
* Clique droit sur le QGraphicsView (promouvoir en...) :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:04_promote_to.png|center|500px]]&lt;br /&gt;
&lt;br /&gt;
* Ajoutons la configuration ( “Promoted class name” =&amp;gt; “PlotWidget”, “Header file” =&amp;gt; “pyqtgraph” ) :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:05_add.png|center|700px]]&lt;br /&gt;
&lt;br /&gt;
* Promouvons la QGraphicsView :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:06_promote.png|center|700px]]&lt;br /&gt;
&lt;br /&gt;
* Agençons nos boutons poussoirs horizontalement :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:07_hLayout.png|center|700px]]&lt;br /&gt;
&lt;br /&gt;
* Mettons en place une mise en page de type vertical afin que les objets graphiques s&amp;#039;adaptent dynamiquement à la dimension de la fenêtre :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:08_miseEnPage.png|center|700px]]&lt;br /&gt;
&lt;br /&gt;
* La police des noms des boutons poussoirs semblent petites, nous pouvons modifier ceci dans les propriétés des deux boutons poussoirs :&lt;br /&gt;
&lt;br /&gt;
[[Fichier:09_ajustementBoutton.png|center|900px]]&lt;br /&gt;
&lt;br /&gt;
* Enregistrons notre interface sous le nom &amp;#039;&amp;#039;&amp;#039;ui_testPyQtGraph&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Fichier:10 enregistrement.png |center|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Convertissons notre interface réalisée sous Designer en un script Python ===&lt;/div&gt;</summary>
		<author><name>William.benharbone</name></author>
	</entry>
</feed>