Mit einem node-Befehl eine Beschriftung platzieren?
Ich würde gerne eine Beschriftung innerhalb meines Diagrammes vornehmen. Meine Lösung ist eher eine unsaubere Lösung -> siehe Code.
Der Wert 18 soll sich auf das kleine schwarze Rechteck beziehen. Die Position der "18" soll in etwa die Position wie in meinem Code besitzen. Könnte man irgendwie global meinen Style der der Achsenbeschriftung festlegen (inkl. der 18)? Zb: Bold oder mit grauen Hintergrundfarbe?
    \begin{filecontents}{3.dat}
    amplitudea	countb
    106.62	1
    106.62	50045
    94.2741	50045
    92.5907	100090
    92.0295	300266
    89.7849	500442
    89.2237	700618
    82.4899	750662
    72.9502	950838
    71.8279	1000882
    69.0221	1050927
    62.2883	1100971
    60.6048	1151015
    59.4825	1351191
    58.9213	1401235
    58.3602	1451279
    57.799	1501323
    57.2379	1701499
    55.5544	1901675
    53.3098	2101851
    51.0651	2151895
    48.8205	2402115
    48.2594	2452159
    48.2594	2652335
    47.1371	2702379
    46.5759	2752424
    44.3313	2952600
    43.7701	3002644
    43.209	3202820
    38.1586	3402996
    35.3528	3453040
    34.7916	3653216
    33.1082	3703260
    32.547	3903436
    31.9859	4103612
    31.4247	4303788
    31.4247	4503964
    29.7412	4704140
    29.7412	4904316
    29.1801	5104492
    29.1801	5304668
    29.1801	5354712
    28.0578	5554888
    26.9355	5604932
    26.9355	5855152
    26.9355	6055328
    26.3743	6105372
    26.3743	6305548
    26.3743	6505724
    26.3743	6555769
    25.8132	6655857
    25.8132	6856033
    25.8132	7056209
    25.252	7306429
    25.252	7356473
    24.6908	7556649
    24.1297	7756825
    24.1297	7806869
    24.1297	7856913
    23.5685	7957001
    23.0074	8007045
    23.0074	8207221
    23.0074	8407397
    23.0074	8607573
    23.0074	8657617
    22.4462	8907837
    22.4462	9158057
    21.8851	9608453
    21.8851	9808629
    21.3239	10008805
    21.3239	10208981
    21.3239	10409157
    20.7628	10609333
    20.7628	10809509
    20.7628	10909597
    20.2016	10959641
    19.6404	11159817
    19.6404	11359993
    19.0793	11560169
    18.5181	11760345
    18.5181	12010565
    18.5181	12260785
    \end{filecontents}
    \documentclass{article}
    \usepackage{pgfplots}
    \pgfplotsset{compat=1.8}
    \usetikzlibrary{patterns}
    \begin{document}
    \begin{tikzpicture}
      \begin{semilogxaxis}
        [
            enlarge x limits=false,
            no marks,
            grid=none,
            xmin=1e4, xmax=1e8,
            ymin=0, ymax=150,       
            title= Amplituden Spektrum $\sigma_{x}$,
            ylabel={$\sigma_{a}$},
            xlabel={$N$},    
            grid =none, %Hauptgitter grid = minor, %
            extra y ticks  = {35},
            %extra y tick labels  = {}, %Beschriftung weg
            samples=50, %Function (red curve)
            domain=0.125:1e6, %Function (red curve)  
         ]
         
        \addplot+[const plot] table[x=countb,y=amplitudea] {3.dat}; %step stairs 
        \addplot+[draw=red,mark=none,domain=1e5:1e6,dashed] {100*(1e6/x)^(1/5)}; 
        \draw[orange,dashed] ({axis cs:50045,0}|-{rel axis cs:0,1}) -- ({axis cs:50045,0}|-{rel axis cs:0,0});
        \draw[dashed,green] ({rel axis cs:1,0}|-{axis cs:0,34.385735235}) -- ({rel axis cs:0,0}|-{axis cs:0,34.385735235});          
        \draw [draw=black] (rel axis cs:0,0) rectangle (axis cs:100000,18.385735235);
        \addplot+[domain=1e6:1e7,no marks] {100};
        
        %********
        \draw [black,very thick](axis cs:1e4,0) -- (axis cs:1e4,18.385735235)
        node[pos=1,below right,green] {$18$};  % Vertikale Linie
        %********
        
    \end{semilogxaxis}
    \end{tikzpicture}
    \end{document}