在 Miktex 中使用時繪圖不顯示圖例

在 Miktex 中使用時繪圖不顯示圖例

A 在 Mathematica 中的密度圖為

  ShowLegend[
DensityPlot[Sin[x y], {x, 0, \[Pi]}, {y, 0, \[Pi]}, Mesh -> False, 
PlotPoints -> 30], {ColorData["LakeColors"][1 - #1] &, 10, " 1", 
"-1", LegendPosition -> {1.1, -.4}}]

對應的圖是 在此輸入影像描述

當我將此圖儲存為 .eps 並希望在 Miktex 中使用時

\documentclass[a4paper,pra,preprint]{revtex4}

\usepackage{pstool}
\usepackage{mathptmx}
\usepackage{newtxmath}
\usepackage{epstopdf}
\begin{document}
{\includegraphics[width=0.45\textwidth]{ttc.eps}}
\end{document}

然後生成 .pdf 後我得到以下類型的圖 在此輸入影像描述

從圖中可以清楚看出,缺少圖例「1」。我不知道發生了什麼以及如何解決它。

答案1

您可以在mathematica中將繪圖儲存為pdf檔;例如,「ttc.pdf」。然後將其包含到您的tex檔案中

\includegraphics[width=0.45\textwidth]{ttc.pdf}

相關內容