WEBVTT

00:01.060 --> 00:04.960
All rights on the last video we created a line plot for our each column.

00:05.170 --> 00:08.440
And now in this video we want to customize our plots here.

00:08.440 --> 00:14.430
So for example we will add a title and also labels for our x and y axis.

00:14.590 --> 00:19.750
And we will also learn how to change the line style and the color of our graph.

00:20.570 --> 00:28.540
So now let's first of all let's plot again your outline plot so with no customizations at all.

00:29.780 --> 00:37.190
And we can actually see that the font size of our x axis and the y axis is quite smaller and therefore

00:37.190 --> 00:41.850
there's another pair of meta here and two parameters called font size.

00:41.850 --> 00:49.490
So let's try this out here and here we can actually find the font size for our X ticks and the Y takes

00:49.490 --> 00:54.310
here and let's try for example 13.

00:54.380 --> 01:00.920
So now here we can see that we have increased fund sizes and we can further increase to the fund size

01:00.950 --> 01:08.450
by passing a greater number like sign between the year and we have even larger font sizes so let's go

01:08.450 --> 01:17.990
back to a 13 and we can see that our line plot has kind of a blue color but we can also define the color

01:17.990 --> 01:23.450
here with the parameter C and we can pass our desired color.

01:23.480 --> 01:32.810
So for example we could pass here red and it's also possible to only pass here are four red so feel

01:32.810 --> 01:37.190
free to have a look at the documentation of what colors are provided here.

01:37.190 --> 01:39.150
So now we will use here.

01:39.290 --> 01:43.660
The red color and we can also customize the line style.

01:43.660 --> 01:46.470
So that's the distant parameter line style.

01:50.580 --> 01:55.200
And by default except set to a single desk here.

01:55.710 --> 01:58.400
But we can also create a dest line.

01:58.410 --> 02:00.030
So with two dashes

02:02.670 --> 02:12.040
now we can see a kind of a dash to style and we can also create a dot style by passing near a colon.

02:12.200 --> 02:19.300
Now we have dotted lines and also here feel free to have a look at the documentation what different

02:19.410 --> 02:22.330
lines diets the map problem provides here.

02:22.340 --> 02:30.200
So let's go back here to these single dash and now we can also create a title for our graph or plot

02:30.470 --> 02:34.940
and we can do this with the function or method puta you dot tighter.

02:35.750 --> 02:42.290
And uh within the brackets here we have to define the title of our graph then quotation marks.

02:42.320 --> 02:46.510
So it took B Titanic ages and then death.

02:46.590 --> 02:52.820
In addition apparently the font size where we can define the font size and you for the type of the font

02:52.820 --> 02:57.910
size would be a bit larger than the font size of the X ticks and Y ticks.

02:57.950 --> 02:59.410
So let's run here.

02:59.460 --> 03:01.350
So a..

03:01.400 --> 03:03.950
Our title Titanic ages.

03:03.950 --> 03:07.250
Next we can also create a legend for our graph.

03:07.430 --> 03:11.340
And in particular this makes sense if we plot t several columns.

03:11.350 --> 03:16.750
So let's assume we plotted the H column and the fact column then we should test a letter from T as somewhere

03:16.760 --> 03:18.000
saying that OK.

03:18.110 --> 03:25.460
The red line is the H column and for example the blue line is that the Fair column and we can create

03:25.490 --> 03:34.500
a let's end with the method to appear to dot legend and if we can define also the font size and also

03:34.530 --> 03:36.320
the location of the letter and.

03:36.350 --> 03:42.570
But first of all let's run here and here we can see on the upper right that the letter and AIDS.

03:42.780 --> 03:49.130
So the red line is that the H sexually and if you will test here another line for example for the fat

03:49.120 --> 03:55.500
column we would test fear red for the H column and blue for the fat column and we can also define the

03:55.500 --> 03:56.300
location.

03:56.310 --> 04:04.600
So let's go here inside the records and there are some other locations that we can choose.

04:04.620 --> 04:12.480
So for example you can choose the the location best or the row so we can pass the 0 0 best within quotation

