1
00:00:00,420 --> 00:00:05,370
Hello, dear friends, as you remember in our last lesson, we talked a little bit about data visualization

2
00:00:05,370 --> 00:00:07,560
and python with matplotlib.

3
00:00:08,490 --> 00:00:12,360
So this is the lesson that we're going to start to learn how to use matplotlib.

4
00:00:14,540 --> 00:00:19,610
So before we start, we're going to need to know what is pipeline?

5
00:00:21,800 --> 00:00:26,120
Have you ever heard of MATLAB, so MATLAB is a programming language.

6
00:00:26,540 --> 00:00:32,540
And mostly we can use MATLAB for statistics, mathematical operations, graphical operations and data

7
00:00:32,540 --> 00:00:33,440
visualization.

8
00:00:34,220 --> 00:00:37,850
It has too many functions for these operations.

9
00:00:38,810 --> 00:00:44,750
And of course, among all of these processes, data visualization is very important for our cause.

10
00:00:45,200 --> 00:00:51,890
So with the help of pipeline, we can work in Python and work just like in MATLAB.

11
00:00:52,670 --> 00:00:56,810
So each pipeline function makes some sort of change to a figure.

12
00:00:57,560 --> 00:01:02,240
For example, a function creates a figure plotting area and a figure plot.

13
00:01:02,240 --> 00:01:07,130
Some lines in a plotting area, decorates plot labels, et cetera, et cetera.

14
00:01:08,600 --> 00:01:14,240
So if you're ready to give it a shot, let's try to create a simple plot with Matt plot lib.

15
00:01:15,350 --> 00:01:18,380
So first off, we'll need to import our library and module.

16
00:01:19,410 --> 00:01:21,180
Import numbI as N.P..

17
00:01:25,450 --> 00:01:27,160
Import matplotlib.

18
00:01:27,400 --> 00:01:28,890
That pipeline.

19
00:01:31,950 --> 00:01:40,830
As penalty, also, we need to enter a magic statement for displaying our plant outputs inside the Jupiter

20
00:01:40,830 --> 00:01:45,060
notebook itself percentage matplotlib.

21
00:01:48,650 --> 00:01:49,340
In lie.

22
00:01:51,510 --> 00:01:59,370
Now we can create an incendiary object between one, Denine, using the arrange function from the numbI

23
00:01:59,370 --> 00:02:05,940
library and a X equals and P dot a range.

24
00:02:07,050 --> 00:02:08,970
One nine.

25
00:02:10,120 --> 00:02:14,770
So our variable serves as values on the X axis of the graph.

26
00:02:15,610 --> 00:02:17,780
So now we need another variable for the Y axis.

27
00:02:17,800 --> 00:02:18,790
So let's define that.

28
00:02:19,630 --> 00:02:24,010
And a Y equals np a arrange.

29
00:02:25,520 --> 00:02:28,070
Three, 27, three.

30
00:02:30,310 --> 00:02:34,930
So our two dimensions, the X and Y axis are ready, so let's try to plot it.

31
00:02:35,950 --> 00:02:39,610
And with the help of the plot function, we can plot it very simply.

32
00:02:39,970 --> 00:02:42,010
PLDT dot plot.

33
00:02:43,330 --> 00:02:44,740
And a.

34
00:02:45,610 --> 00:02:49,300
X and a Y.

35
00:02:50,200 --> 00:02:51,460
And it prints it on the screen.

36
00:02:53,560 --> 00:02:54,900
And with help of the show method.

37
00:02:55,890 --> 00:03:02,790
We can start an event loop, so that'll look for all the currently active figure objects, and then

38
00:03:02,790 --> 00:03:07,980
it opens one or more interactive windows that will display our figure or figures.

39
00:03:08,790 --> 00:03:12,240
So here we'll use it just to show you the plot viewer.

40
00:03:13,440 --> 00:03:14,850
Polka dots show.

41
00:03:16,470 --> 00:03:19,320
Great, so also we can change the graphs color.

42
00:03:19,830 --> 00:03:20,760
Let's give that a try.

43
00:03:21,420 --> 00:03:26,700
So here type orange and check the result and what happens?

44
00:03:27,540 --> 00:03:29,790
Our Plotts colors turn to orange.

45
00:03:30,960 --> 00:03:35,280
So also we can set the plot title and labels for the X and Y axes.

46
00:03:36,030 --> 00:03:36,660
Let's try that.

47
00:03:38,150 --> 00:03:40,070
P l t dot x label.

48
00:03:41,240 --> 00:03:42,500
And X.

49
00:03:45,850 --> 00:03:47,650
Patty, why label?

