# New reason to add customizable label placement

OlyDLG shared this idea 6 months ago
Declined

Hi! A while ago (searching my name didn't reveal the thread, which is rather troubling) I posted a request/suggestion that greater, more precise control of the placement of automatically generated labels be added; it was "shot down" on the grounds that one can achieve custom placement of text using the Text command. Although I thought and think this is "deficient," because one of the nice things about the automatic label placement is that, if you select Value for the Label of an Object that GeoGebra calculates a numerical value of, e.g., an area or length, I think it's more "intellectually honest" to have GeoGebra automatically display that calculated value, as opposed to the user having to transcribe that value into a Text command, I didn't press the issue at the time because I was finding that, most of the time, I was able to "drag" the Label to an acceptable position within the programs limits, and only infrequently needed to "cheat" with the Text command. However, I've started plotting normal probability graphs, and I've found that Integral(f,-infinity,z) correctly calculates--and shades!--the area, but the automatically generated label is nowhere to be found. I figured out that this appears to be due to the placement algorithm using the left integration limit to determine the x coordinate at which to place the Label, and clearly this won't do when the left integration limit is -infinity; it prevents one from even being able to "click-and-drag" the label to someplace more acceptable! Now, I know my "complaint" is still subject to the same response--just use the Text command to place the computed area where you want it--but I really feel this is, at the very least, a "corner case" failing of the automatic label placement implementation, which, though it might not warrant addition of full-on precise customizability of automatic Label placement (but I think that's warranted anyway), should at least be "handled intelligently," e.g., by checking for this type of situation, and, when it is detected, adjusting the automatic placement accordingly, (e.g., in the case described above, making the default x coordinate of the label the right integration limit instead of the left). However, I really do think that, long-term, GeoGebra would benefit from fully-customizable placement of automatically generated labels.

1

Don’t be troubled! 😆 this is your old post https://help.geogebra.org/t...

And this is my suggestion: have you tried this new syntax of Text command?

Text( <Object>, <Point>, <Boolean for Substitution of Variables>, <Boolean for LaTeX formula>, <Horizontal alignment [-1|0|1]>, <Vertical alignment [-1|0|1]> )

Returns the formula of the object as a text object at the position of the given point. The first Boolean variable determines whether values are substituted to variables (true) or variable names are shown in the text (false). If the second Boolean variable is true, the text is rendered using LaTeX. The values -1, 0, 1 for horizontal and vertical alignment shift the text object from the default position respectively as follows:

• -1: horizontal shift leftwards / vertical shift downwards
• 0: centers the text object horizontally / vertically at the given point
• 1: horizontal shift rightwards / vertical shift upwards

Example: If a = 2 and c = a2, then Text(c, (2, 1), true, true, -1, 0) returns the LaTeX text "4"to the left of (2, 1), and vertically aligned with the point.

1

OK, I that'll do the trick for now, thanks!

Except, I have the LaTeX argument set to true, but the math text is not being italicized the way it is when I use LaTeX in the Label, i.e., I'm getting P(z < -1.96) =, not P(z<-1.96) =. Here's my command: Text("P(z<-1.96)="a,(-1.96,0.03), true,true,0) what am I doing wrong? (Note: I've tried all sorts of variants enclosing different parts in quotes and leaving them out all together, using \$'s, enclosing the text with \math{}, etc., nothing works to get a true math font.)

Yeah, no, the bottom-line, for me anyway, is that the LaTeX interpreter used by the Label functionality is much more intuitive and responsive than what appears to be being used by the Text command: why can't they use the same interpreter? When I enter \$z=-1.96\$ in the Label Caption field, I get exactly what I expect, an italic, serif z, a non-italicized =, an – for the negative sign, and a non-italicized 1.96. If I enter the same thing into the Text command, it doesn't even accept it, if I replace the \$'s with quotes, it accepts it, but nothing is italicized, if I enclose the z in {} and precede it with \mathit, the z is italicized, but not serif, and something like P(z<-1.96)=a just becomes ridiculously excessively unwieldy if I have to enclose just the P and z in {} and precede each separately with \mathit. I take it back, I do not find this to be a useful "workaround," and I still "vote" for simply enabling greater control of Label placement.

1

If you change the Text properties of the text object so that the font is Serif rather than Sans-serif, you should find it italicises everything correctly: