Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Programming for Arduino
  • Table Of Contents Toc
  • Feedback & Rating feedback
Python Programming for Arduino

Python Programming for Arduino

By : Pratik Desai
4.6 (22)
close
close
Python Programming for Arduino

Python Programming for Arduino

4.6 (22)
By: Pratik Desai

Overview of this book

This is the book for you if you are a student, hobbyist, developer, or designer with little or no programming and hardware prototyping experience, and you want to develop IoT applications. If you are a software developer or a hardware designer and want to create connected devices applications, then this book will help you get started.
Table of Contents (13 chapters)
close
close
12
Index

Plotting random numbers using matplotlib


The matplotlib library provides a collection of basic plotting-related functions and methods via the pyplot framework. The pyplot framework contains functions for creating figures, drawing plots, setting up titles, setting up axes, and many additional plotting methods. One of the import functions provided by pyplot is figure(). This initializes an empty figure canvas that can be selected for your plot or a set of plots:

fig1 = pyplot.figure(1)

You can similarly create multiple figures by specifying a number as the parameter, that is, figure(2). If a figure with this number already exists, the method activates the existing figure that can then be further used for plotting.

The matplotlib library provides the plot() method to create line charts. The plot() method takes a list or an array data structure that is made up of integer or floating point numbers as input. If two arrays are used as inputs, plot() utilizes them as values for the x axis and the...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY