issue187:python
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| issue187:python [2022/11/27 16:57] – d52fr | issue187:python [2022/11/29 18:26] (Version actuelle) – andre_domenech | ||
|---|---|---|---|
| Ligne 10: | Ligne 10: | ||
| Besides the scatter plot, there are line plots, log plots, stem plots, plots with multiple data sets and multiple axes, vertical bar plots, horizontal bar plots, multiple bar plots, stacked bar plots, histogram plots, datetime plots and candlestick plots – all without the need of using matplotlib.** | Besides the scatter plot, there are line plots, log plots, stem plots, plots with multiple data sets and multiple axes, vertical bar plots, horizontal bar plots, multiple bar plots, stacked bar plots, histogram plots, datetime plots and candlestick plots – all without the need of using matplotlib.** | ||
| + | |||
| + | Dans le numéro 171 de Full Circle (juillet 2021), nous avons examiné Plotext, un paquet pour Python qui permet de tracer directement dans un terminal. Au cours des 16 derniers mois, beaucoup de choses ont changé dans Plotext. Il est passé de la version 4.1.1 à la 5.2.8 et, bien qu'il y ait de nombreux changements au code interne, il y a aussi de nouvelles fonctionnalités. La page de leur dépôt est située à l' | ||
| + | |||
| + | Bien sûr, comme toujours, vous devez installer et/ou mettre à jour le paquet en utilisant pip. | ||
| + | |||
| + | pip3 install --upgrade plotext | ||
| + | |||
| + | Une fois que vous avez fait cela, vous pouvez commencer à l' | ||
| + | |||
| + | Si, en revanche, vous voulez écrire le programme, il ressemblera à ce qui est montré en haut à droite. | ||
| + | |||
| + | Outre le nuage de points, il existe des diagrammes linéaires, des diagrammes logarithmiques, | ||
| + | |||
| **When I originally found Plotext, I was interested in using the package to display plots within a Tkinter program using a standard widget like a Tk Label widget. It took a while, but digging through the online documentation and the source code, I was able to find a way by saving the plot to a file, then reading it in as text into the label object. The biggest problem that I had was that the size of the plot was based strictly on the size of the terminal when you ran the plot. Things didn’t always line up, especially when you were running the program within an IDE. | **When I originally found Plotext, I was interested in using the package to display plots within a Tkinter program using a standard widget like a Tk Label widget. It took a while, but digging through the online documentation and the source code, I was able to find a way by saving the plot to a file, then reading it in as text into the label object. The biggest problem that I had was that the size of the plot was based strictly on the size of the terminal when you ran the plot. Things didn’t always line up, especially when you were running the program within an IDE. | ||
| Ligne 20: | Ligne 33: | ||
| Take, for example, the code to produce a simple sine wave and display it in a Tk Label widget.** | Take, for example, the code to produce a simple sine wave and display it in a Tk Label widget.** | ||
| + | |||
| + | Lorsque j'ai découvert Plotext, j' | ||
| + | |||
| + | J'ai contacté l' | ||
| + | |||
| + | J' | ||
| + | |||
| + | J'ai recontacté l' | ||
| + | |||
| + | Prenons, par exemple, le code permettant de produire une onde sinusoïdale simple et de l' | ||
| Ligne 29: | Ligne 52: | ||
| Which downloads, displays then deletes a .jpg image in the terminal.** | Which downloads, displays then deletes a .jpg image in the terminal.** | ||
| + | |||
| + | En haut à droite, la ligne 1 est la commande plotext qui crée le tracé avec le marqueur sélectionné par l' | ||
| + | |||
| + | Bien sûr, certains tracés sont plus compliqués, | ||
| + | |||
| + | Il y a deux nouveaux types de graphiques disponibles ou grandement améliorés depuis la première version que j'ai essayée, les graphiques d' | ||
| + | |||
| + | Celui-ci télécharge, | ||
| + | |||
| **Which admittedly, doesn’t do a great job with the default settings, but when set properly, will give you something like this. | **Which admittedly, doesn’t do a great job with the default settings, but when set properly, will give you something like this. | ||
| Ligne 39: | Ligne 71: | ||
| Until next time, as always; stay safe, healthy, positive and creative!** | Until next time, as always; stay safe, healthy, positive and creative!** | ||
| + | |||
| + | Ce qui, il faut l' | ||
| + | |||
| + | Vous pouvez également l' | ||
| + | |||
| + | Bien que je ne sache pas vraiment pourquoi on voudrait faire ces choses-là, cela montre la puissance de la bibliothèque Plotext. | ||
| + | |||
| + | En conclusion, Plotext est une excellente bibliothèque complémentaire pour Python et, si vous avez besoin de faire des tracés légers dans un terminal ou dans une interface graphique Tkinter, vous ne pouvez pas faire mieux ! | ||
| + | |||
| + | Jusqu' | ||
| + | |||
issue187/python.1669564641.txt.gz · Dernière modification : 2022/11/27 16:57 de d52fr
