plot3dlatexepspsfrag

PSfrag doesn't work on 3D plot of an eps file


I'm trying to use psfrag for changing text font and size of an eps file including 3D plot made by MATLAB in my journal paper. In this regard, no change is obtained in my journal on Overleaf. Do you have any solutions? I used pdflatex as compiler and I also set these settings in latexmkrc file associated with the project:

    $pdflatex = 'pdflatex --shell-escape';
    $pdf_mode = 1;
    $postscript_mode = $dvi_mode = 0; 

I should denote that other eps files which include 2D plots of MATLAB are correctly changed using psfrag, however this 3D plot eps file doesn't change!

Here is the document class of the article:

\documentclass[a4paper,fleqn]{cas-dc}

Here are the packages where used in the project:

\usepackage[numbers]{natbib}
\usepackage{amsmath,amssymb}
\usepackage{ragged2e}
\usepackage{geometry}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{graphicx}
\usepackage{lineno,hyperref}
\usepackage{psfrag}
\usepackage{pstricks}
\usepackage{auto-pst-pdf}

And here is the code I used for producing the figure:

\newcommand{\picwidd}{50mm}

\begin{figure*}[tp]
   \centering
   \psfrag{Inphase}{Inphase}
   \psfrag{Quadrature}{Quadrature}
   \psfrag{Probability}{Probability}
   \psfrag{0}{$0$}
   \psfrag{0.1}{$0.1$}
   \psfrag{0.2}{$0.2$}
   \includegraphics[width=\picwidd]{uni.eps}
\end{figure*}

And here is the link of the eps file.


Solution

  • It seems all 3D plots made by MATLAB and saved as eps files can not distinguish between the texts on the figure and the figure itself, i.e. when you examine the eps files, you can see that the text is actually included as part of the raster image and not as text. You can't change the text with tex. The best you could do is to cover the text up, e.g. using tikz to draw white boxes and then write it again. [Solution proposed by samcarter_is_at_topanswers.xyz]

    I have an alternative solution that easily can be used, especially if you are not familiar with tikz and looking for a graphical solution: You may use Inkscape as a tool for editting your eps files, add your desired texts to them, and finally save them as a new eps file. Hereby texts in your eps files are recognized by PSfrag and it works well.