WEBVTT

1
00:00:00.200 --> 00:00:01.700
<v Instructor>Hi guys and welcome back.</v>

2
00:00:01.700 --> 00:00:03.850
In this video, we're going to learn how to create

3
00:00:03.850 --> 00:00:06.420
pie charts with matplotlib and we're also going

4
00:00:06.420 --> 00:00:10.100
to use our poll data to create some pie charts.

5
00:00:10.100 --> 00:00:11.690
Let's get to it.

6
00:00:11.690 --> 00:00:14.760
We've been using dot plot to create line graphs.

7
00:00:14.760 --> 00:00:18.440
But matplotlib can very easily create pie charts as well.

8
00:00:18.440 --> 00:00:19.770
In its simplest form, though,

9
00:00:19.770 --> 00:00:22.690
a pie chart requires only a list of numbers.

10
00:00:22.690 --> 00:00:24.600
So let's get started with that.

11
00:00:24.600 --> 00:00:28.490
We're gonna do figure equal plt dot figure.

12
00:00:28.490 --> 00:00:30.360
And we're gonna add our axes here.

13
00:00:30.360 --> 00:00:32.950
Since we're only doing a single set of axes,

14
00:00:32.950 --> 00:00:35.800
I'm just gonna do this instead of using the shorthand.

15
00:00:35.800 --> 00:00:38.120
So we'll do add, subplot.

16
00:00:38.120 --> 00:00:40.150
And here we can put in one, one, one,

17
00:00:40.150 --> 00:00:43.100
since we are only creating one row and one column.

18
00:00:43.100 --> 00:00:45.640
And the index that we want to place

19
00:00:45.640 --> 00:00:48.320
this set of axes in is one.

20
00:00:48.320 --> 00:00:49.460
You don't have to put this in.

21
00:00:49.460 --> 00:00:50.340
This is the default.

22
00:00:50.340 --> 00:00:51.290
So if you leave it empty,

23
00:00:51.290 --> 00:00:53.200
that's what's gonna happen anyway.

24
00:00:53.200 --> 00:00:55.960
Then we can do something like axes dot pie.

25
00:00:55.960 --> 00:00:57.540
And this is gonna create a pie chart.

26
00:00:57.540 --> 00:00:59.980
And what it needs is three numbers.

27
00:00:59.980 --> 00:01:02.590
For example, 63, 28, and eight.

28
00:01:02.590 --> 00:01:05.250
Let's say that we've got a poll from our database,

29
00:01:05.250 --> 00:01:09.370
and it received 99 votes, which is what this adds up to.

30
00:01:09.370 --> 00:01:12.990
So about 63% of those votes, is this,

31
00:01:12.990 --> 00:01:17.290
28% of the votes is that, and 8% of the vote is this number.

32
00:01:17.290 --> 00:01:20.070
This is going to create a pie chart with three segments,

33
00:01:20.070 --> 00:01:25.070
where this one equates to 63% each of the total.

34
00:01:25.240 --> 00:01:28.670
So let me just run this and show you what that looks like.

35
00:01:28.670 --> 00:01:30.370
We get this pie chart here.

36
00:01:30.370 --> 00:01:34.230
63 is the blue, 28 is the orange and eight is the green.

37
00:01:34.230 --> 00:01:36.350
Notice that matplotlib has also taken care

38
00:01:36.350 --> 00:01:38.810
of the colours for us and it uses the default colours

39
00:01:38.810 --> 00:01:41.960
which look alright, in order to draw this pie chart.

40
00:01:41.960 --> 00:01:44.010
We can also pass in labels for each.

41
00:01:44.010 --> 00:01:45.200
So I'm gonna do that now.

42
00:01:45.200 --> 00:01:49.090
What I'm gonna do is extract these numbers into a variable.

43
00:01:49.090 --> 00:01:51.920
So I'll call it option votes, for example.

44
00:01:51.920 --> 00:01:54.000
And then we'll create option names.

45
00:01:54.000 --> 00:01:58.980
And we'll have Flask, Django, and It depends.

46
00:01:58.980 --> 00:02:00.520
Depends like that.

47
00:02:00.520 --> 00:02:02.670
And I'm gonna spread it into three lines

48
00:02:02.670 --> 00:02:04.140
just so it's a bit more readable.

49
00:02:04.140 --> 00:02:05.950
And now we have to pass these in here.

50
00:02:05.950 --> 00:02:08.290
So the first one is option votes.