04:12.480 --> 04:13.230
marks.

04:13.230 --> 04:20.160
Then depending on the graph metropolis clip locates the legend at the best possible place but we can

04:20.160 --> 04:26.700
also define upper right upper left the lower left and so on and instead of passing near the strings

04:26.730 --> 04:28.710
we can also pass that the codes.

04:28.710 --> 04:34.910
So for example let's assume that we want to place the legend here on the lower left side.

04:35.080 --> 04:39.480
You can either pass the string lower left or three so let's pass a three

04:43.390 --> 04:44.330
and now we have TV.

04:44.340 --> 04:51.780
Let's end on the lower left location and with the font size again we can also change here the font size

04:51.790 --> 04:53.280
for example to 28.

04:53.580 --> 05:03.040
So we can make it larger but let's stay here at 15 and we can also create labels for our expects this

05:03.040 --> 05:11.250
and Y axis then we can do this with the functions that appear to top X label NPR t top the Y label and

05:11.340 --> 05:16.500
we have to pass within the brackets the labels that quotation marks that we want to have.

05:16.500 --> 05:22.560
So for example here for our exact science we want to have for the peasants a number and for our y axis

05:22.560 --> 05:24.180
we want to F H.

05:24.300 --> 05:29.350
And again here we can define the font size so let's do this here

05:32.040 --> 05:40.100
now we have fear the X Labor passenger number and the vile label AIDS and we can also create a grid

05:40.100 --> 05:45.760
here with uh the thanks and purity dot grid.

05:45.810 --> 05:48.470
Next we can also define the limits of our access.

05:48.500 --> 05:57.060
So here by default we f on the x axis the limits between zero and nine hundred and on the y axis between

05:57.090 --> 05:58.460
zero and 80.

05:58.770 --> 06:06.070
But we can also change this here and that's press shift tab so here we can see that the parameters X

06:06.070 --> 06:15.170
slim and y line and here for both power meters you have to pass a topper with the lower and the upper

06:15.170 --> 06:15.680
value.

06:15.690 --> 06:22.680
So for example let's assume that we are only interested in the peasants of numbers between 200 and 400.

06:22.790 --> 06:32.210
Then we can pass here to the pyramid X Len a topper from 200 to 400.

06:32.690 --> 06:38.710
So let's run this a and give you only half on the x axis.

06:38.720 --> 06:41.940
The peasant just between 200 and 400.

06:42.080 --> 06:47.650
And as you can see he had some blanks blank so these are the missing values in the H column.

06:47.690 --> 06:53.280
So here we have a break everywhere where we have a peasant where we do not know the H.

06:53.510 --> 07:03.550
And we can also limit or customize our y axis with the wild and pair of meta and that's assume we are

07:03.580 --> 07:07.970
only interested in peasants just between the age 20 year until 40

07:12.110 --> 07:20.240
so in all it's from near and here we limited our y axis from 20 to 40.

07:20.340 --> 07:26.010
So let's go back here on the sexes from 0 to 900

07:30.560 --> 07:33.340
and on the y axis from 0 to 80

07:38.890 --> 07:47.800
and we can see on the x axis we have X takes 100 200 300 400 and so on but we can also customize this

07:47.830 --> 07:54.690
and let's assume that we want to f ranges of only 50 so 50 100 150 200.

07:54.700 --> 07:55.840
And so on.

07:55.840 --> 08:04.030
And that's also the pair meet X ticks and Y ticks and t we can define the ticks that we want to have.

08:04.030 --> 08:05.500
So let's have a look here

08:09.590 --> 08:16.730
so you have X ticks and Y ticks and we have to pass a sequence of example a list with values that we

08:16.730 --> 08:26.270
want to use for the X ticks and Y ticks and now let's assume that for the x axis you want to f x ticks

08:26.270 --> 08:34.730
from 0 to 900 and we want to have a tick for each 50 passengers so we want to have 50 100 150 and for

