0

I know that Matlab related questions are not popular on the site but I am sure it can be helpful to a lot of people.

Suppose that one have really large plot generated in Matlab. Lets talk about thousands or even milions of points. It is both not possible and worthy to plot them directly using pgfplots.

Therefore quite simple idea could be to take high resolution figure and save it in defined view angle without axes and under defined view angle with no background color. Like this enter image description here

Then one can be interested in plotting nice line and axes in pgfplots to obtain following enter image description here

But then there is a lot of adjusting which doesnt seems right. enter image description here

It is putted like code to not cover plotted axes

\documentclass[]{standalone}
\usepackage{tikz,pgfplots,graphicx}
\pgfplotsset{compat=1.8}
\begin{document}
\begin{tikzpicture}
\draw [help lines] (0,0) grid(7,6);
\draw (4,5) node{\includegraphics[scale=1]{plot_clear.png}};
\begin{axis}
[axis lines=middle,
xmin=-1.5,
xmax=2.5,
ymin=0,
ymax=6.25,
xlabel = $V_{\mathrm{G}_3}\ (\mathrm{V})$,
ylabel = $V_{C}/V_{\mathrm{DD}}$,
xtick = {-1,0},
xticklabels = {$V_{\mathrm{T}} = -1$,$0$},
ytick = {0,2.5,6.25},
view = {1}{-8},
width = 8cm,
]
\addplot3[smooth,ultra thick, blue,table/row sep=\\,]
    table {
        -5.00334      7.5e-09          2.5\\
  -4.79471      7.5e-09          2.5\\
  -4.58258      7.5e-09          2.5\\
  -4.37045      7.5e-09          2.5\\
and so on....

Is there some systematic way how to achieve it easily? I mean, which parameter of PNG is involved in putting node into tikz enviroment?

struct
  • 801
  • ... the question is a little confusing, but I take it that you want some way to easily convert "original 3D coordinate" (in MATLAB) to "TikZ coordinate"? Then you would need to export the "current viewpoint" from MATLAB (the experts are not here) and do the math in TikZ. // You can see yourself how TeX determine where the image is put, right? You explicitly wrote there (4, 5) as the place to put the image and scale=1 as the size. – user202729 Dec 06 '21 at 11:39
  • The pgfplots manual has a rather extensive section about plotting on top of Matlab output (Section 4.3.7 Using External Graphics as Plot Sources, on page 62-73) for both 2d and 3d graphics. Maybe you can find some useful information there. If not, then please edit your question explaining how the approaches described there are different from what you would like to do. – Marijn Dec 06 '21 at 16:05

0 Answers0