Hey everybody, I'm Taylor Sparks again and this is video 3 on how to make beautiful figures using Python.
The first video was the basics of what are good figures vs bad figures.
The second video was the basics of using Python to make fundamental, simple figures.
This third video is the more advanced class on more challenging figures.
So, we're going to show you how to make figures that look kind of like these ones.
Three dimensional plots.
How about this one where you do fill-betweens with lots of different data sets.
This is just a generic figure we'll show you how to start with.
Heatmaps.
We'll talk about multi-panel plots.
Figures with multiple axes.
So, the regular y-axis and then separate y-axis with the same x-axis.
Rietveld refinement using diffraction data.
So, these are some of the things we're going to dive into.
Let's start with the simplest which is just a generic figure.
This is the one that I go to whenever I'm plotting anything.
I just pull open this file and this is where I start with.
So, when we look at it, this code is already here.
We're not going to type the code out together.
Instead, we're just going to go chunk by chunk through it and talk about what the chunks are doing.
So, we're going to grab the libraries and you've seen this before.
The only thing that we haven't talked about yet is the Seaborn library as SNS.
That's going to give us colors, right?
So, that's what that is.
We're going to grab our data.
So, the data is stored in the generic single plot.csv.
This is available so you can follow along if you want to.
You can pull this up and try it for yourself.
We're going to do that with pandas.
We're going to read in that CSV into a data frame.
Once we've got that data frame, that allows us to grab the different data sets.
X and Y, X2, Y2, X3, Y3, based off of the labels of those columns in that data frame.
So, we've grabbed our data.
Now, let's go ahead and grab some colors, right?
I love the Seaborn rocket palette.
I think these look great.
Since we're dealing with three different data sets,
I'm going to go to the rocket palette and ask it to give me three colors.
So, along the continuous color string there, it's going to give us three.
One from the end, one from the middle.
If you wanted to, you could define your own colors.
My postdoc advisor had this really great collection of colors that honestly look really good.
Here's their hex numbers.
You can actually use those.
I store them into a string so I could access the 0th index, the 1st, the 2nd, the 3rd,
if I wanted to pull these colors out.
They look really good too.
Let's go ahead and make our plot.
You've seen this before.
Fig equals plt.figure.
We're going to give it a fig size.
We love square plots, so a nice 5x5 inch canvas to start with.
Now, on this, we're going to do semi-log plots.
So, semi-log, that means it's going to be logarithmic along the x-axis,
but linear along the y.
So, we're going to go ahead and plot our three different data sets.
Here, we're plotting them with lines.
We're doing markers that are different.
Triangles, squares, and circles.
We're giving them labels.
We are assigning them different colors from the rocket palette.
We're making the inner colors white.
Marker fill color is white.
And we're giving them a size.
So, great.
Let's go ahead and run this just as it is this far.
So, we're going to hit F9 on that section,
and let's see how the plot looks.
If that's all you do, it's not terrible, but we could do more.
It needs a legend.
I like the tick marks to be pointing in, right?
Pointing in towards the plot from the top and bottom of the sides
and not pointing out.
And then we need to add some labels and maybe mess with these a little bit.
Like, I don't know if I like how it automatically chose the limits,
so we can manually do all of that.
Let's start with the ticks.
We want it to go, the limits, we want it to plot from 1 to 10,000 on the x-axis.
That's going to stretch it out a little bit more.
And then on the y, we want it to go from negative one-half up to 16.
Okay?
Now, where do we want the ticks?
You notice that by default, it puts them on the bottom and the left,
but it didn't put them on the top or the right-hand side.
Well, we can change that.
We can manually say, all right, point them in,
and on the right-hand, have it set equal to true,
and the top set equal to true.
That's going to put ticks all the way around, right?
We can change the label size, right?
So make sure that this is all 14.
We can, yeah, so this is going to look good.
And then we can put the label.
We can choose where we want these labels.
Right now, you notice that the x label is labeled on the bottom,
but if you wanted to, you could put the bottom and the top.
I don't think you should.
And if you wanted to, you could have it left and the right.
I don't think you should.
So we're just going to explicitly say
that we only want it true on the bottom and true on the left.
We don't want labels.
We just want ticks, but not labels on the top and right.
So we can set that.
Now, where do we want the ticks to occur?
Right now, by default, it's putting them every two, right?
What if that's too crowded for you?
Like, for example, this separation between major tick marks is pretty big.
What if we skipped a couple, right?
What if we did every four?
Well, we can do that.
We're going to come over here.
We're going to do y ticks is equal to numpy of A range.
So remember, that creates a list of values
from the start to the stop, not inclusive.
So it's going to start at zero.
It will not include 16.1.
It will go up to it.
And it's going to go every four,
so it's going to give us ticks at 0, 4, 12, 16.
So that's going to give us a list that we're going to use as our ticks
instead of the default thing that it chose to do.
We can tell it more info about the ticks.
We can make sure that they're both pointing in,
both the minor and the major ticks.
We can make the major ticks 10 long and the minor 5.
These are really small, the default values.
Those are kind of hard to see.
We're going to make those a little bit bigger.
So let's just with this portion of it,
let's go ahead and run it again from the beginning
and see how it changes things.
When I run it now, you see, great, right?
We've got ticks going all the way around on all four sides of it.
They're big enough that they're easy to see.
This only now goes in increments of 4, which is better.
And this goes from 1 all the way to 10,000.
It's better, I think.
So you can manually fit that to whatever you want it to be,
but that's what I've got so far.
Now the last thing we need to do
is go ahead and put labels on the X and the Y axes.
So for our X, we're going to label it particle radii,
and it needs to be micrometers.
So I'm going to turn on math font using the dollar signs
and write backslash mu.
That's going to give us the micro symbol
and then give us a Y label
and then tell it to plot a legend.
So as simple as that, let's go ahead and run the whole thing now.
And you can see that we are able to generate
with this generic plotting file a lot of really great stuff
and control it exactly how we want.
And it looks terrific.
Last thing we did was plt.savefig.
It's going to save it in the data for exercises folder
within another folder called plotting.
It's going to call this generic plot.
Now there's other things here.
We can set the resolution.
I do dpi equals 300 and bbox underscore inches equals tight.
That makes sure that it crops it just to where there's content
and it gives it high resolution
so you can use this in a figure for a paper.
And that is what produces this beautiful figure
which is now ready for action.
Notice that it did the Greek letters and everything.
So there's really nothing left to touch up on that.
Let's move to our next one.
On this one, we're going to show you how to do a plot
where it fills in between the different lines.
So this is the one that created this figure.
It's the one where we're showing
how resource production changes over time.
As you go from 1998 to 2015,
these different countries produced different amounts.
So how do you produce this?
We're going to start with the libraries, matplotlib and seaborn,
just colors and the ability to plot.
We don't need pandas or anything
because my student actually didn't know how to use pandas
and they brought in the data by hand, which is painful.
This is why we learned how to do Python
so you don't have to do that.
But they've got it so we're going to use it.
So we're going to create our figure,
nice 5 by 5 square figure.
Then over here, we have a list of all 22 countries
that were in the list.
In the order in which we're going to plot them.
So here's all of our countries.
Now, we grab colors.
This time, I'm not going to use the rocket palette.
I'm going to use seaborn.
But from seaborn, I'm going to grab the cube helix palette.
From that cube helix,
that's the one that goes from this nice greenish through blue.
You can change it.
For example, I've got mine starting at 0.5 for the start point.
It goes through different bands of color.
If I change that, you see now it goes from this teal through a purple.
So toy around with this and figure out which one you like.
I think it's good to start at 0.5
with a rotation of negative 3 quarters.
Just plug in different numbers here.
You can read more about it at seaborn,
but I think it makes a nice palette.
The point is we want 22 different colors, sequential,
to represent these different countries.
And the main ones we care about are the DRC and Zambia.
We grab a list of all the years over which we're going to plot,
which is 1998 all the way up to 2015.
And then each one of these, Y1 all the way down to Y22,
represent the annual production of cobalt
by these different countries.
So Y1 would be the Democratic Republic of Congo's
production of cobalt for all these years.
The next one would be Australia's production,
and Botswana's, and so on and so forth.
So to create this plot where we fill between them,
we're going to do what's called a stack plot.
So PLT, that's pie plot,
and we're going to do the stack plot function.
We have to give it the X value, which is the year.
That's what we want on our X axis.
And then we send it all the different Y values
that we want to be stacked between them with colors.
And then we send it the labels,
which is the string of countries.
It has to be the same size as these that we've given it.
And then the colors, it has to be the same size
of all the countries as well.
That's it. That's pretty simple, right?
Then we just tell it the limits, plot it from 1998 to 2015,
from 0 to 100 on the Y axis, give it some labels,
and it's as simple as that.
That's what produces this.
One thing to be...
You'll notice that I've got Zambia written here,
and I've got the Democratic Republic of Congo here,
and I've got this vertical line and this thing rotated.
How do you add that stuff?
That's pretty easy to do.
So to add the vertical line,
we do it with the PLT.AXV line.
So that's going to put a vertical line
at some X location.
So it only wants the X location.
We're going to say at X equals 2003.
That's when the war ended.
We want it to be a dotted line.
I think it makes it clear.
And then black color.
Great.
You could change other things.
You want to change the thickness or whatever else,
you could change it right in here.
Here I wanted to label the Democratic Republic of Congo,
so I went to 2010, 2006 and 10.
So it goes to the year 2006,
and then it goes up to 10,
and it starts to label this here.
Notice that I put this slash N,
and that forced it to do a second row.
Instead of having this dangle off the map,
off the plot, it makes a second row.
Zambia, we change the color to white,
and we set it up here by plotting at 1999 and 92.
So 1999, 92, and it plots it up there.
And then this end of the Congo War,
we were able to type that using this rotation equals 90.
That rotated it 90 degrees up,
so we got this nice rotated text.
Then take a look at the legend.
The legend was a little bit gnarlier.
There was 22 different data sets,
so we had to shrink it a little bit smaller so it would fit.
And then you'll notice that Democratic Republic of Congo
was actually our first data point,
but we want it to match the colors on this plot,
which is dark purple going towards lighter.
If we didn't reverse this legend order,
it would be light going dark going down,
so we don't want that.
So we can reverse it.
We do that by grabbing the handles and the labels, right?
The handle is like this little block of color,
and then the label is the one going with it.
We're going to grab those from the current legends.
We're going to go plt.gca,
and then get legend handles and labels.
That's going to grab those and store them into these two things.
It's a tuple, so it unpacks those into these two different variables.
And then we're going to use those.
When we plot our legend, we're going to say,
take this list and reverse it, reverse the handles,
and take this list and reverse it, reverse the labels.
And then we're telling it to plot it outside of the plot.
We're using this bbox to anchor command.
That allows it to plot it outside of the figure,
which we want to do because we didn't want to cover all this up.
That would be maybe not the right choice here.
And again, I think that that's a little bit small.
I think there's probably still things we could work on
with this figure to make it more legible,
but not a bad start.
That's how you do this fill-between function.
Let's go to our next one.
Let's talk about how you make multi-panel plots.
When I'm going to run this,
we want to eventually be able to make a plot that looks like this.
Maybe it has one set of data here,
another one over here, and another one down there.
How do you do this?
Let's start with the libraries.
We're going to grab the same stuff as before, but a couple new things.
We're going to grab GridSpec.
And then Matplotlib itself.
We're going to grab that so that we can change some things here.
Right here, this first line, two lines of code,
I put that in tons of my figures.
What it does is it changes the font size universally.
The RC parameters, this is a dictionary entry.
This is the keyword for the dictionary,
and this is going to be the value.
We're setting the value in that dictionary
for all the font size to be 14.
That's just going to make the general font size to be 14
unless we say otherwise.
We're going to do PDF font type 42.
That allows us to, if we want to, open this in Illustrator.
We can save it as a PDF and then open it in Illustrator
and modify it if you wanted to move things around by hand.
Let's go ahead and grab our data.
This is spectroscopy data for electrochromics.
Electrochromics are cool in that they change color
when you apply voltage to them.
We're going to see a change in transparency
as a function of wavelength when you have it on versus off.
You have one data set over here for when it's on
and one for when it's off.
First off, you see that there's these three panels.
I'm going to go ahead and delete it so it's just two panels first.
Then we'll add it back in in a moment.
I'm going to delete out one of those panels.
Let's say we started out with just a two-panel plot,
but you decided...
First off, how do you make this two-panel plot?
Then, how would you add that third panel that you saw before?
Let's go through the steps.
We grab our data.
On this one, it's kind of interesting.
If you actually grab all of the data from it,
it's actually really, really dense with data.
This is what it looks like.
These data points are right on top of each other.
Maybe you don't like that.
Maybe you like to be able to see the data points
and make it a little clearer.
You can actually down-sample your data
with this line of code here.
We're going to take the data frame,
which we just read in from our CSV,
and we're going to say that the data frame
is now equal to the data frame before,
but we're using the iloc,
and we're saying grab every 10th row,
grab the data point.
We're going to chop out every...
We're only going to keep one-tenth of the data.
If you do that, look how much it reduces this.
It makes it much more...
You can see that there's individual data points.
You'll want to make sure that you say in the text
that you did this so that they realize what you actually did.
It's always important to say what you did
if you modified your data in any way,
but I think this is fine.
You can say, like, look, the data was...
The data shown is actually down-sampled by one-tenth,
and they'll understand that.
I think it makes it a little bit clearer to see.
Okay?
We're going to grab the six different data sets, right?
Here's from 30, 60, and 90 when it's turned on,
and then 30, 60, and 90 when it was turned off,
so you can see that the transparency
as a function of wavelength changes.
Here, it's much more transparent.
Here, it's much less transparent.
So here's where we're grabbing those data sets.
Again, we're reading them, and we're doing drop na
so that we drop any empty columns or empty rows
as we read them.
I'm going to manually set the limits for the plots up top here.
I'm going to say that x-minimum and x-maximum
go from 400 to 800,
so it's plotting from 400 to 800 on both of these plots,
and from y, it's plotting from 60 to 120,
plotting from 60 to 120.
Okay?
Just like before, we're going to grab some nice colors.
You can use whatever you want to define yourself,
or you can have Seaborn produce some nice ones.
I'm going to use the rocket palette again,
but this time, since there's six data sets,
we're going to go ahead and ask for six colors
from the rocket palette,
and you see that it sequentially goes from this dark purple,
lighter, red, from red, it turns orange,
and it eventually turns pink,
so it's a nice sequential series.
I think it looks good.
Now we go ahead and prepare our multiple plot.
So we're going to do...
This looks just the same as before, this first line,
but here it gets different.
We're going to do gs="gridSpec.gridSpec 4x4",
so it's producing, instead of just one figure,
it's chopping that up into a grid
where you've got four rows and four columns
that we can create figures in in that sort of grid.
I'll show you how to do that in a moment.
And then it has this gs.update wspace and hspace.
That's width spacing and height spacing.
So, for example, you see right now
that there's this gap between these two figures.
We can change that with the width spacing.
What if we want it to be, like, a really, really big gap?
Let's put one there,
and it's going to put a big gap there, right?
So it'll really separate these.
Or if you wanted no gap at all, you could put zero,
and they'll just butt right up to each other,
and maybe you want that.
I tend to think that things look a little bit better
with, like, a small gap,
so I usually do, like, a 0.2 or 0.25,
and I think they look pretty good.
So you can clearly see it's two different sets of data,
but it's obvious that you only need this one label over here.
You don't need another label over here for this one
because they line up nicely, okay?
That's my opinion. Do what you want.
All right, let's generate this first panel over here, okay?
So when you do this, we have to create a subplot.
So xtr underscore subplot is equal to our figure,
which we created up here above,
and then figure has a function called add subplot
where it's going to create a subplot.
And then where is it going to create it?
It's going to create it using this grid spec, right?
Grid spec, the two numbers represent the rows and then the columns.
So we want it to occupy all four of the rows.
Remember, it's a 4x4 grid,
so we want it to use all four of these rows,
but we only want it to go from 0 to 2 on columns,
so it's only going to use half of our columns.
That's going to make this figure, okay?
Then you just plot your data.
We're going to do plt.plot.
Again, you've seen this before.
It's just the x, the y, it's whatever other values you want.
We're giving it markers, we're giving it colors,
you know, very straightforward.
You've seen this before.
We're going to give it ticks.
I do this a couple of ways.
By default, this will create ticks
from 0 until the maximum that you want it to go up to,
divided by 4, so it'll do 4 ticks, right?
On that one, what that ends up doing,
it ends up creating 400, 600, 800,
and then this one starts at 400,
and the 400 and the 800 from those two different plots
sort of pile up on each other, and it doesn't look good.
So here, I chose to manually set where I want them to happen,
and you can do that too.
You can manually create where you want your x ticks and y ticks to be.
So here I say I want my x ticks to go from 100 up to 701
in increments of 200, right?
Remember, if I'd only gone to 700,
it's going to get rid of that 700 there, right,
because it's not inclusive.
It would go 100, 300, 500, but it won't include that 700, right?
So I'm going to go to 701.
You don't have to start from 100.
In this one, we could start from, like, 300,
and it's not going to look any different
because it's off the map anyways, okay?
And then for the y, I want it to go from 60 to 121,
60 to 121 in increments of 20, so 20, 20, 20.
So that's how I set my major ticks on this,
and I just did it by hand because I thought it would look better that way.
I'm going to tell it to turn on the minor ticks.
I'm going to say information about these.
I want my minor ticks to be length 5.
My major ticks, I want them to be length 10.
I want both minor and major to be all the way around,
like left, right, top, and bottom, right, for major and minor ticks.
And then you just tell it to plot them, right?
Plot the x ticks and the y ticks using the ranges that,
in this case, we built by hand, okay?
And then we tell it the limits, plot from 400 to 800,
from 60 to 120, that's what this section of code is.
We give it some labels.
We tell it the transparency using y label.
Now, I do not use this plot x label for wavelength
because look what happens if I do.
If I tell it to plot it as an x label,
it moves it over here to the left.
It's no longer centered, but really,
this wavelength corresponds to both of these data sets,
and so I'd like it to be centered.
You can make it centered.
You can try and move it over,
but I find it's just easier to plot it by hand.
So instead, we're going to turn off the x label,
and I'm going to plot text, and I'm going to plot it at 650 and 52.
So that's going to be x 650, so that's 700.
It's going to start somewhere over here,
and then it's starting y at 52,
so if that's 60, it's going to come down to 52.
So when I run that, I find that it centers it pretty nicely.
It takes a little bit of trial and error.
Maybe you don't think that's quite right.
Maybe you think it's supposed to be like 645.
You can scooch it over just a hair, and maybe that's better, right?
But I think that's how I do a lot of these multi-panel plots
because I want this to correspond to both of those,
and it's easier just to type it myself, okay?
Now let's go ahead and create the second panel, okay?
Again, we're going to create another XTR subplot
using fig.add underscore subplot using GridSpec,
and again, we want to use all four of these,
but we're only going to plot two of the columns,
the columns at the end,
so that's going to go from 2 to 4 over there.
We grab our data just like before
except that we change the colors
and change the labels to represent 30, 60, 90 clear
as opposed to 30, 60, 90.
We do the ticks and tick parameters the exactly same as before.
Everything's the exact same
except you'll notice that I did not turn on my Y label.
What would happen if I turned on my Y label
for this other multi-panel, right?
If I turn this on, look what it's going to do.
It's going to put that Y label right there,
and that just looks ugly.
We don't want that, so we're just going to turn it off
because it's obvious from this that it corresponds to both,
so when I run it, you can see that this transparency percent
is clearly acting on both of these.
We don't need the tick labels, we don't need the Y labels.
Now, what if you wanted to do like we had initially
and have a small box here and another small box here?
How would you further modify this?
Well, easy enough.
Let's go ahead and grab this whole second panel here,
and we're going to copy it, and let's make a third panel.
I'm going to call this Generate Third Panel.
Up here, let's go to our second panel and change things.
Instead of it plotting all 4 rows coming all the way down 4,
let's have it just plot the first 2,
so instead of 0 to 4, let's have it go from 0 to 2.
The third one, obviously, we have to do the opposite.
This one has to go from 2 to 4.
Now let's run that, and when we run that, yeah, there you go.
We've created this figure, and we basically plotted it twice,
but once on this smaller grid and once on this smaller grid.
Now, what's wrong with this?
There's lots of things that are wrong with it.
These numbers don't need to be there right there,
and turn those off, so we're going to go to our labels.
Right now, this is panel 2.
The label bottom is set to true.
Let's set that equal to false.
We don't need that there.
But what we do need, it's not really obvious
that this 60 to 120 is the same thing that goes 60 to 120 there.
That may not be obvious,
so maybe we need to turn on those labels for the y-axis.
Let's turn them on on the right-hand side
by setting this equal to true,
and we'll do that for both panel 2 and panel 3.
So I'm going to come down here to panel 3,
and I'm going to say plot those on the far right-hand side.
Yeah, so now you can see pretty clearly
that this goes from 60 to 120, 60 to 120.
I think that this is a pretty intelligible graph at this point.
So you could divide it up however you want.
Here we did a square grid, which was 4 rows by 4 columns,
but you could do whatever you want.
In fact, as this video goes on,
I'll show you other examples where it's very different,
3 by 15 or whatever, and that's no problem.
So that is how you do multi-panel plotting,
really, really powerful tool,
one of the main reasons why I plot things in Python.
Okay, let's go to our next one.
Let's talk about how to make a heat map.
Heat maps are really cool.
They're a great way to show 3-dimensional data
in a compact way.
So in a heat map, you plot not only x and y,
but you plot z as color.
So you can see in this one, for example,
with diffraction, how things change.
The lattice parameters change
because the peak positions shift
because of the pressure that change, right?
So how do you go about creating this?
Okay, here's our libraries.
We're going to grab everything we did before,
NumPy, PyPlot, Seaborn, Pandas, GridSpec,
and then we're going to grab this colors thing,
and I'll show you that in a moment.
Again, I'm going to set my universal font
to be 14 for everywhere here.
We're going to grab our heat map data.
If you look at where this data came from,
let's go ahead and grab it in our Data for Exercises folder.
If you look at heat map data,
this is how it was organized
So you've got this first column over here
representing Q.
Think of it kind of like 2 theta.
If you're not familiar with Q, you know that in diffraction
you plot the intensity against 2 theta.
Q you get from 2 theta. It's a transformation of it.
So think of it like the position of the peak.
And then here's all the intensities
for the different pressures.
So you've got 21 different pressures,
and all of their intensities
associated with them.
Okay, so this is one way to organize the data.
The problem is that when you plot a heat map
in Python using Seaborn,
what it wants is 3 columns.
It wants a column representing X, Y, and intensity.
So we need to transform this data
into 3 columns.
What we would like,
if I go ahead and insert this,
and insert this,
what we want is a column representing pressure
and a column representing intensity
and then Q.
So pressure, if this first pressure is at, let's say,
13 gigapascals, we want it to be 13
for every single one in that series.
For all the ones where it's
Q,
for all of these Q values, which go,
there's thousands of them. It's like 6,000
in a single data set.
A single data set goes,
there's 6,782
entries in a single data set.
So we need to repeat that 13
all the way down to here.
And then we need to go to our next pressure. Maybe it was 14 gigapascals.
And we need to repeat it another
6,700 times.
So that's tricky. And then we need to
take all these intensity values,
we need to grab these intensity values,
this guy all the way to the bottom,
we need to grab him,
and we need to move these
over to this
column. And then we need to grab the next one all
the way down, and we need to put it
underneath it.
This is tricky. This is some data manipulation.
But we can do that, and Python is a great tool
for doing it. So I'm going to not save this, and I'm going to exit out.
And let me show you how I went about
manipulating that data.
Well, first thing I did is I grabbed that data
from the
comma-separated value sheet using Pandas,
and I stored it in a data frame.
Then, my grad student told me,
hey, even though we ran Q from
6,000 or 6,700
data points, technically
we only want to grab from 504
to 4,066,
or Q values from 2.25 up
to 4, because that's where these all
are in common. Sometimes we only
measure 2.25 to 4.
So some of these might go a little bit further out in other direction,
but we only want to grab the block where they're all
comparable. Otherwise, you'd have missing spots
in your heat map. We don't want that.
So, great. We can do that. We can grab
the Q values by going to the data frame
in the Q column and grabbing it using
the loc function, the rows 504
to 4,066.
We're going to drop na, and we're going to convert that to
a numpy array, because the
seaborne heat map
wants it to be a matrix
of numpy arrays. No problem.
So we're going to do that, and we're going to
grab all the different pressures. All these different
Y1 through Y21 represent
different pressures.
So all the intensities at different pressures.
So we're grabbing all those intensities.
We're grabbing all that data.
Now we need to take that data and turn it into
three columns. So the first column needs to be Q.
Q needs to have that
same range of
incremental values of changes in Q.
All this tiny resolution
moving down. It's
thousands of data points. We need to be
that Q value repeated 21
times in a row for the 21 different pressures
that we measured. Great. We can do that.
We're going to say, alright, 4Q
in range of 21. That means it's going to be a
for loop that goes through 21 times.
It's going to take Q, which started out as an
empty list, and it's going to append
to Q this X1
value.
Which is just our Q value. It's going to repeat that
21 times. It stores that
as Q. It adds to Q over
and over. So by the time we run this,
let's go ahead and run this first section.
We run it and we open up Q.
Q is something, again,
it's going to be thousands long, but it starts out
with 2 1⁄4
and then it increases up
to 4. You can see it get very close
to 4 and then it starts over again. And it does that
21 times as I scroll down.
It does that 21 different times.
For the 21 different pressures
that were investigated in this study.
Awesome. Now let's move on to the next one.
For pressure, here's
the 21 different pressures that they had.
Our 21 different pressures.
We need to start out making a list
of those, so we do that. Now we create
a new list, which is empty, called new pressures.
And for each pressure
in our pressure list, like we're going to start out with this
first one, we're going to create
a new NumPy array filled with
that value. And it has to be as
many long as we want
in as many queues as we're going to consider.
Which turns out to be
563. So it's going to
put that same pressure all those times to label
that those are all part of the same pressure group.
Then we have to take our intensities.
That's easy. We just take all these individual intensities
corresponding to the different pressures and we
concatenate them together. That just stacks
them up. Sweet. Now we've
got our three columns.
So we've got queue,
pressure, and intensity.
So we have three things. Here I go
ahead and I scale intensity
down so that the color map
can more easily tell the highs
versus lows. That's common in x-ray diffractions
that they'll scale it by one half or a logarithm.
I'm going to say
that my results, that's what we're going to plot, it's a new
variable called results, is the NumPy
transpose of
the vertical stack of queue,
pressure, and intensity.
It's taking those individual arrays and making
a matrix out of them is what that's doing.
Now, we go ahead and say that
the data set is equal to
we're creating the dictionary. We're saying that
queue is this. Pressure and GPA
corresponds to pressure. Intensity is
intensity. We're going to use those for labels on the plot.
And then we come over here. We're going to
reset the index and do pivot
table, telling it, okay,
plot it with the index as queue,
with the columns as pressure, and for the
intensity, that's
going to be the heat map. We want to use intensity.
So you're basically explicitly
telling it which one of those you want to be in the heat map.
Then you go ahead and make your figure.
Use
grid spec.
So in the figure, that basically is
what we need to do to be able to create this
middle panel. But you'll notice that I think a really
good way to do heat maps is
to not just show this
middle region, but to show
what the individual data set on the
far left and the far right
ought to look like. So here's the one on the far
left, the one at the lowest pressure
and one at the highest pressure. So this is
technically going to be a multi-panel plot.
You've got one panel over here, one
middle panel, and then a right panel.
So let's go ahead and do that.
We're going to create our figure. We're going to do grid spec.
I'm going to call this a 4 by 6
plot. So
4 rows, 6
columns. That allows us to do
one column here, 4 in
the middle, and then 1 column at the end.
That's what the 6 columns are going to do.
Here's the spacing. I put really
small horizontal spacing between these.
But you could make that larger if you wanted.
If you wanted a great big spacing, you could move
that and make it bigger. I thought it looked better
with a really small spacing on this one.
So I might keep that small. Maybe we'll do
just 0.1.
Alright, now let's go ahead and
fill data in our first column on the left
here. So this is not a heat map over
here. That's a scatter plot. You can see that as the
intensity changes, the color changes.
So we're going to do
XTR subplot,
fig add subplot. We're going to do our grid spec.
We're going to take all 4 rows.
We're going to use all 4 rows here.
But we're only going to go from 0 to 1
in this first column. Great.
Now, this original
colors, if you tell it to do a
scatter plot and you just give it the data
in there, it's going to take the maximum of the color
range. It's going to be like a bright yellow.
Like this brightest yellow here will be there.
But you can see that actually in this first
data set, that's the brightest it gets. It's less
bright than one of the later data sets.
And on this one over here, this
brightness, even though it's the maximum for this
highest pressure, it's less
intense than it was in the middle.
So what I needed to do was manually
change my color maps on these end
members to more closely match that
from the heat map. So we wrote,
well actually I had the internet write for me,
I found this on Stack Exchange, a way to
truncate your color map where you don't
look at the entire section of it. I'm going to skip
this for now. You can
look at how I did it. I'm not going to bother
explaining it though. Basically, we started out
with the rocket color palette and we only
went from 1 tenth to 55
percent of it. That's what you're seeing here. As opposed to going from
0 to 100 percent of the color
map, we only did part of it so that
it more closely matched the heat map. That's all
I'm going to say about that. Okay, we did a scatter plot.
We sent it the, check
this out. I'm calling this Y1
and X1. That's because I've got this
thing rotated on its side.
Right? The X1
is actually now going to be the
Y value and the Y1
is going to be the X value. The size, I set
equal to 1. The color, I set equal
to the Y1 intensity.
Then I gave it our new color map.
Okay?
I did not give it an X label. We didn't need
an X label over here. That's just intensity.
I didn't give it any tick marks.
For the Y label,
I told it that it was in Q space, which is
2 pi divided by D, the
interplanar spacing, which has inverse
angstrom spacing. You can
do that. Then I labeled that
this was the pressure corresponding
to 13.06 gigapascals.
That's how we went ahead and got this
plot. How did I
make it plot in this funny way where it's plotted
backwards? Well, I plotted it on the
Y limit from 4 to
2.25. That's why it's going from small
numbers to high numbers here. You can tell
it how you want it to plot. I told it I wanted
to start at 4 and go to 2.25.
I plotted it backwards from what you would
normally do. That allows
us to line up this peak here with that
peak there. This peak
with that peak. It lines up nicely.
I plotted
with the correct limits.
I put the right ticks on it.
I wanted it to go from 2.5
in increments of 1.5 so you can see it clearly.
Then I wanted it to turn
on the left and the right tick marks, but not
the top and the bottom. We were able to do that.
Pretty straightforward.
That's our left wing.
Now let's do this right wing over here.
The right wing panel, the one on the far right,
is going to be the exact same.
Check it out. We're going to do XTR subplot,
FIG add subplots.
We're going to use all 4 rows.
We're going to use this whole
region top to bottom, but we're only going to go
from columns 5 to 6 over here.
We're going to do
a scatter plot again using our new
color map so that it matches the heat map.
By the way, what would it
look like if you didn't do that?
What if I didn't do new map? Let me show you what
the problem is. If I just put in rocket here,
if I tell it to use the rocket map, take a look at this.
It's going to take the top of that
peak value and make it as bright white as possible.
But we know that that bright white
does not, that's not what's actually here.
The bright white is reserved for these.
These were the highest intensity in the actual whole data
series, but
you didn't know that when it did a
scatter plot, it just took the maximum value in the
data that was given in this series.
In this one pressure, but
in the whole data series, that wasn't the
highest. That's why we had to map it over to this
new C map.
That's why we did this change where we
reduced it, and that made it look much more closely
like it ought to. That was just starting to turn
purple, and there you see it's matching. This is
just turning red, and it's just turning red there, so
it's a much closer map. Granted, I
just eyeballed that, but I think it made it easier to
interpret this.
On this one, I didn't need any labels, so I just
turned them off.
Didn't need any tick marks,
tick labels, just tick marks, so we just
turned on the tick marks.
Then again, I told it that this corresponded
to 43 gigapascals.
Pretty straightforward stuff you've seen.
Now about the heat map. In this middle one,
we're going to do XTR subplot, and we're going to
plot from columns 1
through column 5. That's going to give us this big section
in the middle for the heat map to be.
Then the heat map itself is pretty simple.
You just go fig equals SNS, that's
seaborne.heatmap. You send
it the data set. We already
packaged up that data set up here.
Up here, we already ... Where was it?
Right here. Here's where we defined
our data set with ... We told it
what the index, the columns, and the value
for the intensity should be.
Great. It's ready to go.
We told it to turn off the tick
labels. We didn't want any tick labels.
On the Y axis and the X tick
labels, we just gave it four of the
data sets, and we gave them the data points.
I manually told them when
to insert those on the 0th index,
7th, 13th, and 20th data set.
That's it. Then we're ready to save it.
That's one way to do it. There are other ways.
You can do IM show. I'm going to
put these ... These are commented out. These will also
produce nice color maps, but I think that this
does a pretty slick job.
I think it's the right way to do
heatmaps where you show the
end members on the sides like this, so you
can really see what's happening in
higher resolution than just the heatmap would tell you alone.
That is how you do heatmaps.
Let's move to our next one. This one's pretty gnarly.
This is multiple axes.
What do I mean by
multiple axes? With multiple
axes, I mean that when you plot it,
you've got your x and y,
but maybe you want a y2
shown in red, and a y3
shown in light blue. All three of these
y's, this capacity,
Coulombic efficiency, and discharge
energy density, those are three different variables,
but they all correlate to the same
x variable, which is cycle number. For
batteries, when you cycle the battery, cycle
number's really important, but there's lots of other
parameters, capacity, efficiency,
discharge energy density.
Those are all a function of cycles.
How do you create a plot like this?
It's pretty tough.
Here's how you go. We're going to bring in
the same libraries, plus this multiple
locator from matplot.ticker.
That allows us to do different tick marks
for these. We're going to use that in a minute.
First off, I'm going to set everything to be size 14 font.
We're going to grab our data,
which is stored in this multiple axes
Excel file. You can see it yourself, how it works.
I read it in,
instead of as a CSV, this time we read it as an
Excel sheet. That's fine. When you read it
as an Excel sheet, now you've got different
worksheets in there. You have to go sheet by
sheet, for the sheet, in the sheets of our
DataFrame sheet. We're going to
read this in. That brings each of those
in and stores it in this
DataFrame. No problem.
Now in our DataFrame, we grab the different
values. We've got the one with
cycling 100 times, cycling
20 times, the capacity,
the efficiency, the discharge energy
density. We're grabbing all these different values
and storing them into these variables here.
Nothing too crazy so far.
Let's grab some colors.
Here we used ROMS colors.
We had to
build a custom function here.
This is all my grad student, Kai, who's
brilliant. When you do
these, see how there's this other
axes over here, but we're only
showing the far right hand one.
The other, the horizontal bar
going out to that, has been made invisible.
He wrote a function to do that, where
you send a set of axes, whether it's the
regular y-axes, the y2
or this y3,
it creates them invisible, and then we just
turn on just the far right hand side
afterwards. He wrote a function to do that
over and over for us.
Here's where it gets very different than what we've seen
before. Instead of just doing figure
equals plt.subplots,
we do figure comma host.
The figure is now
going to have its regular host axis.
That's the typical x and y.
In addition to that,
we can have twin x.
We're going to come down here and see how
we're going to take our host, which is our normal y-axis,
and we're going to twin it.
Meaning we're going to create a second y-axis
that uses the same x values,
but is a duplicate y-axis.
It's called twin x, is the function.
We're going to call that par1.
Par1 is this red axis.
Par2 is, we're going to
do it again, and that's going to create this blue
axis over here.
We're making twins of this x
and y-axis setup.
Then we can offset them.
We moved its position
over this light blue one. The red one is fine.
We just put it on the right-hand side.
This one, we moved it over
off a little bit.
What else can we do here?
He uses his function that he wrote,
this makePatchSpinesInvisible,
and he sends it par1 and par2.
Here he sends it par2.
Basically turning off the grid.
Turning off all of the
boxes. You can see this normal black
box is there. He's turning that off.
Then he's just going to manually turn on
the right-hand side. He's going to turn on
this blue section on this
far right-hand side for that par2,
making the rest of it invisible.
Some slick work there.
Now he goes ahead and he plots his data.
On the host dataset, he's
plotting some data. On par1,
he's plotting different data.
On par2, he's plotting other data.
They all have the same...
You're using the same
approach here. It's still like
before we saw plt.plot. Here
it's not plt.plot. It's host.plot
or par1.plot because
you're being specific about where
you want these to plot according to
which y-axis.
Giving them the markers that he's chosen,
the line styles, the marker face
color. Here they did some alpha, meaning
transparency, so you can see that these are
piled up on each other. That allows you to actually see
through them to the ones underneath.
For each one of these three
y-axes, you need to set
axis limits independently,
plus your x-axis, so there's four of them.
We're going to set our x to go from 0 to 100 cycles.
We're going to set our first y-axis
to go from 0 to 1200.
We're going to set our next
one to go from 0 to 105.
Our third one to go
from 300 to 1800.
We set these independently by doing
host.setXlim
as opposed to say
par1.setYlim, par2.setYlim.
We can do the
same thing with the labels. We need to create
four different labels. One for here,
one for there, and one for here,
and one for there. So we set our four different labels.
We can change the
colors of those different labels. Here we're doing
that. We're changing the colors of them.
We can change the tick, like the
major tick mark
separations. Here they're separated every 200,
but here they're separated every 20,
and here they're separated every 200.
You can change different tick marks.
Here we're doing that for the
host, for par1,
and for par2, and for
the x-axis.
It's a little gnarly, but you can
do it. You've got this as a guide if you want to
that I've made for you.
Then the tick parameters, we're telling it how long
we want the tick parameters to be.
The last thing is, these different
datasets were plotted on different hosts. One was on
the host, and one was on par1 and par2.
If we plotted legends,
that's a problem, because they weren't all part of the
same figure. We'd split them into
three figures in one. What we needed
to do is grab all the
information from those different plots
that we created, which were up here.
These were the plots that we created when we plotted them.
From those, we're going to
get the labels for
each one of these data
plots. We're going to grab the
labels that were there.
We're going to use those to now plot
the labels in our legend on just one of them.
On just the host plot, we're going to
plot all of the plots, even though they were technically
plotted on par1 and par2.
That allows us to have just
one legend here with all that information.
On this one,
something that bugged me is that I was never able to get
this far right-hand line
to turn red, and this
far one to turn light blue.
I didn't want to fight with it anymore,
so instead I exported it as a .eps.
That means that it's
vector file, and we can open it up in
Illustrator, and I could go ahead
and manually change those things. If you come over here
to where it got saved under
Data and then Plotting,
this is now something that I could open in Illustrator,
and I could just manually make that one change
to make that one line red, and the other one
light blue.
That's how you go about making these
really gnarly
multi-axes plots.
Let's go on to our next one.
Just two left. Let's do
Rietveldt first. If you are a material scientist,
very likely you're familiar with Rietveldt
refinement. It has to do with X-ray diffraction.
When you plot X-ray diffraction, you've got
intensity versus two theta, but
it's very common for you then to say,
okay, here's what I think my phase is.
What would its pattern look like,
and how well does that match the observed pattern?
The experimental data
are shown in blue data points here,
and then we have our simulated pattern with
this orange color, and these are simulated
where we expect the peaks to be
for these given phases.
Plus the background
sample holder is this light blue.
Then you take the difference. You take the blue points
minus the yellow points, and you get
this difference curve. If you match it really well,
then you did a good job of figuring out what your phases
were. If you haven't heard of this before,
don't worry about it. It's a whole field.
There's great software packages out there
in my tutorials. I'll probably put a link to one of them
in the description below.
The output is a lot
of information. It's the real data,
it's the fit, it's the difference, it's the
sample holder, it's where you expected
the peaks to be for different phases.
These are complicated figures.
I think that this is a beautiful way to present them.
It's dense with information,
and it just gives you what you need to know.
How do you make a figure like this? You just use
this file exactly as. When you run
your REAPFELT refinement,
it will spit out something called
your final report is going
to have all this information. I made it really
simple so that all you had to do was
export it, and then I would read it.
It will come with these names already there.
You just run this Python script
and it will create that figure for you,
just like that, which is really great.
You've got your x value, that's your two theta values.
You've got your observed data points,
your fit, the background,
and then the hkl positions
for the different phases that you refine.
Here I only did two phases in my refinement.
If you did 22, it would just
keep on giving you more columns, and you could
just keep on reading them in. That would be no problem.
That's what PyGSAS2,
the REAPFELT refinement software,
will spit out. How do you use that?
Pretty straightforward. We're going to grab the same libraries
as before. We're going to set the font
and the PDF so that it's editable, in case we want
to tweak this in Illustrator afterwards.
We're going to read that file in.
It's a CSV, so we're going to use Pandas to read it in.
We're going to then go to our data frame
where we read it in, and we're going to individually grab the x data,
the observed data points, the REAPFELT
refinement, the background, and the hkl
positions for your two different phases.
I'm going to set the limits of my plot.
We want to plot from 15 to 100.
It's pretty common. 10 to 90 is also pretty common.
We're going to use some colors.
Here, I think ROM's colors look great.
That blue and the
pumpkin and the cerulean and Neptune
and his colors, they look really good,
so we're going to use them.
We're going to make a multi-panel plot. There's this one
big panel where most of the action is happening,
but you've also got these really small
panels up here corresponding to the phases
and where you expect to see peaks.
Like this yellow peak comes from a phase.
Now you know that that comes from this
cobalt 304 phase and not cobalt
oxide because we put these
histogram tick marks. That's really helpful.
Like this really big yellow peak,
it comes from the COO
phase, the rock salt phase, as opposed to
the spinel phase.
That's why we do those. We're going to do a multi-panel
plot. We're going to do it
with grid spec, and we're going to do
15 different rows.
The first row 1 and row 2
can be for these histograms, and all
the other 13 can be for
the main figure. You can divide it
however you want, but that's how I do it.
With small spacings between them.
Little spacings there.
Let's make this main
figure first, this big one.
We're going to do the same as before. XTR
subplot fig equals add underscore
subplot. We're going to use grid spec. We're going to go
from rows 2 to
15. We're going to leave rows from 0 to
2 for making these little histograms up top.
We plot the data.
We're going to plot X data and the Y observed.
We're going to call it the experimental data. Because it's experimental
data, I like to use an actual marker. That's why
you're seeing these little blue markers here.
I didn't do a fill color because I think
it's kind of nice to be able to see how those line up on top
of each other. And then for the
fit, we don't use markers, but we do
do a line, and we give it this color.
And we give it this nice label
telling it that we achieved a 5% weighted
residual. Same thing with the background.
We don't use markers, we use a line.
So that's what this light blue is. And then the difference,
check it out. I never actually define the
difference as a data set. I just do
Y fit minus Y observed. That
is the difference, right? So that's this
gray data set down here at the bottom.
Great, we've got all of our data there.
Now we need to add the other stuff.
Tick labels, legend. You've seen all this before.
We manually have it tick
every 20 on here.
I don't put tick labels on the Y axis
because it's arbitrary units. We don't need to.
So I put ticks,
I just don't put tick labels.
Right now it's ticking every 2,000 intensity units.
I just don't care what those are, so I don't
label them.
I turn on my tick on all
four sides. We give it
X and Y labels.
We've seen this already. Give it a font size for the legend.
I had to make this a little bit smaller than I would
normally do to make this fit.
That's
the name of the game here. And then I told it,
I actually plotted text on here to say, hey,
these two phases are present. It's 60%
rock salt, 40% spinel.
Now how do we make these upper sections?
Here we're going to add the subplot
for phase one. This is pretty cool.
We're going to plot from row zero to row
one, so it's going to be just this top sliver.
And then, here's
how it works. The different phases, when you run
your refilter refinement, you don't know how many
HKLs are going to be present. It could be 30,
it could be 5. It could be any
number. Here's what we do.
We know that those are stored in this variable
HKL1. If I come over here
and I look at HKL1,
here's where they're stored.
What I want to be able to do is I want to
go through this and item by
item plot each one of them until there
are no more. That way, HKL1
and HKL2, even though they're very different numbers,
I use the same exact approach for both.
So for HKL1, I'm going to say
for XC in HKL1.value,
so it's going to go value by value
in that list, and we're calling it
XC. It's going to plot a vertical line,
AXV line, at
X equals that position.
It's going to give it a color. That's it!
And then you can turn on, you know, you can do your
tick parameters and the limits and all that jazz
just like before to
create this little mini plot.
Here, I don't want any tick marks. I just
want the vertical lines there, and I do want to plot
off to the side the name of that phase,
Cobalt 304. And then I do the exact
same thing for my second phase here.
I'm going to go value by value
in my HKL2 value
list and plot little grey lines
so that you can tell where they line up.
So, again, I think this is just a terrific way
to make a complicated plot, but one that
is much better than the standard
like, you don't want to print the screen from your
REAPFELT refinement software. This is the right way
to show it, I think. Okay? So that's this one.
Let's do one last one and then we're done.
Okay, let's talk a little bit about
plotting 3D. This comes from a really
great tutorial I found on this guy's
GitHub page on Data Science Handbook.
It's actually from a textbook.
In this same family here,
this same family of books
are really, really great.
So it's taken from there. I've put the reference up top
so you can check it out. And this is available under
a Creative Commons license, so
credit to them for making this available. I think it's good stuff.
So the libraries we're going to bring in
from MPL Toolkits, we're going to import
MPLOT3D, and that's going to allow us
to make these 3D plots.
Okay, let's get started. So let's start with just
a basic 3D scatter plot. So we're going to
declare our figure, figure equals PLT figure.
We didn't do the sizes here because I took it straight from their
code, so I didn't make it square or whatever.
We're going to say
that projection is a 3D figure.
So let's get the data we want
to plot. We need to have three-dimensional data, so
we need x, y, and z. So for the
z, they do numpy
linspace, so that's going to linearly space
the data from 0 to 15,
and it's going to do 1,000
values, right? So it's going to
produce 1,000 values linear space 0 and
15. It then takes those values
and for the x and the y data, it
just runs those through sine and cosine.
Okay, so that is now going to be our
x, y, and z data. So plotting is
as simple as this. You just plot
ax, that's our axes, right,
where they define the axes here,
dot plot3d, where you send it x,
y, and z, and then they tell it to plot it
in gray. So let's go ahead and run this
first cell. By the way, this is a cell.
You see how I did this
pound sign space, percentage, percentage.
That allows you to hit control, enter,
and it will just run what's in this
cell, which is kind of nice to do.
So now it went ahead and it created a plot.
Sure enough, it plotted
oh, I ran this other stuff.
This first part that we've
gone through so far would have just produced
the gray line that did this
sort of spring shape there.
Now, how do they get these other data points?
Well, they go through and they say that z data
is equal to 15 multiplied by a random
number, where they produce 100
random numbers between 0 and 1,
multiply those by 15, so now you've got
100 data points
which are somewhere between 0 and 15
for your z. Then they run
those through sine and cosine, and then
they add a little bit of noise. They add a small random
number to each of those, and that's what these data
points represent. Now, they did a
scatter 3D, and remember scatter
plots encode 4 information.
You've got the x, y, this time
z, so it's going to be 5 information.
It's got x, y, z, and then marker size
and marker
color. So here they don't give it
size, so they're all going to be the same size,
but it does give it a color. It says for color
use the z data.
So, as it goes from
low z to high z, you'll notice it's also
changing color as it moves vertically.
So, a really cool way to do it
and the color palette here is nice, this winter
in reverse color palette.
What about contour
and surface plots? Here's another way to do it. What if you wanted to make
a plot that looked like this?
This is another type of 3D plot. Here's how you do it.
They defined a function
where when you feed it x and y
it's going to return the sine
of the square root
of x and y squared
and added together.
Some custom math function that has this sort of shape.
That's what they've created here.
They start by creating lists
for x and y, so their data for x and y.
They do linear space from negative 6 to positive 6
30 values.
They then take those and they create
a mesh grid. So this is a NumPy
function. NumPy mesh grid.
It basically fills out the space between those.
You gave it x, you gave it y.
It creates a grid in that cartesian
space.
Then they send those values to the function
to create the z value.
Then they plot it.
They come over here.
They tell it that the projection is 3D.
Here they're doing plot surface where they send
the x, y, and z values.
This is r stride and c stride.
That's the step size in the columns
and the rows. They give it a color palette
viridis and they say no edge
color and that's what produced this beautiful shape here.
Then they labeled it x, y, and z
and they gave it a view angle.
If you wanted to view it right along a 45
you could. Now we're looking right
along that 45 there. Or you can move
it back to whatever you wanted to view
this by. If you wanted to tilt it down a little bit
so it's not so tilted up, you could tilt it
way down. So you could look
more right at it that way. You can change
and play with that view angle a little bit.
That's one way to do it. Another way to plot
this would be here. I'm going to uncomment this.
Would be to plot, let me just run this
now, is to plot it as contour lines.
If you look at topographical maps, it produces
these contour lines. Let's look down
on it. Let's look straight down on it actually.
If we look straight down on it, this will now look like
a topographical map. Oops, we want to just
run this section. F9
on that section. Sure enough, there's
our topographical map of just that region
which is pretty cool.
That is a bunch
of plots. I'm sure
that there's others. You can
drop a comment below if there was a type of
plot that we didn't produce here today
and you'd like to know how to go about doing it
and I'm able to. I'm happy to show you
how we would go about doing that.
I think it's worth the time because you can make some
really complex but beautiful plots with this
type of software. So thanks for joining
me as we talk about plotting and we'll move on to our next
video.