1
00:00:00,180 --> 00:00:03,990
So we have learned the first way on how to plot three dimensional data.

2
00:00:04,410 --> 00:00:07,560
But of course, we can also generate a real 3D plot.

3
00:00:08,340 --> 00:00:12,390
So for this, we just take the same arrays that we have to find here.

4
00:00:12,960 --> 00:00:19,440
So the X values to Y values and the corresponding Z values that we have plotted here in terms of their

5
00:00:19,440 --> 00:00:19,860
color.

6
00:00:20,430 --> 00:00:23,280
But now we're going to plot them by their actual height.

7
00:00:24,180 --> 00:00:29,790
And to do this, we must use these so-called Contour 3D plots.

8
00:00:30,870 --> 00:00:38,370
And this is a bit tricky, I would say, because I mean, our PC screen is, of course, two dimensional

9
00:00:38,370 --> 00:00:40,980
and we want to plot it in three dimensions.

10
00:00:41,430 --> 00:00:47,820
So we need some kind of projection and some viewpoints, and this is exactly is exactly what we are

11
00:00:47,820 --> 00:00:48,780
going to do first.

12
00:00:49,290 --> 00:00:53,460
We will have to define the commands called Peltier.

13
00:00:53,940 --> 00:00:57,330
So it's again enough plot lib commands and then axes.

14
00:00:58,770 --> 00:00:59,790
Projection

15
00:01:02,040 --> 00:01:03,120
is 3D.

16
00:01:03,510 --> 00:01:06,000
So this enables us to do 3D plots.

17
00:01:07,050 --> 00:01:09,880
And now I must give this one also a name.

18
00:01:09,900 --> 00:01:11,520
So this will be our 3D plot.

19
00:01:12,070 --> 00:01:14,790
So, yeah, I don't know.

20
00:01:14,790 --> 00:01:16,080
Maybe it's called it's.

21
00:01:18,210 --> 00:01:18,630
Lots.

22
00:01:20,880 --> 00:01:27,840
Or projection, maybe a bit a bad name, but yeah, it doesn't really matter what we call it, just

23
00:01:27,840 --> 00:01:28,590
have to remember.

24
00:01:29,070 --> 00:01:33,990
And then we just write plot projection.

25
00:01:35,530 --> 00:01:40,450
Don't contour 3D at now, here comes the actual plot.

26
00:01:40,960 --> 00:01:44,830
So I mean, you probably guessed already what's going to come next?

27
00:01:44,980 --> 00:01:53,650
The X components, the Y components, because the components, then we need some kind of know quality.

28
00:01:53,650 --> 00:01:54,160
No.

29
00:01:54,460 --> 00:01:58,270
And then we can also provide some color map.

30
00:01:59,280 --> 00:02:02,170
And for example, we could use binary.

31
00:02:04,430 --> 00:02:15,120
And this will be a plot, so you can also control the viewpoint by writing down lots of projection,

32
00:02:15,140 --> 00:02:23,870
which is our name, and then the option will leave you in it and you can then provide the vector from

33
00:02:23,870 --> 00:02:25,050
which you are watching.

34
00:02:25,070 --> 00:02:27,920
For example, I tested this one, so now it looks a bit different.

35
00:02:29,230 --> 00:02:32,310
I told you that this number controls the quality of the plots.

36
00:02:32,310 --> 00:02:38,420
So for example, if you decrease it, you see basically we just add some lines here, and if we just

37
00:02:38,420 --> 00:02:40,610
have 10 and we just have 10 lines.

38
00:02:41,090 --> 00:02:45,190
And so, yeah, these are basically these lines.

39
00:02:45,200 --> 00:02:48,430
And you can also see here it's a one to one correspondence.

40
00:02:48,440 --> 00:02:52,100
So we just have one that just looks like this.

41
00:02:53,750 --> 00:02:59,150
So obviously, the more lines we have to smooth out the plot looks, but also the longer it takes to

42
00:02:59,150 --> 00:03:07,880
calculate it and the higher the storage capacity or the memory will be than for a simple binary like

43
00:03:07,880 --> 00:03:09,750
you check what happens if we do it like this.

44
00:03:10,280 --> 00:03:12,200
So then we get this colorful plot.

45
00:03:12,440 --> 00:03:18,110
Maybe you like this better, but here you can provide a color map and you can Google.

46
00:03:18,110 --> 00:03:22,040
The different color maps binary would be a black and white method.

47
00:03:23,540 --> 00:03:28,100
All right, so we have now plotted this data in a three dimensional fashion.

48
00:03:29,150 --> 00:03:35,810
Now, of course, we can also do is just to make some line and scatter plots, as we have done before,

49
00:03:35,810 --> 00:03:36,740
in two dimensions.

50
00:03:37,910 --> 00:03:39,740
So let me show you how this works.

51
00:03:39,860 --> 00:03:44,150
It's, of course, pretty similar, but this will be the last example for the plotting that I'm going

52
00:03:44,150 --> 00:03:44,750
to show you.

53
00:03:45,830 --> 00:03:50,250
So since it's pretty similar to the last one, let me just go straight ahead.

54
00:03:50,270 --> 00:03:52,820
I write T dot axes.

55
00:03:53,120 --> 00:04:01,430
Once again, projection is 3D to enable the three dimensional plotting and this one, maybe I come up

56
00:04:01,430 --> 00:04:02,180
with a better name.

57
00:04:02,180 --> 00:04:03,620
Peltier three.

58
00:04:05,480 --> 00:04:18,110
And all right, so now what we can do is we can we have to specify new values and maybe just go ahead

59
00:04:18,110 --> 00:04:19,880
and show you what I have in mind here.

60
00:04:20,540 --> 00:04:26,480
So this time I will start with the Z coordinate, which may look a bit unusual, but you hopefully will

61
00:04:26,480 --> 00:04:28,060
see soon why I do this.

62
00:04:28,070 --> 00:04:32,200
So in 3D, all the dimensions are have the same rights.

63
00:04:32,200 --> 00:04:36,200
So to say so you don't have to define first X and Y and calculate Z.

64
00:04:36,620 --> 00:04:41,570
You can also first define Z and then calculate X and Y, for example.

65
00:04:41,750 --> 00:04:43,130
And this is what we're going to do here.

66
00:04:44,240 --> 00:04:46,820
So once again, we have to define sound in space.

67
00:04:48,410 --> 00:04:49,880
Some are basically.

68
00:04:50,420 --> 00:04:52,550
And I go from zero to 30.

69
00:04:52,550 --> 00:04:53,710
I tested this before.

70
00:04:53,720 --> 00:04:54,680
That works quite well.

71
00:04:55,070 --> 00:04:59,690
And I use 301 points then from here.

72
00:04:59,850 --> 00:05:06,470
So so this is basically just a list which goes from zero down to zero point one zero point two until

73
00:05:06,470 --> 00:05:07,480
it reaches 30.

74
00:05:09,110 --> 00:05:14,180
Now from here, I calculate the X coordinate and the Y coordinate.

75
00:05:14,810 --> 00:05:15,830
Sorry, like this.

76
00:05:17,240 --> 00:05:20,600
So the X coordinate will just be a sign function

77
00:05:23,210 --> 00:05:26,270
and the Y coordinate will be a cosine function.

78
00:05:30,480 --> 00:05:33,450
So you see, this one is something like a circle.

79
00:05:33,990 --> 00:05:37,860
But at the same time, the C coordinate that will increase linearly.

80
00:05:38,910 --> 00:05:45,030
So if we can do now is we can write Patti 3D, which is our name from the for the plot.

81
00:05:45,570 --> 00:05:50,830
And then just as previously we write or we wrote Contour 3D.

