Bonus day: how to make nice figures using qtgrace and illustrator
Oct 15, 2023
20:43 QTgrace tutorial starts
27:26 adobe illustrator for further editing
37:24 non-linear fitting in qtgrace
So, let's start with, I'm going to go over a couple of slides from my post-doc mentor.
My PhD advisor has a way of making figures and they're pretty much the standard way that
you see in most figures.
And when I joined UCSB, Ram Seshadri's group at UCSB, he has a very clear philosophy for
making figures, which I've just completely latched onto.
I think it's terrific.
You're welcome to think differently, that's fine.
But here's some of his opinions on it, on how to make nice figures for publications
and presentations.
And it goes back to some of the stuff that we talked about last time, that if you're
going to spend all this effort and time, that you ought to make it worthwhile.
You're going to spend, on average, per publication in grad school, it's probably a year of your
life, roughly, that goes into it, maybe a little bit less.
So if you spent all this time, and a year of your life means quite a bit of money, probably
around $100,000 of total expenses went into something, you should really make all that
money and time be worthwhile and make sure that your audience can understand it in the
most simple way possible.
Which means, just care about your data.
Care about how you're presenting it, and care about how people are going to interpret it
based on how you prepared it.
We mentioned last time, we generate lots of data, we should try and make sure we're reading
it nicely.
So he actually gives opinions all the way from font, to colors, and sizing, and I'm
just going to go through it.
You guys, I'm curious what your opinions are, if you agree or disagree.
Fonts, one of the first things he gets to, he says, there's generally two classes of
fonts, there's obviously 10 billion different fonts out there, but they kind of fall into
two classes that get used.
You've got serif and sans serif, right?
So you either have these little feet things at the bottom of the letters, those are serifs,
right, from some language, something like that, right?
And then sans, I don't mean it's without, right, so sans serif is something like Helvetica
or Libre Arial, things that don't have that.
So when you use which one, you can use whatever you want, honestly, but in his opinion, I
think I agree with him, that serif-free, so that little footy thing, these work better
for short blurbs, right, and presentations, right?
But if you're going to read a long paragraph of text, like in an article, it's nice to
have little serifs, because it gives you a bit of like a bottom line that your eye can
follow a little bit more easily, right?
So it's not that one's better than the other, it's just that they have different applications.
For labeling, for presentations, short blurbs, this is fine, if you're going to write text,
these tend to look a little bit easier, and they're easier to follow with your eye.
Obviously, there's a lot of fonts, which I hope you guys just never use in technical
presentations, unless you're doing, I don't know, if you have some good reason to want
to use Comic Sans or some of these Wingdings or whatever, and there's smirking going on
in the room, and yet this happens all the time.
One of my good friends, Chet Boxley, who I love dearly, he let one of his students at
a presentation with the program manager use this like old-timey Wild West font that looked
like it had like bullet holes in it, and it's like, it just looks really unprofessional,
right?
So I don't recommend, just care about what you're presenting, realize how people are
going to view it.
There are some somewhat less formal fonts.
You can hear Ambika here, which is somewhere, it's still nice, but it's a little less
formal.
I prefer to use that.
Let's talk about plots, though, right?
So plots, one of the biggest things I changed when I went to his group is they all do square
plots.
I was like, why do you use square plots?
My PhD advisor was big on the whole golden rule, you should have this roughly three by
five ratio-ish, and it just looks nice to the eye, you'd say.
So Rom's group are big fans of square plots, but they do it for a specific reason, and
the reason is that they shrink well, and most of the time your figures are getting shrunk,
right?
So here's an example of a good plot, and there's lots of good things to notice here.
First off, you see that the size of the font everywhere is the exact same.
So just yesterday in our 6011 class, we saw some good presentations, but a common thing
is I'm sitting two rows back, and I have bad eyesight, but still, I can't read the
fonts, right?
Because it's small, and by the time you actually make it fit on your PowerPoint presentation
or whatever, it's gotten even smaller.
So making sure that anybody in the room or a person holding the paper, whatever the
format is where they're looking at your plot, can read everything that's on it is
just critical.
This is probably one of the most overlooked things, I think, in presenting data.
I think all three groups that did it yesterday had a problem where you couldn't read data,
and that's frustrating to the audience.
They stopped listening to you, and they're trying to pay attention to the numbers on
there.
I had to ask multiple times, Christian, right, what the number was.
I did see that, but he didn't make them square, and he had crazy fonts.
I don't think he, well, I'll show you this.
You can change the default settings in Qt Grace to have these all be the same, and I
don't think anyone sent me the default file yet.
Anyways.
So one thing is that you can read everything nicely.
What else is nice about this?
Talks about it here a little bit.
Any of you guys notice those?
You don't have to read this.
I'm okay if you don't read this.
I'd be happy to just comment.
What about this plot?
It's easy to interpret.
Yeah.
It's easy to overwhelm your audience and put way too much data in one plot.
You think because you collected data, it all should be shown.
Sometimes if it doesn't go to the main point of where you're showing the figure, you can
edit it out, right?
We get really married to our data and the work we've done, and we don't want to let
it go.
Sometimes it's right to actually let it go, right?
They've done two different colors.
These are ones that print differently even in grayscale.
Somebody prints this in black and white.
They'll be able to see the difference.
But moreover, you want a broken line.
You want a solid line, right?
It's very clearly labeled which is which with the same indicators up here in the legend.
This sounds trivial, right?
But people don't do this all the time.
The stroke is large enough that you can see it easily on this background.
Yeah.
So this is kind of a question about presenting data for a presentation versus in a paper.
Okay.
Is it okay to have more information in the plot for paper if they've got time to sit
down and actually look at it?
So if you guys looked up Jean-Luc Dumas, one of the things he talks about is do not just
pluck the figure from your paper and throw it into your PowerPoint, right, your presentation
because it's a different medium, right?
A paper, you're intending the audience to read it, right, as opposed to you just talking
about a few key concepts when you're presenting.
He's a big fan of that.
Another thing he does or at least he suggests doing is take this axis and rotate it so it's
easier to read, things like that, and less information also when you present.
So it can be a little bit more dense information but still only add information that's really
helping you tell the story you want to tell with it, even in a publication.
There's no need to add like every single scan if it muddies up the picture.
You can delete a few of those scans out if it conveys information.
The tick label, the fact that they have tick labels on top and bottom make it really easy
if you did want to read a value off of here, you can do so.
You can put a ruler on it and read a value off, right?
The fact that they have major as well as minor tick marks and that the spacing is something
reasonable, this all seems very simple.
In Excel, for the most part, if you just use Excel, we'll get a lot of this kind of right
but it can get very wrong.
Yeah, that's what he's got there.
So this is at five inches, for example, that separation here but if you go to print this,
more often than not, they get shrunk down, right?
By the time you publish it, most journals have two column format and because they pay
per page, editors really try and shrink your article down and your advisor might as well
because you pay per page in most journals.
So you actually want to condense it.
So your figure which was big and easy to read before got shrunk and you need to make sure
that this is all still legitimate for whatever your audience format is, whether it's presentation
or on print.
This square versus five-thirds thing, is that just the data box?
I like the whole thing but the data box is fine too.
I break this rule sometimes but it's something I try and adhere to.
There's cases where it doesn't make sense.
Remember I showed you guys last time one where I had like four different types of information
all stacked on each other?
That didn't lend itself particularly well to a totally square plot but what you want
to avoid is if you do like the wider, more wide than it is tall which is sort of a standard
size that Excel and many other things spit out, when you shrink that, this got really,
really short, right?
And the data gets really, really hard to see.
It gets really, really small.
So having a square plot forces it when it shrinks to give you more space to look at.
So you don't have to do this.
It's my suggestion.
I've now completely adopted it.
People in my group all do it.
I think it's just a better way to plot.
And you can request, right?
You can request to the editor like this needs to be a two-column figure, right?
And sometimes they'll disagree for some reason.
You can bicker about it.
Usually they'll do what you ask them though unless you're taking a lot of space.
So what sort of colors should you use?
There's no one right thing on colors.
I've been using this several times in my life.
You can Google like colors for scientific publications.
There's lots and lots of blogs and articles that have talked about this.
There's clever rules on colors.
There's clever rules on how your eye interprets different gradients and
hues as well as intensities.
Your eyes are interesting in how they interpret that.
And people have tried to use the math of that to suggest different colors
that are equal in terms of change if that's what you're looking for.
Generally speaking, I just say pick things that look nice.
Pick things that are easily that you can tell apart from one another, right?
And then avoid things that are going to be distracting, right?
These are, they're presenting actually okay.
Here on my computer screen, this yellow is almost invisible as is the green.
And this is just obnoxiously bright.
So think about how it's going to project, right?
I had a really nice series of slides I put together when I went to Florida to give a talk.
And then when it presented, it projected in garbage.
Everything looked terrible, right?
So be aware that what you see may not be in the final format.
It's always great if you can get a peek ahead of time or
try and realize how it's going to look, right?
So colors, I'll show you some of the colors I like when we do the QT Grace demo in a minute.
Okay, and so what are examples of a bad plot?
If we can learn a lot by looking at a good plot, let's learn by looking at a bad plot too.
This is the default plot from a software.
Anybody use this software and know where it's coming from?
It's not MATLAB, like it.
This is Maple.
Maple's another math software, at least when I was an undergraduate at QPM.
But the default plot, when you say like plot this function,
plot that function from zero to nine or wherever they have it going,
this is what it spits out, right?
It's sort of this like five by three golden rule thing, right?
Just fine.
The stroke on this, first of all, they pick like this really thin stroke,
and then it's red and green, which is completely the same if you're colorblind.
Most folks have colorblind problems.
That looks the exact same to them.
These are tiny.
This is big.
This is like a big spacing.
That's like a small spacing.
It's just not great, right?
But at least you can read it and mostly interpret it in this format.
By the time you shrink this down to a two-column format,
it gets really, really hard, right?
By the time you shrink that down, this is the exact same data plotted,
one with care and one just as the default,
something like Excel or something you want to spit out, right?
And it's just really hard to read the data, right?
This stuff is now...
This is what I was looking at yesterday.
Couldn't read these numbers, right?
It makes me crazy.
Whereas this, even though you had to make it small,
all the data is still interpretable.
And again, by making it square, it gives you much more room to work it out.
Okay, so there's thoughts on that.
So what about insets?
Insets are very common in scientific publications,
but then we have insets.
And the most common way that people do this
is they make two figures in Excel or whatever.
They turn one into an image file.
They turn it into a thing or something.
Then they drop it on top of the other one in PowerPoint
and shrink it down until the white doesn't cover up your line or anything, right?
They'll shrink it down until this isn't on top of that,
and they're like, okay, we're done.
So what's bad about that is that all this, by shrinking it down,
became very, very difficult to read, right?
So again, if you're going to do insets, the same rules apply.
Anything on your plot, I think as a general rule,
all of your font size should be the exact same all the way through.
Make everything the exact same font size,
unless you really have a good reason to make this a bit smaller, right?
So instead of shrinking it down,
actually find software that can plot this the right way.
So the marker size here is the same as the marker size here.
It doesn't have to look like it's been shrunk down and put inside of it.
So insets are one way to make it, right?
You can make it work all right, but there's an even better way.
By the way, notice the additional redundant information
by doing circle versus squares, filled versus open,
you know, solid line versus broken line.
Just making it as obvious as possible the difference between your data
is helping them interpret it, right?
But a better alternative to doing insets is to do multi-panel plots.
If you remember the example I showed you yesterday,
where it was like five different types of data we collected,
we made different panels, right?
Different panels can be really useful,
especially if they have a common axis.
Here they don't have the same common axis.
It's going from four to maybe nine,
and here's one from zero to nine.
So it's not uncommon, but it's still a better way to show this
because on one they can do a linear plot,
on the other they can do linear log, right?
So you can show the information in a different way.
So here this is the same exact information as we previously saw,
just that it's a little bit easier to interpret here
than here as an inset, I think.
Right?
So one of the challenges is that Excel doesn't have a simple way
to make multi-panel.
So if you're using Excel as your go-to tool,
it's not going to be easier.
I don't even know if it's possible to do this.
Maybe you can.
I don't know if it's going to be easy though.
Origin and other software can do this fine.
I'm going to show you how to do it in Qt Grace
where it's very simple to do.
Again, don't do it this way though.
The common thing is to take a plot,
here's your regular plot, here's your other one,
you just shrink it down.
Now it's completely invisible what the meaning is in there.
And this happens all the time.
I've done this.
My first paper in grad school, I think I did this.
I took something from the literature
and instead of even gathering the data myself
and re-plotting it, I just screen captured it
and shrunk it on top of one of mine.
And it's very common to do this.
It's just not useful to the readers,
which gets even worse by the time you shrink it
to a two-column format.
It's just terrible.
Okay, plots from instruments.
A lot of times the information comes from a spectrometer
or from some instrument.
And the older the instrument, the more likely it is
that it, heaven forbid, it's only got a paper copy,
but it might only have an image that spits out.
And you may not even have access
to the data you're looking for.
That's the case.
You need to harvest that data
using something like plot digitizer,
data feeds between, right?
But this is an unfortunate
but not an uncommon display that comes from an instrument.
So what are the problems with this?
First off, you have no tick marks.
So you're left to kind of wonder
where the actual marks are here.
And with a plot like this spectroscopy,
it's all about knowing the location of these peaks.
And it's very hard to read where that one's at, right?
It's like, it's not 1,000, it's not 1,500.
This is going the wrong way.
That's common in spectroscopy.
It's just hard.
It's a hard to interpret plot, right?
So adding even tick marks would be useful here.
Another one is they've got these numbers here
with no units next to them.
So this must be arbitrary intensity,
but your reader might be wondering
what units these are, right?
They've got this thing here that says
they've got a negative 1 next to it instead of an exponent.
It's just sloppy, and it's small and hard to read, right?
So take the same data, harvest the data points,
which you've learned how to do.
It's not very hard.
And then re-plot it yourself in an appropriate way.
I'll show you an example in just a bit for spectroscopy.
I have a question, though.
Yep.
This one.
If you had to use that data, would you
just try to make some kind of estimate, say,
marks here, or would you like to calibrate
top of P or something?
What would I do?
I'd put it right in the middle between the numbers.
That's probably what I'd do.
It'd be better if you did have something where
exactly a peak is at this position,
and you could maybe do it that way.
But realistically, I'd probably just
put it right in the middle of those numbers.
But it's subjective at that point, so it's not great.
What about microscopy?
As material science in particular,
a lot of it's very common for every paper you write
to have one or more images, either optical or SEM
microscopy.
So what do we think about those?
Well, a standard figure from a journal article
might look like this.
And you might think that's a pretty good image.
I have no problem with that.
So things to make it better, though,
if you've got what really matters on figures,
the most important additional information you're going to add
is the scale bar.
People just want to know what scale it's projected at.
And depending on how it's shown, this scale bar
is difficult to read.
You notice this thing right here?
That looks like six microns, but it's not easy to read.
And then this other stuff, you see words,
but you don't actually care about these words.
They're just noise-based.
They're not part of what you're trying to show people.
So something Ron really advises people do
is take that, cut it out.
Again, he makes it square.
But cut it out, and then re-plot your own scale bar.
Take that exact same image, make it square.
Draw your own little white rectangle on it.
Make sure it's the right size.
And then write in very obvious font what the scale bar is.
I've taken to adopting this.
I think it makes any microscopy image look a lot better.
OK, we've already talked about posters a little bit.
So then he just gives a bunch of examples of nice figures.
So this was from a guy named Nate Jordan.
Nate Jordan.
So Maureen, she did a temperature-dependent
diffraction study.
So there's some coercivity measurements here.
There's heat capacity, and there's diffraction.
What they have in common, some of the data
I showed you from last time, is that they have the same x-axis
here, temperature.
They're showing something happening
as a function of temperature.
So they're clearly showing that something's occurring right
here, and by lining those up, it makes it obvious.
Something I like that they did is not only show you
a heat map, which are nice for showing a lot of information
in a two-dimensional format, but a heat map,
they also took this end member of the heat map
and this end member of the heat map and plotted those separately.
So you can see it with a little bit more detail
what's going on there, which is a nice touch.
Overall, it's no longer square, but it's still
going to shrink pretty well and show the information.
Another one.
This is from Nate.
Similar thing.
Take a heat map, but show what the end members look
like on the other side of the heat map.
He's not a fan of dark backgrounds when you present.
I think I generally agree with him.
In fact, you can take really important, astonishingly even
data, like the discovery of superconductivity,
and when you plot it on a dark background,
it can look terrible.
So I don't care what you do, but just realize how it's going
to look when you present it.
And if you think it looks cool to have a dark background,
make sure that your data is still easy to interpret,
because that's the main part of this.
Take a look at what he's done here
with this multi-panel figure.
Again, it's square overall.
They've got microscopy images.
They've cut out the parts you don't care about.
They've added their own scale bars with the right color
to make it distinguishable from whatever's behind it.
In this case, black.
In this case, white.
Whatever makes it the most easy to distinguish.
He actually added a shadow behind this
when we were looking through the scene.
They inset this selected area diffraction pattern
on top of it.
Overall, it's just a very nice, easy way to interpret this.
They've shown you that you've got both half-Beusseler
and full Beusseler phases present by labeling
on top of that SEM image and the DEM image.
Makes it a really nice and easy to interpret plot.
If you have the paper to go along with it.
If you're doing material science,
often, very commonly, since one of the core
tenets of material science is structure-property
relationships, then you need to talk
about structure materials.
If you're a chemist or whatever else,
you also might find yourself needing
to talk about crystal structures.
Learn how to use some software.
They're free.
Like Vesta is the one that I use.
Most of these are generated in Vesta.
It's totally free to use.
It's not that hard to learn.
If you want to learn and you don't know how,
come talk to me.
I'll have you work.
Really easy to learn.
And you can make beautiful figures, right?
Now, when you're talking about the structure,
maybe you're talking about the number
of repeat perovskite units in the structure
and how that changes the catalytic property
or whatever else that you're working on.
You can illustrate it nicely with a figure that
really shows it cleanly, right?
You add this on, you say, basically,
whatever you're trying to do.
But learning how to do these is not hard to do.
You can make very nice crystal structures from them.
Okay, so that said, let me switch gears now
in the remaining roughly half hour
and show you how to use the plotting tool
which I use, which is QTgrace.
So QTgrace, you can find it by going to SourceForge
and just typing QTgrace, SourceForge.
And it just updated, so it's actually
a brand new version that came out in February.
It's got like undo and stuff.
Before, the old one, you couldn't undo.
Oh, that's really nice.
Yeah, I actually am not using it yet
because I've been too lazy,
but I did download it and try it.
So it's free, you can download it right here.
I strongly recommend it.
You don't have to for anything in this class or anything.
I just recommend you learn it.
That said, how does it actually work, right?
So let's come here.
Let's say you've got all this data, right?
You wanna plot it.
And this is just the Excel version
of some spectroscopy data.
So you would grab it and you need to go
to a two-column format, right?
So what I do is I open up Notepad, right?
You take the data that you wanna plot.
Let's say it's this data, right?
You're gonna go all the way down, grab it.
Go to your Notepad, you have to paste it.
You go Save As.
The key thing to use QTgrace is you have to save them
as .dat files, .dat files.
So you can put this wherever you want.
I'll just put it in my downloads for now.
Test.dat, right?
So now that I have that, I can open up my QTgrace.
And again, because I've changed the default parameters
on my QTgrace, it automatically goes to a square format,
which is something I prefer.
And also, if you look at the colors available,
it's got predefined colors.
You can make these be whatever you want.
It's got the font size.
You can just change it to be exactly
what you want it to be with the default.
If anybody wants this, I'll send you our default file
for the Sparks group.
You're welcome to use it.
That said, how do you import your data?
You go to Data, Import.
I'm told you can do it straight from a CSV file,
like in Excel.
I never bothered.
I always just turn it into a .dat file.
So you go to ASCII.
You have to tell it where that thing's located.
So I'm gonna tell it, all right,
look in my Downloads folder.
And sure enough, there's test.dat.
So from here, you just double-click it,
and it's gonna column count incorrect.
Did I mess something up?
Oh, my bad.
All right, let me delete out the first row.
Of course, this happens on a demo.
I'm just gonna delete it.
If you put a hashtag in front, it ignores it.
All right, let me redo that.
Okay, it's telling me it skipped something
for some reason on the very last row.
I think I needed to put an extra delete at the very end.
But there's my data, right?
So once you do this, you can import multiple data sets.
You can do this one at a time,
or I recently learned that you can actually
import multiple data sets in an easier way.
All right, so I'll show you what I mean.
Let me just hide this for a moment.
All right, so if I wanna import more data,
I'm gonna go to where I have it at,
which is Synthesis.
Normally, you have to tell it,
are you importing a single set of data,
or NXY, or block, right?
What's interesting is that if you tell it
a single set of data, and you still tell it to import,
it'll still break it up into a bunch of different data sets.
So it'll automatically recognize that
that contained 12 different data sets.
So how did I tell it that it had 12 different data sets?
All I had to do was come over to that folder
I was working out of, and if I open up
this data file in Notepad, you can see
all I did was I added the little ampersand sign, right?
So here's the hashtag, the pound sign, I guess,
with the name of this first set of data,
whatever you wanna call it, right?
But when I put this ampersand with whatever else,
that's telling it that a new data set is coming, right?
So it actually is gonna incorporate
all 11 or 12 of these data sets automatically, right?
And it automatically will start to assign them colors
based off of the order you have colors here, right?
The very first color it's gonna assign
the first data set is black, all right?
Just go down, and you can set this to do whatever you want.
This is totally user-determined.
You tell it the RGB values, whatever colors you want.
Again, I can send you our default file
that has these on it, or you can make your own.
That's no problem, right?
This I took from one of these articles or blogs
that talked about how your eye interprets
different cues and color they have,
and you can include those,
as well as what my postdoc required all this to print in.
And these just tend to be kind of nice colors.
Is this importing the series name to like a column name?
I know you can make it do that.
I think on the new Qt grades it does.
This doesn't automatically do that.
No, so you still have to type in
the names of these things, right?
So this takes a little bit more work than Excel,
but the final product is just a lot nicer, right?
So let me pull up an example like that,
that spectroscopy data, right?
So if I go back to our, let's see, under Research Fisher.
So if I go to one of like our figures.
So I don't know which one.
I've made a few here.
Let's pull them up and see what they look like.
You can take the actual data.
You can make the marker size and whatever else be exactly,
whatever you want, just like in Excel you can.
It's just a little bit simpler, I think, to do here.
But one of the most powerful things about this
is that you can easily export it
to something like Illustrator, right?
So let's say, let's say I want to,
the vertical axis doesn't necessarily matter here.
I should be able to shift these and I should show a trend.
It's difficult to do in a plot software like this
because you have to actually change the data.
It's nice that you can send it to Excel,
or Illustrator I mean, and manually move it around.
So how do you do that?
You'd come over here to File.
You're gonna export it,
but you're not gonna export it as a pink.
So you have to change how it's gonna export.
Tell it you want to export it as an EPS
or an SVG.
Either of those are vector graphics,
meaning that Illustrator can open them
and move them around.
So if you have a bunch of diffraction data
that's all on top of each other
and you want to separate it out
so it's easier to interpret,
it becomes really easy to do, right?
Tell it to send it as an EPS,
then just export it, right?
From that point, it says,
oh, there's already one in there.
Do you want me to replace it?
So last time I did this, I created one.
But basically I can take that DSC Zoom
and now it's an EPS file.
So this thing will open in Illustrator automatically
after a few moments.
By the way, as students, you guys have access
to Illustrator and the Adobe products.
I strongly recommend learning how to use them now.
It's free to have access to them.
So learn now and then buy them
when you go out and get jobs, right?
Because it's tremendously powerful software.
As I mentioned, one of the things you might want to do
is move these things around vertically
to get them in the right spot.
This is tricky to do without a mouse.
I'll try.
So first off, it's telling me,
hey, I don't have this font
that you were using in Cutie Grace.
So it's gonna highlight those in pink.
We can ignore that for a moment.
We can change it if we want.
But if you wanted to move these around
like to make them in order,
all you'd have to do is just select one of these things.
You come up here to select.
You do select all with the same appearance.
It's gonna take everything that has the same color,
same stroke, whatever.
It's gonna grab them all together.
And then you can really easily move these
wherever you want them to go, right?
Which is really nice.
So using that approach,
you can make figures that look like,
take that same data which is harder to interpret.
And if you spend a little bit of time
making it easier for your audience to interpret,
you can make it look like,
I think I've done it in here.
Maybe.
Too much happening in my poor computer.
Let me close some of these.
Yeah, Christian?
So with that particular data set,
you have a y-axis for your stuff around?
Yeah, it's the relative change.
So you'd have to change your values here
and basically say,
well, you have to inform them that it's been moved, right?
That's not the raw value.
With DSC, if it's been normalized to zero anyways,
then it won't matter.
So yeah, anytime,
this is like a broader, more general topic is,
is it okay to move your data around, right?
It's not okay to falsify your data, right?
But is it okay to take like,
how about this one?
Let me go to Fisher.
Let's see.
FTIR, I think this is the one.
Yeah, right here.
So in this case, when it came out of the Excel, right?
The raw data, if you throw it up in Excel,
this stuff's all right on top of each other
and it's very hard to tell apart.
So is it acceptable to move it up and down?
It is, but you need to tell them
that you've changed your units, right?
And then what I'm really trying to tell them is like,
hey, just look at the relative change.
Obviously, this represents the baseline.
This would be the same as that up there,
but the relative change
is what you'll be able to see more easily here.
And you're able to line up key features, right?
This is some long, this is a big.
So being able to take something
and plot it in whatever software you want,
like QT Grace, and then turn it into an Illustrator file
where you move them around,
where you do subsequent labeling,
it's just a very powerful tool.
This is what your editors do for any science major,
like these really, really high visibility journals,
is they employ people to re-plot your data, right?
If you're gonna submit to the American Chemical Society
or ceramic society, you're gonna have to do this yourself
if you want it to look as nice.
And so learning how to do it is worth your time, I think.
Because you can make just very nice figures.
It's much more easy to talk about, you know,
these different bonds that are happening in your material
when you take the time to show the data in a clear way.
Yeah, Christian?
It does.
You could make a multi-panel, it's probably your best bet.
So again, you would go to,
so what if I wanted to break this data up
and show it in two different panels, right?
How do we do that?
Well, to do that in QT Grace, it's not so hard.
You come up here to data,
and you're gonna go to, I think it's plot?
No, graph.
You're gonna go to plot and then go to graph.
Right now, all the graph is sitting,
it exists in what we call this global graph, G zero.
So this whole space is right now called G zero,
that's what this plot is.
So first thing you wanna do is you wanna duplicate that.
So there's two of those plots,
and then we're gonna move them relative to one another.
Right, so you can just right click on it and duplicate.
So now you have two data sets.
And they're sitting on the exact same spot,
so it doesn't look any different.
But then what you can do is you can take,
all right, G one, that's gonna be the upper inset, right?
So that's gonna go, I'm gonna plot it
not starting at point two in the y-axis, right?
Because this whole space goes from zero to one.
So this graph starts at point two and ends at point eight,
same with point two to point eight.
We're gonna change that.
We're gonna make one of our graphs start at just above half
and one end at just below half.
So that's simple to do.
We're gonna change y.
Instead of starting at point two for this one,
let's have it start at like point five two.
So now it looks a little bit messy,
but we can take this one and tell it to start at point two
and end at point four eight, for example.
And you've got a pretty nice multi-panel plot.
You can do this as many times as you want,
adding more and more data in whatever way makes sense, right?
You can turn off these labels
since they're plotted on the same tick marks.
You can actually shrink that gap a little bit
and just get the text out and move it on.
This is all, it all can be controlled
in a much more controlled fashion
than in something like Excel, where it's like,
I don't even think you can plot a multi-panel,
even if you did, it would be a little challenging.
Because mostly it's done by eye.
Here you can tell it the exact coordinates
so things line up just right.
You can make like the image that has like one big panel
here and a bunch of smaller ones here.
You can have those separated in a very easy way
just by controlling where your X and Y start
for each plot, right?
You can turn data on and off in each of these sets now.
Let's say you only wanted to show some of the data up here.
So it's just a matter of double-clicking it
and you could hide some of the data sets, right?
You'd hide whatever ones you made sense to hide over here.
Now you double-click on this data set
and you could hide different data here, right?
So whatever made sense to show it
would probably be the way to go, Christian.
Otherwise you'd have to say relative and transparency
or something like that in your plot.
And as long as you're not being dishonest
in the data you show, it's fair game.
Whatever you do to make it clearer for the viewer
is fair game.
You just can't falsify data.
You can't make it look like something it isn't, right?
Yeah, Garrett?
Absolutely.
Oh, in Qt Grace?
No, but you can leave an empty spot
and then do that in Illustrator.
That's where I'd do it for sure.
Qt Grace is great for getting axes, right?
Controlling your tick marks,
getting the data roughly where it ought to be.
And then I do my final edits all in Illustrator
and that's really easy to do.
You can just copy and paste an image
and drop it right on here.
So with the paper that we wrote in 10 on carbon,
that's how I made those, was all in Illustrator.
So you can have your diffraction pattern,
you can have, if you wanna show a microstructure
on top of it or something, it'd be really easy to open.
Let's see, we've got 15 minutes left.
What else is useful to cover?
I'm working with Qt Grace or Christian.
Let's talk about moving the legend, right?
When you first make data,
the legend is right here in the middle.
Right now you see that our legend
is actually overlapping on both of these.
So you can move the legend around
by going up to plot and graph appearance.
And there's all these different tabs.
Like if you wanna have a title on your plot,
I don't think you should ever have a title on your plot,
but if you wanna have one, you can change it right here.
And then like the legends and legend box, you can change.
And again, it's located in terms of coordinates, right?
So if you want this one to be at a different height,
like starting at, oh, sorry, not.
X should be 0.85,
but if you want it to start at a different height,
you can make it start at like 0.4 or something, right?
And it would move it relative to it.
Oh, 0.85, I'm gonna see where to go.
Right, and then it'd be down here.
Again, this might be easier to do
just in Illustrator once you're done.
So if it's on the exact spot where you want it,
it's very easy to move it where you want it to in Illustrator
because these can just be graphed, right?
Come over here to, once you've exported as an EPS or SVG,
you can just grab this stuff
and just move it wherever you want, right?
Wherever it makes sense to move it.
You can force things to line up.
This is much easier with a mouse.
You can make things line up.
So let's group them first.
I'm gonna group these two things.
So now these are as a group,
meaning they're gonna take actions as a group
rather than individuals.
Then you can take these and using these alignment tools,
you could align them centered,
or maybe you want like the data points to line up.
You can do a left align
so that then they line up exactly
to whatever you want on the side of this plot.
So all this is just much more accurate and precise
and looks better than if you're trying to do it by hand
in Excel or whatever tools you're using.
Yeah.
So that's good.
I guess the only downside is I like to be able to have it
be at a specific size so it lines up perfectly.
You don't have to worry about doing it by mouse.
Oh, perfect.
Okay.
That's nice.
Okay, what else is useful?
Usually we run out of time on here.
Here I've got 10 extra minutes.
I'm surprised.
What am I forgetting to show you guys?
Excellent point.
Let's say that your data you want to fit
some sort of line to.
Let me pull up another plot where we've already done it.
So if you want to fit data to it,
in Excel you've got like five or six options
and none of them are really very good nonlinear options.
You've got like a power and exponential,
but it's pretty limited.
If you've got, as you will in grad school,
some sort of equation that you want to fit your data to,
like take like your hardness data, right?
How would you fit that line of hardness
as a function of composition to your data?
Excel you wouldn't be able to.
You need a custom expression to fit it.
QtGrace is really easy to fit custom expressions.
So we'll just go to the electrochrome.
So take, for example, the Avrami equation.
Oh, not this one.
Let me go to the raw data for it.
Yeah, something like this.
This data can be fit with the Avrami equation.
So if you've taken a kinetics course,
hopefully they talked about Avrami kinetics,
which basically says it's flat
and then it starts to incrementally change
and then it's going to slowly ask until it's soft.
It reaches some sort of transformation.
So it goes from 0% transform all the way up to one,
meaning 100%, right?
So how do you fit something like that?
None of your Excel options are going to work, right?
So to make it fit, it's really nice in QtGrace.
You can define custom things.
You're going to go up here to data probably.
Yeah, data transformations.
And then you've got lots of options for regressions, right?
We're going to do a nonlinear curve fitting.
And in this case, I've already done it.
So, oh, it doesn't show it though.
It doesn't keep it.
That's surprising me.
But you could write whatever you want, right?
If you want, whatever expression you want.
So Avrami equation is Y equals one minus EXP exponential
of A0, that's one constant times X
times or raised to the A1, for example, right?
You can do that, no problem.
I think it's supposed to be negative, right?
So you tell it, hey, I've got two parameters.
A, that's A0, A naught.
I might have to make these capitalized, I don't remember.
You can give them starting points with your regression
and it'll do a much better job
if you give it a good starting point.
All right, if I try it right now, it might fail.
Like, what does it give me?
Yeah, my R squared is like, actually not terrible, 0.96.
Correlation coefficient, that's your R squared value.
0.96 is actually not very bad.
So it actually, it found it okay on the first one.
But it's really easy to do these fittings
for any custom equation you want to come up with.
So again, if your research group pays for you
to guys have origin or whatever
and you're already making nice figures,
this could be a waste of time.
But I find that most grad students don't have a free
and customizable way to make nice figures
and custom regression.
This is at least one option for you guys to consider.
It's really not so bad to use.
What else is useful to cover here?
Does that show the?
What it does, it creates a new line.
Yeah, right?
There's this whole source destination thing above it.
When you do that, it took the data from here
and it sent it to a new destination.
So whatever was in there,
it just got rewritten with the data point.
So then you can change that line independently.
You'd come here and just like any of your data sets,
like, if you look at these,
the symbol property that says none, there's no symbols.
It's all just a line and the line's straight.
So if you change this, like, left stairs, whatever that is,
you'll see one of those got changed.
I don't know which one it was, right?
It might be easier just to change the color.
We'll do straight and we'll make it
turn something ridiculous like magenta, right?
So it made that one right there change.
But if you wanted to actually, you know,
it did assign values.
You can make the values appear,
but since it's a regression,
it probably makes sense to not show it with values, markers,
and just show it with a fitted line.
So very easy tool for doing that.
Pick whatever colors or fonts or however you want it.
You can make these really easily into linear
versus log or whatever.
You just double click on the axis,
or you could go up here to plot and go to axis properties.
You can choose between linear, logarithmic, reciprocal,
right?
A lot of times in material science,
things are thermally activated,
so we plot them as one over T.
This is a really simple way to do that.
You can have multiple axes, right?
You could have one showing a real temperature
and then you have the reciprocal axis on the top one
to make it just easier to interpret.
This is the best tool for doing that.
It's just way easier than trying to
wing it by hand and draw those in and paint or PowerPoint
or whatever abomination people do, right?
This is the way to go for sure.
Other stuff?
Other questions?
Does this interpolate?
I'm sure it does.
I've never used that function.
I've never done the interpolation.
Oh yeah, it says it does it.
I have not used that before.
So for what it's worth, it's there.
This is, if you ever want to learn more about Qt Grace,
you can't figure out how to do something,
it comes from a software in Linux,
that's why it's freely available, called XM Grace.
So if you Google XM Grace, it tells you how to do everything
and that's where you can learn how to use Qt Grace.
Ah, special characters.
So the new Qt Grace is far better for that.
Like let's say for your axis that you needed this
to be like beta or something.
You can, there is a terminology for making that say beta
and in the old version of Qt Grace,
it was so complicated that I never do it.
I just export this with, I can write beta there
and in Illustrator, I turn it into beta symbol
very, very easily.
In the new Qt Grace, it uses LaTeX,
no, not LaTeX, right?
So anybody use LaTeX in here?
LaTeX is, it's another way of writing documents.
Don't learn how, if you haven't learned already.
Your advice is not making you, I don't know if it's working.
But you can, this, the new Qt Grace,
it says LaTeX notation here.
So you can put your number sign,
you can write forward slash beta
and it will create a beta symbol.
The old Qt Grace won't do that, the new one will.
Yeah, I've done it before and then I realized
like it was taking me more time
to try and make it look right here
than it was worth because it's so easy.
Once I export it here, if I want this to be like an alpha
for whatever reason, then I just change it to symbol.
There it goes, right, and you have an alpha.
Like it's just, it couldn't be easier.
It's way better than trying to do it another way, right?
What else?
What else is useful with figures?
Anybody have challenges with figures that they don't like?
Like something that makes it hard?
How about this?
Another common thing with x-ray diffraction,
we've only got a few minutes left,
we should, I don't have it up yet.
Or no, I think where I have one plotted.
Close some things, computer cannot handle all this stuff.
So let's go to Scholar, Ram Seshadri, diffraction.
When you show x-ray diffraction patterns,
it's useful to do the following.
Synthesis, hopefully this will help.
This is harder than it should be.
Let's go to Scholar.
Okay, this one should have it.
How would you make a figure like the one they have here,
don't be a paywall, with diffraction?
Hopefully it has it, yeah, perfect.
It's oftentimes really nice when you show diffraction data
to show where you expect peaks to be.
So in GSAS, you remember we did this, right?
GSAS created, basically it showed you tick marks
from where you expect the phases to be.
That can be very useful for interpreting
where data is that you expect,
whereas, as opposed to an impurity.
So this was created in Qt Grace.
So what are their steps here?
How would you go about making this?
Here they've got multiple data sets.
They've got the raw data, they've got a fit to the data.
The fit to the data, you want to connect to the line
that don't have markers.
The raw data, you always show with markers.
That's conventional, you should always show the markers
for your actual raw data.
They've got the difference between these two.
If you take blue minus yellow at any given point,
the background curve, so you can do a line there.
It's not actually raw data, it's processed data, right?
They've done the same thing for some other data set.
And then they've got that line up there
showing where all your peaks are at.
So how do you generate that one?
In Qt Grace, it's called a, so you go to import data.
And instead of interpreting it as XY data,
you tell it that it is a bar, right?
And now it's just gonna take,
it's only gonna look for one value.
It doesn't look for two, right?
I don't know.
If, you might need to give it two.
One is the exponential,
one is how high you want the bar to be.
I think it is still a two value, right?
But you can send that, and then what he's done
to make that nice figure, he's brought it in as a bar,
so you've got lines at every single point.
And then for the y-axis, he just shrunk it down
to some small thing.
He didn't put any ticks or labels on it
and made sure the bar value
was larger than the value there, right?
So you can indicate exactly where things are at.
Again, this all does take more time and effort
than just Excel.
But the product is something a lot nicer than just Excel.
These look like really well-done plots
that show, I don't care what you're on,
and it makes it easy to interpret
whatever you're trying to show.
Like take, for example here,
this is X-ray and neutron of the same sample.
X-ray and neutron are rarely, if ever,
going to get the same wavelength, right?
So when you go from like 10 to 90,
it's totally different things.
Going from 10 degrees to 90 degrees
if you don't have the same wavelength
are gonna look like two totally different plots.
But here, he's chosen to plot it in Q-space,
in reciprocal space, right?
And by doing that, they line up exactly
because this has to do with where
the person structured that.
So you can tell that there's some difference
in the structure because he's made them line up nicely,
whereas most people would just plot these
both from 10 to 90 or wherever they plotted
without really caring about how easier or not it is
to interpret the data.
This is just a much better way to do it.
Okay, any other questions people have on nice figures,
how to make figures?
Questions on Illustrator, teacher grades, anything?
This was a lot to go through.
If you think that you even might be kind of interested
in using this but you need help in the future,
swing by my office.
If I happen to be busy, I'll put you in touch
with Marcus or Christian or somebody
who's quite good at this and there's no reason
not to learn how to, if you're interested
in learning how to make nice figures.
Okay, that's it for today, then.