51
00:02:08.290 --> 00:02:12.220
And the second one is labels equal option names.

52
00:02:12.220 --> 00:02:14.240
And it's important that this is a keyword argument,

53
00:02:14.240 --> 00:02:17.400
because the order of these arguments does matter.

54
00:02:17.400 --> 00:02:19.810
And it's important that this is a keyword argument.

55
00:02:19.810 --> 00:02:21.570
So now we can run this.

56
00:02:21.570 --> 00:02:25.460
And matplotlib by default is going to separate these labels

57
00:02:25.460 --> 00:02:29.410
by 10% more than the radius of the pie chart.

58
00:02:29.410 --> 00:02:32.540
So these are slightly outside the pie chart there.

59
00:02:32.540 --> 00:02:35.620
In the documentation, you'll find how to adjust that.

60
00:02:35.620 --> 00:02:38.610
There's quite a lot more arguments that we can pass into pie

61
00:02:38.610 --> 00:02:40.210
but we're gonna look at two in particular.

62
00:02:40.210 --> 00:02:41.990
We're gonna look at explode.

63
00:02:41.990 --> 00:02:44.930
So I'm gonna simply bring these

64
00:02:44.930 --> 00:02:46.950
into multiple lines like that.

65
00:02:46.950 --> 00:02:48.580
And then we'll have explode here

66
00:02:48.580 --> 00:02:51.770
and I'm gonna do 0.1, zero and zero.

67
00:02:51.770 --> 00:02:54.620
And what this is going to do is it's going to separate

68
00:02:54.620 --> 00:02:58.760
the first segment, which is 63 or Flask,

69
00:02:58.760 --> 00:03:01.040
from the centre of the pie chart,

70
00:03:01.040 --> 00:03:03.810
while leaving the other two unseparated.

71
00:03:03.810 --> 00:03:05.700
So if I run this, you'll see what I mean.

72
00:03:05.700 --> 00:03:07.140
The centre of the pie chart is here,

73
00:03:07.140 --> 00:03:09.630
and this segment has sort of navigated itself

74
00:03:09.630 --> 00:03:10.913
a bit further away.

75
00:03:12.220 --> 00:03:17.220
Finally, we can use auto pct to display the percentage

76
00:03:17.400 --> 00:03:21.360
that each segment is out of the total within the segment.

77
00:03:21.360 --> 00:03:22.193
In order to do this,

78
00:03:22.193 --> 00:03:25.630
we pass in a format string surrounded by percent signs.

79
00:03:25.630 --> 00:03:29.410
So we can do 1.1 f percent, percent.

80
00:03:29.410 --> 00:03:32.670
And now we're gonna show this as the number of digits.

81
00:03:32.670 --> 00:03:36.230
f because it's a fixed amount of decimal places,

82
00:03:36.230 --> 00:03:37.610
and then a percent sign.

83
00:03:37.610 --> 00:03:40.030
And the string is to be surrounded by percent signs

84
00:03:40.030 --> 00:03:41.260
in order to be valid.

85
00:03:41.260 --> 00:03:43.410
So really, this is the string that we're passing in

86
00:03:43.410 --> 00:03:45.547
and the percent signs are just necessary in matplotlib.

87
00:03:45.547 --> 00:03:47.510
And at the end of the day, what we get back

88
00:03:47.510 --> 00:03:50.620
is 63.6%, 8.1%, 28.3%.

89
00:03:51.880 --> 00:03:54.380
So again, the one here before the decimal place

90
00:03:54.380 --> 00:03:56.450
tells us that we are dealing with numbers.

91
00:03:56.450 --> 00:04:00.050
The point one f tells us how many fixed decimal places

92
00:04:00.050 --> 00:04:00.980
we want to use.

93
00:04:00.980 --> 00:04:02.440
In this case, it's one.

94
00:04:02.440 --> 00:04:03.850
And then the percent sign at the end

95
00:04:03.850 --> 00:04:05.340
is just this percent symbol there.

96
00:04:05.340 --> 00:04:07.140
And it is surrounded by percent signs

97
00:04:07.140 --> 00:04:09.310
to be valid in matplotlib.

98
00:04:09.310 --> 00:04:11.410
Let's expand our app a bit more.

99
00:04:11.410 --> 00:04:13.840
We're gonna show the user the open polls

100
00:04:13.840 --> 00:04:15.160
that we've got in our database.

101
00:04:15.160 --> 00:04:18.080
And we're gonna let them pick which poll they want to graph.

