transformTick[t : {_, "", _List, _List}] := t;
transformTick[{pos_, label_, length_List, spec_List}] :=
With[{hash = Hash[MakeBoxes[label]]},
Sow["\\psfrag{" <> ToString@hash <> "}{$" <>
ToString[TeXForm[ToString[label, TraditionalForm]]] <> "$}"];
{pos, hash, length, spec}
]
{gr, labels} =
Reap[Show[#,
FrameTicks ->
Map[transformTick,
FrameTicks /. AbsoluteOptions[#, FrameTicks], {2}]] &@
Plot[Null, {x, 0, 10^6}, Frame -> True, PlotLabel -> 10]];