last day (14 days later) » 

02:49
Hello. Do you want to continue discussing your question here?
03:09
Hello
Yes, I edited to show the issue in M9/OSX10.8
@alancalvitti. Above shows what I see from your code.
The "g" descends lower than the "h"
?
@alancalvitti. Of course, they have the same base line. Descenders go below the baseline.
Compare that to the original though, descenders are shifted upward - I should have been clearer
I edited my Q again to show the distinction
Do you see how in the big graphic, the descenders are shifted upward?
I see that. How was that plot made? It's not a simple Graphics expression
03:13
Module[{color1 = Darker@Darker@Blue},
Graphics[
({ #1, #2[[1]]} &~MapIndexed~
SortBy[q, #[[2, 1]] &]) /. {name_ -> {b_, d_}, y_} :> {color1,
Text[Style[name, FontFamily -> "Helvetica",
FontSize -> 12], {(b + 20), y}, {-1, -0.85}],
Thickness[0.0005], Line[{{b, y}, {d, y}}], PointSize[0.005],
Point[{b, y}], Point[{d, y}]},
ImageSize -> 1000,
AspectRatio -> 1/3,
FrameStyle ->
Directive[{Gray, FontSize -> 18, FontFamily -> "Helvetica"}],
Frame -> {Automatic, None, None, None}
]
]
q = {
"roentgen" -> {1845, 1923},
"lorentz" -> {1853, 1928},
"zeeman" -> {1865, 1943},
"van der waals" -> {1837, 1923},
"starck" -> {1874, 1957},
"einstein" -> {1879, 1955},
"bohr" -> {1885, 1962},
"ehrenfest" -> {1880, 1933},
"born" -> {1882, 1970},
"schroedinger" -> {1887, 1961},
"pauli" -> {1900, 1958},
"de broglie" -> {1892, 1987},
"heisenberg" -> {1901, 1976},
"dirac" -> {1902, 1984},
"jordan" -> {1902, 1980},
"planck" -> {1858, 1947},
"sommerfeld" -> {1868, 1951},
"brillouin" -> {1889, 1969}
The text has been manually shifted upward in the Text directive. The words with letters having descenders get shifted more because the shift is relative to the size of the bounding box of the text.
Ok, interesting. Is there an option to correct for that differential shift?
Not that I know of. Why don't you like it? It keeps the descenders from fouling the time lines. You could put invisible letters with descenders in all the text items to get the same shift on every label.
That's an idea but seems like a hack - why can't it be aligned according to user preference just like the 3rd parameter in Text allows?
I don't like that some names are more distant from their lifeline than others just b/c of the letters in their name
The shift is being done by third argument of Text
03:26
But not uniformly. Don't you think users should be able to specify something like VerticalAlignment -> Baseline versus VerticalAlignment -> Descenders?
It is uniform in the coordinate system the the text offset argument (3rd argument) uses. I would agree that that coordinate system can be a pain, but that's the way been since MMA 1.0.
I agree my invisible character suggestion is a hack, but sometimes you need use a hack.
Ok, better than nothing, though I intend to add additional text to the right of the names. How would you add invisible characters, via Row and Opacity 0?
No. there is function for it, called Invisible
Great, that's new to me. How would you concatenate it to the visible text?
I need to work on that
03:40
Ok. I typically use Row, but haven't tested it. If you find a better way please comment on my Q. Thank m_
The problem such an Invisible strategy introduces is testing for whether strings have descenders to keep the space to the right of the string uniform
I think I'v found a better solution. Will post it in a minute or so.
Try Text[Style[name, FontFamily -> "Helvetica", FontSize -> 12], {(b + 20), y + .35}, {-1, 0}] in your original code.
Ok great, thanks
Seems to work, excellent. Will +1.

last day (14 days later) »