i tried to configure my own custom y-axis for a little more advanced axis (norm probability plot, for the result look at the linked png) :
http://img5.fotos-hochladen.net/uploads/labelmisaligned2cd86m4qov.png
the tick mode is set to 'manual'. I want the tick lines to direct inwards, which looks sometimes a little more 'professional' in plots for scientific topics). so i set the TickLength property to -0.5 (but the issue does not depend on the direction). there is no "inwards" property, at least i couldnt find one, so i tried this idea, which worked for the tick lines. With this configuration the tick labels are not anymore properly aligned with the axis (see image). so i played a little with the anchor and position properties. the position property of an individual tick is set by
tick.Label.Position = new Vector3(2f, 0, 0);
The problem is, this property has no effect. so i searched in the original source code for the code that causes this problem and i found it. the position property is overwritten all the time the axis is constructed by some values that only depend on the origins of the "world" and the positions of the tick lines. the custom position setting is erased.
so my question is:
- is this behaviour intended or a bug?
- and if it is no bug, how can i allign my axis tick label so that it is well alligned with the axis line ?
To wrap it up: The position property of the ticks label has no effect. The automatic text alignment is 'ok' when i use the standard tick direction (although it would be nice to have the ability to control the text to axis distance and the right/left alignment of the text itself (text block alignment) even for this case). If i want to change the label to axis position it does not work. I think for professional looking plots those formating features are essential.
ConfigureAxis method in ILAxis.cs overwrites all label positions in the following foreach block:
foreach (ILTick tick in Ticks) {
float curVal = tick.Position - min;
Vector3 curPos = startWorld + a * curVal;
tickPosArr[i++] = curPos.X; tickPosArr[i++] = curPos.Y; tickPosArr[i++] = curPos.Z;
if (Ticks.TickLength < 0)
tick.Label.Position = curPos;
curPos += (tickDirWorldStartLines + ticka * curVal);
tickPosArr[i++] = curPos.X; tickPosArr[i++] = curPos.Y; tickPosArr[i++] = curPos.Z;
if (Ticks.TickLength >= 0)
tick.Label.Position = curPos;
cheers,
andré
edit:
as mentioned in my comments i found a "work around" by using the anchor property
http://www.fotos-hochladen.net/uploads/unbenanntcs7kreytib.png