102
00:04:18.080 --> 00:04:20.400
And we're going to create a pie chart

103
00:04:20.400 --> 00:04:22.880
from the data in our database.

104
00:04:22.880 --> 00:04:23.970
The first thing we're gonna need

105
00:04:23.970 --> 00:04:27.060
is to start working on our app structure.

106
00:04:27.060 --> 00:04:29.180
Since we're going to retrieve data

107
00:04:29.180 --> 00:04:31.740
from our polling database,

108
00:04:31.740 --> 00:04:33.280
we're going to build this app

109
00:04:33.280 --> 00:04:35.090
like we did in our earlier sections.

110
00:04:35.090 --> 00:04:37.830
So I'm going to get rid of this file,

111
00:04:37.830 --> 00:04:39.460
since we're not gonna need it just now.

112
00:04:39.460 --> 00:04:43.620
And I'm going to create first of all a dot env file.

113
00:04:43.620 --> 00:04:44.580
And here we're gonna put

114
00:04:44.580 --> 00:04:47.540
the database URI of our application.

115
00:04:47.540 --> 00:04:50.420
I'll also create a dot env dot example file

116
00:04:50.420 --> 00:04:52.200
for other developers in case

117
00:04:52.200 --> 00:04:54.720
that we want to store this in GitHub.

118
00:04:54.720 --> 00:04:58.760
So we'll do database URI equal there.

119
00:04:58.760 --> 00:04:59.800
Now as well as this,

120
00:04:59.800 --> 00:05:01.700
this you should fill in with your own database URI,

121
00:05:01.700 --> 00:05:02.533
by the way.

122
00:05:02.533 --> 00:05:04.530
I'll put mine in, in just a moment.

123
00:05:04.530 --> 00:05:08.390
Next, we're gonna create a database dot py file.

124
00:05:08.390 --> 00:05:11.660
And here we're gonna put our queries that we'll need

125
00:05:11.660 --> 00:05:14.150
to retrieve the information from our database.

126
00:05:14.150 --> 00:05:17.100
Remember, we're gonna ask the user for a poll.

127
00:05:17.100 --> 00:05:19.040
They're gonna pick the poll that they want.

128
00:05:19.040 --> 00:05:20.750
And we're going to create a pie chart

129
00:05:20.750 --> 00:05:22.920
out of the options in that poll.

130
00:05:22.920 --> 00:05:25.650
So what we need really is polls

131
00:05:25.650 --> 00:05:27.970
and options with their votes.

132
00:05:27.970 --> 00:05:29.720
So select polls,

133
00:05:29.720 --> 00:05:32.930
is going to be something like select star from polls,

134
00:05:32.930 --> 00:05:36.670
and the options, select options in poll,

135
00:05:36.670 --> 00:05:38.920
is gonna be something like,

136
00:05:38.920 --> 00:05:43.560
select options dot text and the sum of votes,

137
00:05:43.560 --> 00:05:44.743
from options.

138
00:05:45.850 --> 00:05:50.850
Join polls on options dot poll ID equal polls ID.

139
00:05:51.960 --> 00:05:56.960
Join votes on options dot ID equal votes dot option ID.

140
00:05:58.390 --> 00:06:00.140
Then we're gonna add a where clause,

141
00:06:00.140 --> 00:06:03.270
polls ID equal whatever the user entered.

142
00:06:03.270 --> 00:06:07.140
And we're gonna group by options text.

143
00:06:07.140 --> 00:06:08.670
So these are the two queries we'll need.

144
00:06:08.670 --> 00:06:11.680
And now we can add the rest of our database dot py.

145
00:06:11.680 --> 00:06:15.070
Like importing psycho pg two, loading in the dot env,

146
00:06:15.070 --> 00:06:18.343
and we'll create two functions for these queries.

147
00:06:24.100 --> 00:06:25.850
So I've gone ahead and added my imports

148
00:06:25.850 --> 00:06:27.057
and called load dot env.

149
00:06:27.057 --> 00:06:29.700
But of course, we do need to instal psycho pg two

150
00:06:29.700 --> 00:06:31.270
and python dot env.

151
00:06:31.270 --> 00:06:34.100
So again, you can do this via your terminal,

152
00:06:34.100 --> 00:06:38.500
by simply doing pip instal psycho pg two dash binary

153
00:06:38.500 --> 00:06:40.500
and python dot env.

154
00:06:40.500 --> 00:06:42.670
Make sure to instal psycho pg two dash binary.

