I assumed that the following plot for Sin
would be red between .5
and .7
, but it's all blue. Am I misunderstanding what Exclusions
do? The Help is rather uninformative.
Plot[Sin[x], {x, 0, 2 π}, ExclusionsStyle -> Red,
Exclusions -> {.5 < Sin[x] < .7}]
Exclusions
, etc. or even only check?Exclusions
? It's important to read the examples in the document by pressing F1 when using Mathematica. If you check them, you'll probably notice that, what you need isColorFunction
. (A strongly related example can be found in Options section ofPlot
document. ) 2. Why do you mention python'seval
in the title? Is it another question? $\endgroup$Exclusions
is to exclude singularities and documentation shows only equations, not inequalities, and some strings like"Discontinuities"
. To exclude part of a graph, you can use the optionRegionFunction
orConditionalExpression[Sin[x], Not[.5 < Sin[x] < .7]]
, but the excluded domain won't be colored. To color part of a graph, you can useMeshFunctions
andMeshShading
. Can you indicate what you want? $\endgroup$Plot[Sin[x], {x, 0, 2 π}, ColorFunction -> Function[{x, y}, If[.5 < y < .7, Red, Automatic]], ColorFunctionScaling -> False]
, I guess. $\endgroup$eval
is amount toToExpression
of Mathematica, if I understand the document ofeval
correctly. $\endgroup$