82
00:05:50,850 --> 00:06:00,360
This time we write Plot 3D, and now we have to provide the lists for the variables.

83
00:06:00,900 --> 00:06:03,480
But here we have to make sure to give them in the right order.

84
00:06:04,110 --> 00:06:08,520
Otherwise, yeah, we will project in a different way.

85
00:06:09,390 --> 00:06:14,970
So you see, we have to circle in the X Y plane, but in the Z direction, we have a linear dependence,

86
00:06:15,150 --> 00:06:17,100
so we get this type of spiral.

87
00:06:18,300 --> 00:06:20,850
So now we can play a bit with the data.

88
00:06:21,150 --> 00:06:28,140
For example, I told you what happens if we choose the wrong order, then our spiral will go along to

89
00:06:28,140 --> 00:06:29,400
different direction, of course.

90
00:06:30,090 --> 00:06:31,710
So it's also possible.

91
00:06:32,130 --> 00:06:35,940
What do you have to be careful to really get the correct thing that you want to get?

92
00:06:37,020 --> 00:06:41,130
And we can also scale this, for example, to make it not a circle, but an ellipse.

93
00:06:42,210 --> 00:06:46,860
So like this, and you see it still looks like a circle.

94
00:06:46,860 --> 00:06:51,960
But when you look at the axes, this axis goes from minus one to one, and this from from minus two

95
00:06:51,960 --> 00:06:52,530
to two.

96
00:06:52,950 --> 00:06:55,470
Still, in the plots, they have the same length.

97
00:06:56,340 --> 00:07:03,330
So if you want to make them really their actual length, you have to explicitly define the limits of

98
00:07:03,330 --> 00:07:03,750
the plot.

99
00:07:04,620 --> 00:07:15,720
So this you can do by writing down plots, dots x limb and then also plot toward the y limb.

100
00:07:17,580 --> 00:07:21,420
And now we must provide the same numbers here, and I take two.

101
00:07:24,060 --> 00:07:31,980
Now you see, it's an ellipse, so there's oval shape instead of the round circular shape that we have

102
00:07:31,980 --> 00:07:32,430
before.

103
00:07:34,350 --> 00:07:37,380
So now let me show you another thing that's possible.

104
00:07:37,470 --> 00:07:38,640
Let me just copy this.

105
00:07:39,150 --> 00:07:44,010
And this time, instead of using plot three d, we use Scatter 3D.

106
00:07:44,220 --> 00:07:49,350
So this is really the same thing as we did in two dimensions, but this one gave us a smooth line as

107
00:07:49,350 --> 00:07:49,650
here.

108
00:07:50,070 --> 00:07:52,260
And this one gave us individual data points.

109
00:07:53,670 --> 00:08:01,410
So here you see all of these points, and especially if I decrease the number or the range, and you

110
00:08:01,410 --> 00:08:08,160
will see that it's not actual smooth, but they are really individual points that you can plot.

111
00:08:08,880 --> 00:08:13,980
And as always, you can combine several plots so you could combine this one and this one.

112
00:08:15,380 --> 00:08:15,860
All right.

113
00:08:16,340 --> 00:08:23,750
So in our plotting lecture, we have started from two dimensional data where we have created a scatterplot

114
00:08:23,750 --> 00:08:25,400
which are individual data points.

115
00:08:25,880 --> 00:08:31,700
Then we have created these line plots, which you can do by writing down field dot plots.

116
00:08:32,480 --> 00:08:37,669
Then we have come to three dimensional data, which you can visualize using density or contour plots,

117
00:08:38,059 --> 00:08:42,799
where the third dimension is basically encoded by the color as hero here.

118
00:08:43,370 --> 00:08:48,530
Or you can go to real three dimensional plots where you have such a surface three dimensional space.

119
00:08:49,340 --> 00:08:56,660
Or you can even have some like parametric plots where you have a line or even individual data points

120
00:08:56,660 --> 00:08:58,100
in three dimensional space.