155
00:06:42.670 --> 00:06:44.720
Make sure that your pip is up to date

156
00:06:44.720 --> 00:06:46.330
before running this command.

157
00:06:46.330 --> 00:06:48.720
And that is going to instal psycho pg two dash binary

158
00:06:48.720 --> 00:06:50.190
and python dot env.

159
00:06:50.190 --> 00:06:53.960
Now, our red underlines will magically go away.

160
00:06:53.960 --> 00:06:56.790
Next up, we're going to connect to psycho pg two.

161
00:06:56.790 --> 00:07:00.196
So we'll do connection equal psycho pg two dot connect,

162
00:07:00.196 --> 00:07:04.213
os dot environ dot get of database, URI.

163
00:07:05.090 --> 00:07:06.920
And then we'll create our two functions

164
00:07:06.920 --> 00:07:08.883
to execute these queries.

165
00:07:17.210 --> 00:07:18.450
So we've gone ahead and do that.

166
00:07:18.450 --> 00:07:21.220
We have our connection to psycho pg two here.

167
00:07:21.220 --> 00:07:23.470
And then we have our two functions, get polls,

168
00:07:23.470 --> 00:07:25.950
which opens up the transaction, gets a cursor

169
00:07:25.950 --> 00:07:28.490
and executes the query and then returns everything.

170
00:07:28.490 --> 00:07:30.530
And get options which takes in a poll ID,

171
00:07:30.530 --> 00:07:32.020
which is supposed to be an integer,

172
00:07:32.020 --> 00:07:33.820
and then does the same thing by executing

173
00:07:33.820 --> 00:07:38.820
select options in poll, passing in the poll ID argument.

174
00:07:38.990 --> 00:07:40.170
Alright, now that we've got this,

175
00:07:40.170 --> 00:07:42.290
we can go ahead and open a Python console

176
00:07:42.290 --> 00:07:43.910
and we're gonna test our database dot py

177
00:07:43.910 --> 00:07:45.170
to make sure it works.

178
00:07:45.170 --> 00:07:49.270
So the first thing to do is to do import database.

179
00:07:49.270 --> 00:07:50.890
And because this Python console

180
00:07:50.890 --> 00:07:54.120
is running in our current project, we can do that.

181
00:07:54.120 --> 00:07:58.820
We can do database dot get polls and run that.

182
00:07:58.820 --> 00:08:00.770
And you can see that we get back our polls.

183
00:08:00.770 --> 00:08:02.990
So at the moment, my data is a bit bare.

184
00:08:02.990 --> 00:08:05.950
We only have one poll, and three options and one vote,

185
00:08:05.950 --> 00:08:08.850
but it's gonna let us see how to do this.

186
00:08:08.850 --> 00:08:10.960
Alright, so we've got the data here.

187
00:08:10.960 --> 00:08:13.240
This is a good way to test things out, by the way.

188
00:08:13.240 --> 00:08:15.670
So now we can stop this interpreter, close that down

189
00:08:15.670 --> 00:08:18.233
and go ahead and create our app dot py.

190
00:08:21.540 --> 00:08:24.330
I'll start off app dot py with the prompt.

191
00:08:24.330 --> 00:08:26.840
Well, I'll import database and then create to prompt.

192
00:08:26.840 --> 00:08:29.650
We're gonna have a prompt for the menu, enter q to quit

193
00:08:29.650 --> 00:08:31.740
or anything else to chart a new poll.

194
00:08:31.740 --> 00:08:32.970
And then we'll also have one

195
00:08:32.970 --> 00:08:35.800
that asks them for the poll ID they want to chart.

196
00:08:35.800 --> 00:08:37.580
We're gonna have a user menu

197
00:08:37.580 --> 00:08:41.340
that simply runs through over and over until they enter q.

198
00:08:41.340 --> 00:08:43.410
They're gonna get the polls on the database,

199
00:08:43.410 --> 00:08:44.530
and we're gonna have a function

200
00:08:44.530 --> 00:08:47.573
that prompts them to select one of those polls.

201
00:08:48.580 --> 00:08:49.413
In this function,

202
00:08:49.413 --> 00:08:51.670
we're going to take in the polls from the database,

203
00:08:51.670 --> 00:08:53.510
and then we're going to iterate through them,

204
00:08:53.510 --> 00:08:56.920
printing out the ID and the poll title.

205
00:08:56.920 --> 00:08:58.010
And what we're gonna do then