50
00:03:50,380 --> 00:03:51,160
And a Y.

51
00:03:56,430 --> 00:03:57,480
The leaked title.

52
00:03:59,250 --> 00:03:59,910
Lot.

53
00:04:01,170 --> 00:04:02,460
And the result is printed.

54
00:04:03,720 --> 00:04:04,800
Ildiko plant.

55
00:04:06,920 --> 00:04:07,880
And a X.

56
00:04:09,510 --> 00:04:10,770
In a Y.

57
00:04:11,950 --> 00:04:13,090
He Altena show.

58
00:04:15,280 --> 00:04:16,840
And the result gets printed.

59
00:04:20,980 --> 00:04:22,360
So let's try a few different things.

60
00:04:23,380 --> 00:04:32,230
For example, we can create an indie array object just by using Laon space as a function from numbI.

61
00:04:33,160 --> 00:04:37,270
Unless X equals and P dot Lynn space.

62
00:04:40,110 --> 00:04:42,240
Negative four for 50.

63
00:04:43,300 --> 00:04:45,490
So our X axis is ready.

64
00:04:45,910 --> 00:04:49,720
Now we need to create our Y axis, unless Y equals.

65
00:04:51,010 --> 00:04:54,980
Less X astros' asterisk to.

66
00:04:56,360 --> 00:04:58,490
All right, so now our X and Y axes are ready.

67
00:04:58,940 --> 00:05:00,350
So let's just go ahead and plot it.

68
00:05:01,220 --> 00:05:03,400
The old plot, l.

69
00:05:03,470 --> 00:05:04,310
S x.

70
00:05:06,450 --> 00:05:07,410
And that's why.

71
00:05:09,520 --> 00:05:10,870
He noted that show.

72
00:05:14,230 --> 00:05:17,800
And now, as you may remember, we can change the plot color.

73
00:05:18,840 --> 00:05:22,020
But also, we can use a symbol like dash or dot.

74
00:05:24,290 --> 00:05:25,520
Polka dot plot.

75
00:05:27,330 --> 00:05:28,280
Ellis X.

76
00:05:30,140 --> 00:05:31,070
Alice, why?

77
00:05:33,050 --> 00:05:33,530
Dot.

78
00:05:36,920 --> 00:05:38,090
Polls don't show.

79
00:05:42,920 --> 00:05:43,520
What do you think?

80
00:05:45,280 --> 00:05:46,600
So let's try it with a different color.

81
00:05:47,840 --> 00:05:48,890
Plotted out plot.

82
00:05:50,460 --> 00:05:51,410
Ellis X.

83
00:05:53,170 --> 00:05:54,160
Alice, why?

84
00:05:56,730 --> 00:05:57,420
Our dot.

85
00:05:59,660 --> 00:06:00,770
Peeled out show.

86
00:06:05,840 --> 00:06:07,430
And it prints it to the screen.

87
00:06:09,320 --> 00:06:13,490
So here I want to show you, this is a chart of usable symbols and colors.

88
00:06:18,580 --> 00:06:21,460
Now let's try to plant multiple plots.

89
00:06:22,450 --> 00:06:29,980
For example, plot our plots sine and cosine value with different colors and symbols on the same chart.

90
00:06:30,270 --> 00:06:30,430
Hmm.

91
00:06:30,550 --> 00:06:31,090
Are you ready?

92
00:06:32,920 --> 00:06:34,510
BLT dot plot.

93
00:06:36,150 --> 00:06:37,050
Tell us X.

94
00:06:39,110 --> 00:06:42,680
And did sign Ella's X.

95
00:06:46,100 --> 00:06:47,090
Our diet.

96
00:06:50,560 --> 00:06:52,210
He dot plot.

97
00:06:54,890 --> 00:06:58,370
Ellis X Airport costs.

98
00:07:02,140 --> 00:07:03,130
Let X.

99
00:07:05,540 --> 00:07:06,070
G.

100
00:07:06,710 --> 00:07:07,610
Double dash.

101
00:07:11,300 --> 00:07:12,590
BLT Dot Show.

102
00:07:15,060 --> 00:07:16,410
And bring it to the screen.

103
00:07:17,360 --> 00:07:17,930
What do you think?

104
00:07:17,960 --> 00:07:18,530
Pretty cool.

105
00:07:19,340 --> 00:07:19,970
So that's it.

106
00:07:21,820 --> 00:07:24,850
In this lesson, we learned how to use matplotlib.

107
00:07:25,330 --> 00:07:27,910
Go ahead, give that a whirl and I'll see you in the next lesson.

108
00:07:28,300 --> 00:07:29,080
Have a nice day.
