tikzにおいてグラフが消えてしまう件

tikzにおいてグラフが消えてしまう件

- シグマ シグマ の投稿
返信数: 3
winqows7でtexlive2018を利用しております。
ジオジブラでカージオイドを描き、tikzのソースに書き換えて、コンパイルしたところ図が出てこない状況です。座標軸のみ出てきます。
ソースは以下です。

\documentclass[12pt,B5paper,dvipdfmx]{jsarticle}
\usepackage{emathMw}
\usepackage[dvipdfmx]{graphicx}
\usepackage[dvipdfmx]{color}
\usepackage{problem}
\usepackage[notMy]{emath}
\usepackage{emathEy}
\usepackage{answers}
\usepackage{geometry}
\geometry{left=18mm,right=18mm,top=15mm,bottom=20mm}
\usepackage[arydshln,hhline]{emathT}
\usepackage[notMy]{emath}
\usepackage{emathPs}
\usepackage{emathPp}
\usepackage{emathAe}
\usepackage{latexsym}
\usepackage{amsmath,amssymb}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{url}
\usepackage{bm}
\usepackage{cases}
\usepackage{caption}
\usepackage{ascmac}
\usepackage{framed}
\usepackage{mathptmx}
\usepackage[all]{xy}
\usepackage{amscd}
\usepackage{cases}
\usepackage{array,arydshln}
\usepackage{pgf,tikz,pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\usepackage{tikz-cd}
\usepackage{EMmulticol}
\usepackage{EMminipages}
\usepackage{setspace}
\usepackage{makeidx}
\usepackage{float}
\usepackage{listings}
\usepackage{here}
\usepackage{wrapfig}
\usepackage{comment}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{intersections, calc}
\usepackage{tkz-fct}

%\pagestyle{empty}



%\renewcommand{\thesection}{第\arabic{section}講}
\begin{document}
\section{}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\begin{axis}[
x=1cm,y=1cm,
axis lines=middle,
xmin=-6.429246353231667,
xmax=7.210390018180169,
ymin=-3.502886160451246,
ymax=4.365207965460359,
xtick={-6,-5,...,7},
ytick={-3,-2,...,4},]
\clip(-6.429246353231667,-3.502886160451246) rectangle (7.210390018180169,4.365207965460359);
\draw[line width=4pt, smooth,samples=100,domain=0:8] plot[parametric] function{2*cos((t))-cos((2*t)),2*sin((t))-sin((2*t))};
\end{axis}
\end{tikzpicture}
\end{document}

簡単な三角形などであればジオジブラで書いたものが普通に反映されます。なにかパッケージが足りないのでしょうか?
ご教示頂ければ幸いです。














簡単な三角形などのずであれば
シグマ シグマ への返信

Re: tikzにおいてグラフが消えてしまう件

- 和田 勇 の投稿
当方 emath 関連パッケージをもっていないので tikz pgf 関連のみ有効雨にして検証しました。

検証の際に利用したファイル名を XXX.tex とした場合、
XXX.pgf-plot.gnuplot というファイルが生成されると同時に
以下のようなメッセージがログに記録されていませんか?

  Package pgf Warning: Plot data file `XXX.pgf-plot.table' not found. on input line nn.


ということで texdoc tikz あるいは texdoc pgfmanual を gnuplot で調べると

  7.6 Plots and Charts
  22 Plots of Functions
  22.1 Overview

あたりにヒントが有り、gnuplot や MATHMATICA 云々の記述有りますが gnuplot に限定してさらに調べると

  22.6 Plotting a Function Using Gnuplot

で --shell-escape を利用するか gnuplot コマンドを使ってマニュアルで作成云々と書かれています。

ですので gnuplot コマンドがインストールされているという前提でですが
  platex --shell-escape XXX.tex
するか
  platex XXX.tex
  gnuplot XXX.pgf-plot.gnuplot
  platex XXX.tex
のようにしてから dvipdfmx すると表示されると思います。

PS もう一つ以下の警告メッセージが表示されます。

  Package pgfplots notification 'compat/show suggested version=true': document has been generated with the most recent feature set (\pgfplotsset{compat=1.16}).

 気になるのであれば \pgfplotsset{compat=newest,compat/show suggested version=false} をプリアンブルに書き込めば表示されなくなります。
シグマ シグマ への返信

Re: tikzにおいてグラフが消えてしまう件

- 飯島 徹 の投稿
和田 勇さんの別解として

\draw[line width=4pt, smooth,samples=100,domain=0:8] plot[parametric] function{2*cos((t))-cos((2*t)),2*sin((t))-sin((2*t))};



\draw[line width=4pt,samples=100,domain=0:360,variable=\t]plot({2*cos(\t)-cos(2*\t)},{2*sin(\t)-sin(2*\t)});

とすると -shell-escape も gnuplot も使わず描画できます。