Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Latex 鬣蜥_Latex_Tikz - Fatal编程技术网

Latex 鬣蜥

Latex 鬣蜥,latex,tikz,Latex,Tikz,我正在尝试使用IguanaTeX将一些tikzpicture导入PowerPoint 这是我正在试验的代码: \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=1.7} \begin{document} \begin{tikzpicture}[scale=0.50,local bounding box=picture, baseline=(picture.south), declare function

我正在尝试使用IguanaTeX将一些tikzpicture导入PowerPoint

这是我正在试验的代码:

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}

\begin{document}

\begin{tikzpicture}[scale=0.50,local bounding box=picture, baseline=(picture.south),
    declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);}
]

\begin{axis}[
    samples at={0,...,40},
    yticklabel style={
        /pgf/number format/fixed,
        /pgf/number format/fixed zerofill,
        /pgf/number format/precision=1
    },
    ybar=0pt, bar width=1
]
\addplot [fill=cyan, fill opacity=0.5] {binom(x,40,0.2)}; \addlegendentry{$p=0.2$}
\addplot [fill=orange, fill opacity=0.5] {binom(x,40,0.5)}; \addlegendentry{$p=0.5$}
\end{axis}
\end{tikzpicture}

\end{document}
注意:要使其正确显示,您需要在IguanaTeX中将默认DVI更改为pdflatex

首先,图形出现,但底部出现了一些不必要的空白。因此,生成的图形对于幻灯片来说太大。我怎样才能删除这个

其次,如何将轴等更改为白色,而不是默认的黑色,以便我可以在黑色背景的PowerPoint幻灯片上看到图形?

  • 通过设置
    ymin=0

  • 要将轴、标签、图例等更改为白色,可以进行以下调整:



好极了!非常感谢你@Dan317不客气!
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}

  \pgfplotsset{
    axis line style={white},
    every axis label/.append style ={white},
    every tick label/.append style={white}, 
    every axis legend/.append style={white,fill=black},
    every axis/.append style={tick style={white}}
  }
  
\pagecolor{black}

\begin{document}

\begin{tikzpicture}[scale=0.50,local bounding box=picture, baseline=(picture.south),
    declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);}
]

\begin{axis}[
    samples at={0,...,40},
    yticklabel style={
        /pgf/number format/fixed,
        /pgf/number format/fixed zerofill,
        /pgf/number format/precision=1
    },
    ybar=0pt, bar width=1,
    ymin=0,
]
\addplot [fill=cyan, fill opacity=0.5,draw=white] {binom(x,40,0.2)}; \addlegendentry{$p=0.2$}
\addplot [fill=orange, fill opacity=0.5,draw=white] {binom(x,40,0.5)}; \addlegendentry{$p=0.5$}
\end{axis}
\end{tikzpicture}

\end{document}