206
00:08:58.010 --> 00:09:01.240
is ask them for the selected poll that they want to chart

207
00:09:01.240 --> 00:09:04.210
and we're going to call another function with that.

208
00:09:04.210 --> 00:09:06.200
So I'm going to do this.

209
00:09:06.200 --> 00:09:09.460
Selected poll is int of input of the poll prompt.

210
00:09:09.460 --> 00:09:12.950
And then we're gonna chart the options for the poll.

211
00:09:12.950 --> 00:09:14.870
That is gonna be another function

212
00:09:14.870 --> 00:09:18.170
that simply takes that, gets the options from the database,

213
00:09:18.170 --> 00:09:21.410
and now goes ahead and draws the pie chart here.

214
00:09:21.410 --> 00:09:23.450
So here we will draw the pie chart

215
00:09:23.450 --> 00:09:26.150
with the data from our database, which is as you know,

216
00:09:26.150 --> 00:09:29.220
the option text and the sum of the votes.

217
00:09:29.220 --> 00:09:30.710
But in order to draw the chart,

218
00:09:30.710 --> 00:09:32.290
I'm going to create another file

219
00:09:32.290 --> 00:09:34.780
that I'm gonna call charts dot py.

220
00:09:34.780 --> 00:09:36.990
The reason for that is because I want to decouple

221
00:09:36.990 --> 00:09:40.170
user interaction in app dot py to creating

222
00:09:40.170 --> 00:09:42.303
the charts in charts dot py.

223
00:09:43.290 --> 00:09:44.370
Here in charts dot py,

224
00:09:44.370 --> 00:09:46.370
we're gonna start off by importing matplotlib.

225
00:09:46.370 --> 00:09:50.540
So we'll do import matplotlib dot pie plot as plt.

226
00:09:50.540 --> 00:09:53.960
And then I'll define the create pie chart function.

227
00:09:53.960 --> 00:09:57.520
Which takes in the list of option titles and their votes.

228
00:09:57.520 --> 00:10:01.130
Here we create the figure plt dot figure.

229
00:10:01.130 --> 00:10:05.093
And we create the axes, which is figure dot add subplot,

230
00:10:06.790 --> 00:10:08.640
one, one, one.

231
00:10:08.640 --> 00:10:10.920
Whenever I'm creating, you know, proper functions,

232
00:10:10.920 --> 00:10:12.870
and I'm starting to develop a larger application

233
00:10:12.870 --> 00:10:15.320
and so forth, I like to be more explicit.

234
00:10:15.320 --> 00:10:17.370
So that's why I'm passing in one, one, one here,

235
00:10:17.370 --> 00:10:19.940
rather than leaving it as the default.

236
00:10:19.940 --> 00:10:22.100
But it's up to you, that is the default.

237
00:10:22.100 --> 00:10:23.800
Then we'll do axes dot pie.

238
00:10:23.800 --> 00:10:26.430
And what we wanna pass in here, is first of all,

239
00:10:26.430 --> 00:10:27.900
the list of value.

240
00:10:27.900 --> 00:10:32.900
So that is option one for option in options.

241
00:10:33.090 --> 00:10:35.720
And then we wanna pass in the labels,

242
00:10:35.720 --> 00:10:39.700
which are option zero for option in options.

243
00:10:39.700 --> 00:10:44.070
Remember that each option comes with the text as column zero

244
00:10:44.070 --> 00:10:46.810
and the sum of votes as column one.

245
00:10:46.810 --> 00:10:48.110
You should have put in a comma there.

246
00:10:48.110 --> 00:10:50.700
And finally, I'm gonna put an auto pct here

247
00:10:50.700 --> 00:10:54.140
of percent 1.1 f, percent, percent.

248
00:10:54.140 --> 00:10:57.130
And again, that is 1.1 f percent,

249
00:10:57.130 --> 00:11:00.120
which is the format string surrounded by percent signs.

250
00:11:00.120 --> 00:11:02.740
Then we're gonna do return figure.

251
00:11:02.740 --> 00:11:06.980
And I don't want to do figure dot show or plt dot show here,

252
00:11:06.980 --> 00:11:09.800
because again, I don't want this function to be responsible

253
00:11:09.800 --> 00:11:11.790
for displaying things to the user.

254
00:11:11.790 --> 00:11:14.163
I want that to be kept in app dot py.

255
00:11:15.160 --> 00:11:16.500
So now we can come here

