TransWikia.com

Plotting functions using domain coloring

TeX - LaTeX Asked by Burakumin on July 23, 2021

I’m trying to plot functions using domain colouring that I’d like to combine with tikz visual items (like arrows and curves). I’ve browsed through both tikz and pgfplots documentations but I could not find any other answer than abusing addplot3 command which seems both overkill and super slow (actually the doc itself suggests to refrain from using it for sophisticated plots). The functions I’m dealing with are scalar field over the plane and I want a flat 2D representation. Am I missing a more appropriate command? Or by any chance is there some well-known package for this specific purpose?

One Answer

Not sure if this is what you are looking for but you can use existing diagrams and import them in pgfplpots. Then you can use the normal tikz commands and pgfplots commands to prettify your plot.

This plot type allows to extend the plotting capabilities of pgfplots beyond its own limitations. The idea is to generate the graphics as such (for example, a contour plot, a complicated shaded surface9 or a large point cluster) with an external program like Matlab or gnuplot. The graphics, however, should not contain an axis or descriptions. Then, we use includegraphics and a pgfplots axis which fits exactly on top of the imported graphics

-- Taken from the pgfplots manual: 4.3.7 Using External Graphics as Plot Sources.

enter image description here

documentclass{article}
usepackage{graphicx}

usepackage{pgfplots}
pgfplotsset{width=7cm,compat=1.15}

begin{document}
% See also https://tex.stackexchange.com/questions/231738 for "example-grid-100x100pt"
% See pgfplots manuel "4.3.7 Using External Graphics as Plot Sources" including "Support for External Three-Dimensional Graphics" 

begin{tikzpicture}
begin{axis}[
enlargelimits=false,
axis on top,
]
addplot graphics [
xmin=-3,xmax=3,
ymin=-3,ymax=3,
] {example-grid-100x100pt};
end{axis}
end{tikzpicture}

end{document}

enter image description here

enter image description here -- Taken from the pgfplots manual.

Correct answer by Dr. Manuel Kuehner on July 23, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP