Ben
Ben

Reputation: 342

MATLAB putting negative sign above a number in plot text

So I want to add text to a plot that is a crystal direction. Sounds easy enough, right?

It's easy to do [110], but what if I want to do [-110]? If you are familiar with crystallography, you know that the negative sign should be above the 1. How can I do this?

Upvotes: 1

Views: 136

Answers (1)

nirvana-msu
nirvana-msu

Reputation: 4077

These are called Miller indices. You can use LaTeX in Matlab text command, so it's pretty straight-forward:

figure();
axes();
text(0.5, 0.5, '\([1\bar{1}0]\)', 'Interpreter', 'latex');

enter image description here

You can even do that without LaTeX, but there's no point unless you need to e.g. customise font.

Upvotes: 5

Related Questions