Adding text to plot that is a crystal direction

Hey, 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?

1 Kommentar

Star Strider
Star Strider am 10 Jan. 2017
I doubt many here are familiar with crystallography. (I’m not.) Do you have an open-source (not behind a paywall) reference so we can possibly understand what you’re doing?

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Jan. 2017

1 Stimme

text(xpos, ypos, '$\stackrel{-}{1} 1 0$','interpreter','latex')
or '$\bar{1} 1 0$' or '$\overline{1} 1 0$'
The shortest line is with \bar, then \stackrel, and \overline is longest.
The gap between the line and the digit appears to be smallest with \bar, then \overline, and largest with \stackrel
I find the \stackrel version easiest to read.

8 Kommentare

How would I incorporated this into thetaticklabels? I tried, but you have commas between, when then moves on to the next label. Sorry, I should have originally asked for that. I need it to work within thetaticklabels. And the following does not work:
thetaticklabels({'$\stackrel{-}{1} 1 0$','interpreter','latex'})
Example:
polarplot(1:5,rand(1,5));
ax = gca;
ax.ThetaAxis.TickLabelInterpreter = 'latex';
ax.ThetaTickLabel = {'$\stackrel{-}{1} 1 0$', 'second label', ...}
In this example you would have to provide all of the theta axis tick labels specifically.
Another example:
polarplot(1:5,rand(1,5));
ax = gca;
ax.ThetaAxis.TickLabelInterpreter = 'latex';
ax.ThetaAxis.TickLabelFormat = '$\\stackrel{-}{%g} 0 1$'
In this example, you would provide a rule for formatting the labels based upon the theta (which will be substituted into the %g position.)
Benjamin Cowen
Benjamin Cowen am 11 Jan. 2017
Bearbeitet: Benjamin Cowen am 11 Jan. 2017
How can I have two overlay signs next to each other? This does not work:
$\overline{1} $\overline{1}0$]
Which form was suitable for your purpose? Are you referring to the space between the overbared first digit and the second coordinate? Are any of the coordinates two digit (or more)?
Reminder: we can only answer the questions you ask, and you did not express anything about spacing or about what to do with multiple digits for the coordinates.
I also remind you that just saying that the space is too large does not provide any information to other readers about what space would be acceptable, so unless you wanted us to engage our mind reading abilities, you were blocking anyone else from giving an effective answer. Giving specifications would have been something we could have acted on (other than just replying back with "So what is that supposed to mean?" )
I fixed the spacing using overline. I am still having difficulty getting this to work for all cases. How would I get this to work for say the following:
[0 -1 0]
or
[-1 -1 0]
The $ should be at the beginning and end but not in the middle. They work as paired delimiters telling the interpreter to turn on or off some processing.
I see, that makes sense. One last question if you don't mind - The spacing looks nice for all of the ones that use the LATEX. But I have some crystal directions that are just [100] and it looks really cramped. How can I apply the LATEX to this without using overline?
Put $ pair around the text perhaps?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by