Gibt es vielleicht eine Möglichkeit, die Labels wie auf dem Bild zu platzieren? Öffne in Overleaf
%\documentclass[]{article} \documentclass[border=3pt, varwidth]{standalone} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.13} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false, xticklabel pos=right, % x-Achse oben statt unten xlabel = {k}, ylabel = {n}, % hide x axis, hide y axis, % Achsen ausblenden %x = 5mm, y =5mm, % Maßstab ] \addplot[ matrix plot, %mark=*,%nodes near coords=\coordindex, mesh/color input=explicit, ] coordinates { (1,1) [color=red] (2,1) [color=blue] (3,1) [color=yellow] (1,2) [color=black] (2,2) [color=brown] (3,2) [color=magenta] (1,3) [color=green] (2,3) [color=red] (3,3) [color=white] }; \node at (1,1) []{a/b}; \end{axis} \end{tikzpicture} \end{document} gefragt 15 Jan '18, 20:00 cis |
Öffne in Overleaf
\documentclass{article} \usepackage{pgfplots} \pgfplotsset{width=7cm,compat=1.13} \begin{document} \begin{tikzpicture} \begin{axis}[enlargelimits=false, xticklabel pos=right, % x-Achse oben statt unten xlabel = {k}, ylabel = {n}, every axis x label/.style={at={(ticklabel cs:0)},anchor=near ticklabel}, every axis y label/.style={at={(ticklabel cs:1)},anchor=near ticklabel}, % hide x axis, hide y axis, % Achsen ausblenden %x = 5mm, y =5mm, % Maßstab ] \addplot[ matrix plot, %mark=*,%nodes near coords=\coordindex, mesh/color input=explicit, ] coordinates { (1,1) [color=red] (2,1) [color=blue] (3,1) [color=yellow] (1,2) [color=black] (2,2) [color=brown] (3,2) [color=magenta] (1,3) [color=green] (2,3) [color=red] (3,3) [color=white] }; \node at (1,1) []{a/b}; \coordinate (lu) at (yticklabel* cs:1); \end{axis} \draw (lu) -- +(135:1); \end{tikzpicture} \end{document} beantwortet 15 Jan '18, 22:50 Henri Ui, da muss man mal drauf kommen. :)
(16 Jan '18, 00:36)
cis
|