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?

1 Answer 1


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



% 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" 

axis on top,
\addplot graphics [
] {example-grid-100x100pt};


enter image description here

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

  • I actually came to the same conclusion that generating my diagrams with an external tool was the best solution. Apr 25, 2021 at 7:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .