Browse Source

Added image for color blind

Martin Thoma 11 years ago
parent
commit
6fc736034a

+ 31 - 0
tikz/color-blind-friendly-mesh-colormap/Makefile

@@ -0,0 +1,31 @@
+SOURCE  = color-blind-friendly-mesh-colormap
+DELAY   = 80
+DENSITY = 300
+WIDTH   = 512
+
+make:
+	pdflatex $(SOURCE).tex -output-format=pdf
+	make clean
+
+clean:
+	rm -rf  $(TARGET) *.class *.html *.log *.aux *.data *.gnuplot *.gz *latexmk
+
+gif:
+	pdfcrop $(SOURCE).pdf
+	convert -verbose -delay $(DELAY) -loop 0 -density $(DENSITY) $(SOURCE)-crop.pdf $(SOURCE).gif
+	make clean
+
+png:
+	make
+	make svg
+	inkscape $(SOURCE).svg -w $(WIDTH) --export-png=$(SOURCE).png
+
+transparentGif:
+	convert $(SOURCE).pdf -transparent white result.gif
+	make clean
+
+svg:
+	#inkscape $(SOURCE).pdf --export-plain-svg=$(SOURCE).svg
+	pdf2svg $(SOURCE).pdf $(SOURCE).svg
+	# Necessary, as pdf2svg does not always create valid svgs:
+	inkscape $(SOURCE).svg --export-plain-svg=$(SOURCE).svg

+ 3 - 0
tikz/color-blind-friendly-mesh-colormap/Readme.md

@@ -0,0 +1,3 @@
+Compiled example
+----------------
+![Example](color-blind-friendly-mesh-colormap.png)

BIN
tikz/color-blind-friendly-mesh-colormap/color-blind-friendly-mesh-colormap.png


+ 28 - 0
tikz/color-blind-friendly-mesh-colormap/color-blind-friendly-mesh-colormap.tex

@@ -0,0 +1,28 @@
+\documentclass[varwidth=true, border=2pt]{standalone}
+\usepackage{pgfplots}
+\pgfplotsset{compat=1.9}
+\usepackage{tikz}
+\usetikzlibrary{calc}
+
+\begin{document}
+    \pgfplotsset{
+        colormap={whitered}{
+            color(0cm)=(white);
+            color(1cm)=(orange!75!red)
+        }
+    }
+    \begin{tikzpicture}
+        \begin{axis}[
+            colormap name=whitered,
+            title=Rectangle from matrix input,
+            colorbar,
+            colorbar style={
+                at={(-0.3,0)},
+                anchor=south west,
+                height=0.6*\pgfkeysvalueof{/pgfplots/parent axis height},
+                title={$f(x,y)$}
+            }]
+            \addplot3[surf,samples=30] {x*y};
+        \end{axis}
+    \end{tikzpicture}
+\end{document}