256
00:11:16.500 --> 00:11:20.680
and say figure is equal to charts dot create pie

257
00:11:21.590 --> 00:11:23.010
chart with the options.

258
00:11:23.010 --> 00:11:26.293
I do have to import this, so I will do that.

259
00:11:28.170 --> 00:11:31.070
And then we can do plt dot show.

260
00:11:31.070 --> 00:11:33.740
And here we do need to import,

261
00:11:33.740 --> 00:11:36.743
matplotlib dot pie plot as plt.

262
00:11:37.610 --> 00:11:40.240
Note that here we are creating the pie chart

263
00:11:40.240 --> 00:11:41.790
and assigning it to a variable,

264
00:11:41.790 --> 00:11:46.090
but then we're calling plt dot show and not figure dot show.

265
00:11:46.090 --> 00:11:48.100
Again that is because if we call figure dot show

266
00:11:48.100 --> 00:11:50.200
that is not going to display a window.

267
00:11:50.200 --> 00:11:52.780
That is going to assume that we are displaying the figure

268
00:11:52.780 --> 00:11:55.710
in some other window already existing.

269
00:11:55.710 --> 00:11:57.350
So we have to call plt dot show

270
00:11:57.350 --> 00:12:01.190
and that is going to use the figure that was created here.

271
00:12:01.190 --> 00:12:04.280
So technically, we don't actually have to assign that

272
00:12:04.280 --> 00:12:07.120
to a variable if we don't want, but I think it's good form,

273
00:12:07.120 --> 00:12:09.910
and it will allow us to do some more configuration later on,

274
00:12:09.910 --> 00:12:12.260
or do things like save the figure to a file,

275
00:12:12.260 --> 00:12:15.570
if we wanted to do that instead, a bit more easily.

276
00:12:15.570 --> 00:12:17.570
Let me run this.

277
00:12:17.570 --> 00:12:20.713
And I'm gonna enter here, and I'm gonna select poll one.

278
00:12:21.670 --> 00:12:24.770
Oh, and we get an error here, the column is not correct.

279
00:12:24.770 --> 00:12:26.630
Let me go back to database dot py,

280
00:12:26.630 --> 00:12:28.580
and this should be called option text.

281
00:12:28.580 --> 00:12:30.300
And similarly down here.

282
00:12:30.300 --> 00:12:32.480
So let's run that again.

283
00:12:32.480 --> 00:12:35.240
We can enter option one here.

284
00:12:35.240 --> 00:12:37.650
And we've got ourselves another small error.

285
00:12:37.650 --> 00:12:40.730
Sum of votes should be sum of votes dot option ID,

286
00:12:40.730 --> 00:12:42.090
my apologies there.

287
00:12:42.090 --> 00:12:44.457
And now we've got it for sure.

288
00:12:44.457 --> 00:12:46.060
We can enter one there.

289
00:12:46.060 --> 00:12:48.030
And here we've got our figure.

290
00:12:48.030 --> 00:12:48.920
As you can see,

291
00:12:48.920 --> 00:12:51.380
at the moment we only have one vote in one of the options.

292
00:12:51.380 --> 00:12:53.320
So that's all that's coming back.

293
00:12:53.320 --> 00:12:54.380
But as we add more,

294
00:12:54.380 --> 00:12:56.833
we would get a better looking pie chart here.

295
00:12:57.710 --> 00:12:58.770
Later on in this section,

296
00:12:58.770 --> 00:13:01.040
we're going to learn how to save this to a file

297
00:13:01.040 --> 00:13:02.610
instead of simply displaying a window

298
00:13:02.610 --> 00:13:05.440
That is gonna make it a bit more useful, in case you want

299
00:13:05.440 --> 00:13:08.730
to produce the output for many different polls, for example.

300
00:13:08.730 --> 00:13:09.920
Or in case you want to allow

301
00:13:09.920 --> 00:13:12.470
the user to save the output somewhere.

302
00:13:12.470 --> 00:13:14.460
However, by showing this you can still save it

303
00:13:14.460 --> 00:13:16.770
just by clicking on this little Save icon there

304
00:13:16.770 --> 00:13:18.913
in the default figure viewer.

305
00:13:20.190 --> 00:13:21.900
Alright, that's everything for this video.

306
00:13:21.900 --> 00:13:23.020
Thank you guys for joining me.

307
00:13:23.020 --> 00:13:24.130
I hope you've learned something,

308
00:13:24.130 --> 00:13:25.833
and I'll see you in the next one.

