当前位置:   article > 正文

c语言中填充不规则图形的颜色,如何用tikz填充不规则图形的颜色

tikz顶点填充颜色fill和边界颜色draw

我准备用tikz画这样的一个图

![](https://wenda.latexstudio.net/data/attach/191031/mwKlzxCG.png)

图中`A`和`B`区域打算用不同的... 显示全部

我准备用tikz画这样的一个图

![](https://wenda.latexstudio.net/data/attach/191031/mwKlzxCG.png)

图中`A`和`B`区域打算用不同的颜色区分,可是该如何用`\fill`(或其他命令)命令实现呢?

目前能做到的代码如下

```tex

\documentclass[UTF8]{standalone}

\usepackage{amsmath,fourier,ctex,tikz}

\begin{document}

\begin{tikzpicture}[domain=-0.3:3]

\draw[-latex] (-0.3,0) node[left=-3pt,below=-2pt] {$O$} -- (2,0) node[below] {$x$};

\draw[-latex] (0,-0.3) -- (0,2) node[left] {$y$};

\draw[domain=0:1.2] plot (\x,{0.5*\x^2}) node[right] {$y = x^{2}$};

\draw[domain=0:0.9] plot (\x,{2*\x^2}) node[right] {$y = 2x^{2}$};

\draw[domain=0:0.62] plot (\x,{3.5*\x^2}) node[above] {$L$};

\draw[dashed] (0.8,2*0.8^2) -- (0,2*0.8^2);

\draw[dashed] (0.8,2*0.8^2) -- (0.8,0);

\fill[domain=0:0.8,fill=gray] (0,0) plot (\x,{0.5*\x^2}) -- (0.8,2*0.8^2) plot (\x,{2*\x^2});

\end{tikzpicture}

\end{document}

```

不知道怎么才能将`y = 2x^{2}`设置为阴影的边界

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/238179
推荐阅读
相关标签
  

闽ICP备14008679号