pgfplots: ArrayPlot mit 3 Farben

Tabellen und Grafiken erstellen und anordnen


dima

pgfplots: ArrayPlot mit 3 Farben

Beitrag von dima »

Hallo zusammen,

ich will mit pgfplots ein Diagramm ähnlich dem ArrayPlot von Mathematica erstellen. (Beispiel von Mathematica findet ihr hier: http://reference.wolfram.com/mathematic ... yPlot.html)

Zuerst wird ein Diagramm mit einer Punktwolke mit 'extra x/y ticks' in mehrere Kästchen aufgeteilt.

Abb. 1: Beispiel für 20x20 = 400 Kästchen:
Bild
\begin{tikzpicture}
\pgfplotsset{
        xmin=0,
        xmax=1,
        ymin=0,
        ymax=1,
        ytick={0,0.2,...,1},
        xtick={0,0.2,...,1},
        extra x ticks={0,0.05,...,1},
        extra y ticks={0,0.05,...,1},
        extra tick style={grid=major},
        extra x tick labels=\empty,
        extra y tick labels=\empty
    }
\begin{axis}[my_style_axis]
        
    \addplot+[
        my_style_plot,
        mark options={fill=blue!40,draw=blue!40}
    ] 
    table[x=Temperatur,y=Volume] {daten.dat};
            
\end{axis}
\end{tikzpicture}
Mein Ziel ist die einzelne Kästchen in der Abb. 1 nach folgenden Regeln einzufärben:
- keine Punkte: weiss
- ein Punkt: grau
- zwei und mehr Punkte: schwarz

Wie kann ich so ein Diagramm mit pgfplots darstellen?
Ist es möglich mit pgfplots die Farbe in den einzelnen Kästchen anhand der Punktwolke automatisch zu ermitteln?

Vielen Dank im voraus für die Hilfe!

Viele Grüße,
Dima

dima

Beitrag von dima »

Hallo zusammen,

Bild

leider habe ich dafür noch keine Lösung gefunden.
Wie kann ich mit Tikz oder PGFPlots ein ähnliches Diagramm erstellen?

dim

Beitrag von dim »

Hallo,

damit die Frage nicht ohne Antwort bleibt:

eine Antwort habe in einem anderen Forum gekriegt:
http://mrunix.de/forums/showthread.php?t=70329

Vllt. hilft das jemanden.

Antworten