08:34.730 --> 08:41.510
the age you want to have the ticks 5 10 15 20 until 80 and we can do this by creating two sequences

08:41.510 --> 08:51.690
or two lists so yeah we can create a list for the X ticks and Father range between 0 and 900 including

08:52.430 --> 08:58.970
you create a list of values with these stepper 50 or so lets that run near and let's have a look.

08:58.980 --> 09:06.700
So here we have a list starting from 0 to 900 and we have a step of 50 50 100 150.

09:07.240 --> 09:15.620
And the same we can do for divide ticks so we are creating here a list from 0 to 80 including and this

09:15.630 --> 09:16.950
a step off 5.

09:18.090 --> 09:25.200
So let's run here and here we have the list of 0 5 10 15 20 until 80.

09:25.390 --> 09:36.610
And now we can pass both lists to the parameters X takes center y ticks so we have here the paramount

09:36.980 --> 09:37.510
exec

09:40.910 --> 09:49.510
and TV parts of the list execs and we have the pyramid divide takes interior parts of the list.

09:49.500 --> 09:52.870
Why it takes and it's wrong.

09:52.980 --> 09:53.360
So

09:57.830 --> 10:02.380
A.B. can see our customized X and Y layabouts.

10:02.600 --> 10:09.500
And we can also see that the grid actually automatically adjusts so we have here the grids for all the

10:09.500 --> 10:16.380
ticks here actually and here we can see on the x axis if we have many ticks it might be more convenient

10:16.380 --> 10:22.200
to rotate the ticks a little bit to have your mass base and we can do this with another parameter.

10:22.230 --> 10:24.230
So let's check this out here.

10:26.540 --> 10:33.680
And if you're the perimeter road and here we can define for example that we want to rotate our ticks

10:33.770 --> 10:35.450
by 90 degrees

10:39.210 --> 10:45.870
a. if our X ticks rotate rotated by 90 degrees and we could also defined that we want to rotate them

10:45.870 --> 10:47.160
by 45 degrees.

10:47.160 --> 10:48.780
So this is flexible.

10:49.830 --> 10:55.890
So here we have 45 degrees and actually now we are finished with the customization.

10:56.130 --> 10:58.060
However that's one more option.

10:58.140 --> 11:04.620
And actually we can completely change the whole style of our graph and we can do this service to the

11:04.620 --> 11:07.100
method POTUS style that you use.

11:07.110 --> 11:10.630
But before we can also have a look that's different styles.

11:10.690 --> 11:21.930
Matt clip provides us and we can do this here with Peter T dot style the top available and we can see

11:22.110 --> 11:23.410
several styles.

11:23.490 --> 11:29.640
So we have the classic style than t t plot from the r programming language.

11:29.640 --> 11:33.390
Then we have Grace Dale and we have several Seabourn styles.

11:33.390 --> 11:37.790
And once we have chosen a style we can also set now a new style.

11:37.830 --> 11:42.080
And we can do this with the P.A. dot style Dot.

11:42.090 --> 11:46.830
Use and Uber can pass within the brackets.

11:46.830 --> 11:55.290
Our style that we want to have and for example let's choose the Seabourn style.

11:55.390 --> 12:03.530
Now let's from the set here and now let's rerun our graph here and graph it automatically be transferred

12:03.550 --> 12:07.890
to the Seabourn style of a..

12:07.900 --> 12:13.600
The Seabourn style and by default actually the Seabourn style has also grids.

12:13.690 --> 12:19.010
But by calling here the grid function or method we actually remove the grids.

12:19.120 --> 12:24.790
So let's this a bit the grid function and here we can see our Seabourn style.

12:25.510 --> 12:30.100
And we can also change the style for example to a classic

12:40.440 --> 12:42.230
and we have a classic style.

12:42.670 --> 12:47.360
So the options to customize a plot and plop plop are actually unlimited.

12:47.530 --> 12:51.060
And if you like you can never look at the documentation side.

12:51.250 --> 12:53.320
But for the time being we are now finished.

12:53.320 --> 12:56.080
And I hope to see you also in the next studio by.
