Tiny Tutorial 3: Intro to Plotting in Python with Matplotlib

Publié le: 24 août 2017
sur la chaîne: Enthought
3,430
29

Matplotlib is an open source plotting library for the Python programming language. Matplotlib is both versatile and powerful - with it you can create everything from simple quick-and-dirty exploratory plots to very complex, publication-quality figures.

The online documentation (https://matplotlib.org) includes an extensive gallery of sample plots. This is a great starting point for your own plots - scroll through and find something similar to what you need, copy and paste the code into your editor, and - voila! - you can re-create that plot on your machine, and then modify it to suit your specific needs.

This is a really nice interactive way to work: go look for something that looks like what you want to do and then run it immediately in Canopy (https://www.enthought.com/product/can...) or another editor and play with it.

Now that you have the plot you can make some changes on the fly before you save it as an image to include in your document. For example, you can add grid lines by using the shortcut (g) or press it again to remove them. You can zoom into the plot by clicking and dragging to zoom in on the section you want to look at more closely, press (h) or escape to go back to the zoomed out view.

You can also add titles quickly in the figure options. Add the title and you can also change the scale within it. Click apply and there you go. You can make more simple adjustments on the fly and when you are ready to save press (s).

Now save your image where you want in the file format that you want. You can choose from a range of options, from jpg and png to pdf, even eps and svg.

That’s a quick look at what matplotlib can do and how easy it can be to get started, but that's just the tip of the iceberg.

Be sure to subscribe to the Enthought YouTube channel to keep up with the videos in the Tiny Tutorial series, to learn more about what you can do with this powerful, open source visualization tool.

**Learn more about Enthought's Python course offerings here:
https://goo.gl/rk1ouD


Sur cette page du site, vous pouvez voir la vidéo en ligne Tiny Tutorial 3: Intro to Plotting in Python with Matplotlib durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Enthought 24 août 2017, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,430 fois et il a aimé 29 téléspectateurs. Bon visionnage!