我成功地根据这个等式为经济学论文绘制了一组成本曲线:TC=1750+30x+(x^11)/11^19
。
我已经通过绘制表达式完成了此操作,但它留给我的不是一条简单的线,而是一条连接“标记”的线。有没有办法只画出这条线?
此外,如果我将 降低ymax
到 150,就会出现错误Dimensions are Too Big
。同样,当我尝试将曲线乘以 1.2 以模拟 20% 的销售税时,也会出现同样的错误。曲线背后的数学知识很重要,所以我非常想绘制方程式,而不是简单的复制。
\documentclass[11pt, oneside]{article}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{pgfplots}
\begin{document}
\begin{figure}
\begin{tikzpicture}
\begin{axis}[
xmin=0,
xmax=150,
ymax=200,
ymin=0]
\plot expression [
unbounded coords=discard,
/pgfplots/domain=0:200,
/pgfplots/y domain=0:200,
samples=50
] {1750/x+30+x^10/(11^19)};
\plot expression [
unbounded coords=discard,
/pgfplots/domain=0:200,
/pgfplots/y domain=0:200,
samples=50
] {750/x+30+x^10/(11^19)};
\plot expression [
unbounded coords=discard,
/pgfplots/domain=0:200,
/pgfplots/y domain=0:200,
samples=50
] {30+x^10/(11^18)};
%\plot expression [
% red,
% unbounded coords=discard,
% /pgfplots/domain=0:200,
% /pgfplots/y domain=0:250,
% samples=50
%] {1.2*30+1.2*x^10/(11^18))};
\end{axis}
\end{tikzpicture}
\caption{Supply \& Demand}
\end{figure}
\end{document}
答案1
欢迎来到 TeX.SX!
我修复了你的一些设置。
希望这可以帮助
输出
代码
\documentclass[11pt,tikz]{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
[
title={Supply \& Demand},
title style=% set it below
{
at={(current axis.south)},
anchor=north,
outer sep=.9cm,
},
xmin=0,
xmax=150,
ymin=0,
ymax=150,
% we set your preferences globally
domain=0:200,
samples=201,
unbounded coords=discard,
% this takes the marks off from the default style
every axis plot post/.style={mark=none},
]
%I like this syntax better :
\addplot {1750/x+30+x^10/(11^19)};
%
% this shows how to discard the default style (and gets rid of marks)
\addplot [] {750/x+30+x^10/(11^19)};
%
% below, we fix the `dimension too large`=`math overflow` warning
\addplot +[domain=0:130] {30+x^10/(11^18)};
%
%\plot expression [
% red,
% unbounded coords=discard,
% /pgfplots/domain=0:200,
% /pgfplots/y domain=0:250,
% samples=50
%] {1.2*30+1.2*x^10/(11^18))};
\end{axis}
\end{tikzpicture}
\end{document}