Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Say I have the following function which I would like to plot.

$S(z)=\frac{p.(\alpha_H+z.\alpha_W)}{p.(\alpha_H+z.\alpha_W)+\beta_H+z.\beta_W}$

While I could specify it in the \addplot command, I was just wondering whether there might be a more efficient method where I could label it in some sense (since it is already mentioned in the document) and call it by a macro.

In fact I would like to see how it changes by differing values of the parameters additionally.

share|improve this question

1 Answer 1

There is no way to plot a function which is prepared for math typesetting. You will need to replicate the function by means of something like

\pgfmathdeclarefunction{S}{1}{\valueP * (\alphaH + \valueZ * \alphaW) / (\valueP*(\alphaH + \valueZ * \alphaW) + \betaH + \valueZ * \betaW)}

with

\def\alphaH{4}
\def\alphaW{5}
...

you can also declare a function with more than one argument instead of defining constants.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.