Skip to content

Instantly share code, notes, and snippets.

@lumeng
Created March 14, 2017 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lumeng/2cb55c140f3234c71c269fb9a99d4b24 to your computer and use it in GitHub Desktop.
Save lumeng/2cb55c140f3234c71c269fb9a99d4b24 to your computer and use it in GitHub Desktop.
WolframLanguageData example
In[3]:= WolframLanguageData["Plot", "DocumentationExampleInputs"]
Out[3]= {"BasicExamples" -> {{Plot[
Sin[x], {x, 0, 6 Pi}]}, {Plot[{Sin[x], Sin[2 x], Sin[3 x]}, {x,
0, 2 Pi},
PlotLegends -> "Expressions"]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
2 Pi}, PlotLabels -> "Expressions"]}, {Plot[
2 Sin[x] + x, {x, 0, 15}, Filling -> Bottom],
Plot[{Sin[x] + x/2, Sin[x] + x}, {x, 0, 10},
Filling -> {1 -> {2}}]}, {Plot[
Evaluate[Table[BesselJ[n, x], {n, 4}]], {x, 0, 10},
Filling -> Axis]}},
"Scope" -> {{Plot[Sin[30 Sin[x]], {x, 0, 10}]}, {Plot[
1/x, {x, -1, 1}]}, {Plot[Sqrt[x], {x, -1, 1}]}, {Plot[
Floor[Sqrt[x]], {x, 0, 100}],
Plot[Floor[Sqrt[x]], {x, 0, 100}, Exclusions -> None]}, {Grid@
Table[Plot[Sin[x], {x, 0, 15}, PlotPoints -> pp,
MaxRecursion -> mr], {mr, {0, 1, 2}}, {pp, {5, 10}}]}, {{Plot[
x^4 - x^2 + 1, {x, -2, 2}],
Plot[x^4 - x^2 + 1, {x, -2, 2},
PlotRange -> {0, 2}]}}, {\[ScriptCapitalD] =
ImplicitRegion[x <= -1 \[Or] x >= 1, {x}];,
Plot[Sin[
x], {x} \[Element] \[ScriptCapitalD]]}, {\[ScriptCapitalD] =
MeshRegion[{{-2}, {-1}, {-1/2}, {1/2}, {1}, {2}},
Line[{{1, 2}, {3, 4}, {5, 6}}]];,
Plot[x^3 + 1, {x} \[Element] \[ScriptCapitalD]]}, {Plot[
Abs[Gamma[z]], {z, -4, 8}, ScalingFunctions -> "Log"]}, {Plot[
Evaluate@Table[Labeled[x^n, x^n], {n, 1, 3}], {x, -3, 3}],
Table[Plot[Labeled[Cos[x], Cos[x], p], {x, 0, 2 Pi},
PlotLabel -> p], {p, {Above, Below, Before,
After}}]}, {Plot[{Sin[x], Sin[2 x]}, {x, 0, 6},
PlotLabels -> {Sin[x], Sin[2 x]}]}, {Plot[
Labeled[Sin[x], "sin(x)", 3], {x, 0, 2 \[Pi]}]}, {Plot[
Labeled[Sin[x], "sin(x)", Scaled[0.25]], {x, 0, 2 \[Pi]}],
Plot[Labeled[Sin[x], Sin[x], {Scaled[0.25], Above}], {x, 0,
2 \[Pi]}]}, {Plot[{Callout[n^Sin[n], n^Sin[n]],
Callout[n, n]}, {n, 0, 20}]}, {Plot[
Callout[n^Sin[n], "label", Above], {n, 1, 10}],
Plot[Callout[n^Sin[n], "label", 2], {n, 1, 10}]}, {Plot[{Sin[x],
Cos[x]}, {x, 0, 2 \[Pi]},
PlotLegends -> {Sin[x], Sin[2 x]}]}, {Plot[{Sin[x],
Legended[Mean[{Sin[x], Cos[x]}], "average"], Cos[x]}, {x, 0,
2 \[Pi]}],
Plot[{Sin[x],
Legended[Mean[{Sin[x], Cos[x]}], Placed["average", Below]],
Cos[x]}, {x, 0, 2 \[Pi]}]}, {Plot[{x^(1/4), x^(3/4), x^(3/2),
x^(7/2)}, {x, 0, 2}]}, {Plot[{x^(1/4), x^(3/4), x^(3/2),
x^(7/2)}, {x, 0, 2},
PlotStyle -> {Thick, Automatic, Red, Dashed}]}, {Plot[{x^(1/4),
x^(3/4), x^(3/2), x^(7/2)}, {x, 0, 2},
PlotStyle -> {Thick, Automatic, Red, Dashed},
PlotLegends -> Automatic]}, {Plot[Sin[x], {x, 0, 2 Pi},
AxesLabel -> {x, y}, PlotLabel -> Sin[x]],
Plot[{x, x^2, x^3}, {x, -2, 2}, PlotLabels -> Automatic]}, {Plot[
Labeled[x^4 - 25 x^2 + 20 x + 15, {"abs max", "abs min",
"rel max", "rel min"}, {Above, Below, 0.5, 3.5}], {x, -5, 5}]
}, {Plot[{Tooltip[Sin[x]], Tooltip[Sin[2 x]]}, {x, 0,
2 Pi}]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
Filling -> Axis]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
PlotTheme -> "Marketing"]}, {Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> 20]}, {Plot[Sin[x], {x, 0, 2 Pi}, Mesh -> 10,
MeshShading -> {Red, None, Blue}]}},
"GeneralizationsExtensions" -> {},
"Options" -> {{{Plot[Sqrt[1 - x^2], {x, 0, 1}],
Plot[Sqrt[1 - x^2], {x, 0, 1},
AspectRatio -> Automatic]}}, {Plot[Sinc[x], {x, 0, 10},
Axes -> False]}, {Plot[Sinc[x], {x, 0, 10},
Axes -> {False, True}]}, {Plot[Sinc[u], {u, 0, 10},
AxesLabel -> Automatic]}, {Plot[Sinc[x], {x, 0, 10},
AxesLabel -> {x, Sinc[x]}]}, {Plot[1/(x - 1) + 2, {x, -2, 4},
AxesOrigin -> Automatic]}, {Plot[1/(x - 1) + 2, {x, -2, 4},
AxesOrigin -> {1, 2}]}, {Plot[Sinc[x], {x, 0, 10},
AxesStyle -> {Directive[Thick, Dashed, Red], Blue}]}, {{Plot[
Im[Zeta[1/2 + I t]], {t, -20, 20}, BaselinePosition -> Axis],
Plot[Re[Zeta[1/2 + I t]], {t, -20, 20},
BaselinePosition -> Axis]}}, {Plot[Sin[x]/x^2, {x, -10, 10},
ClippingStyle -> None]}, {Plot[Sin[x]/x^2, {x, -10, 10},
ClippingStyle -> Automatic]}, {Plot[Sin[x]/x^2, {x, -10, 10},
ClippingStyle -> Red]}, {Plot[Sin[x]/x^2, {x, -10, 10},
ClippingStyle -> {Red, Thick}]}, {Plot[Sin[x]/x^2, {x, -10, 10},
ClippingStyle -> Directive[Red, Thick]]}, {{Plot[
Sinc[x], {x, 0, 10}, ColorFunction -> Function[{x, y}, Hue[y]]],
Plot[Sinc[x], {x, 0, 10},
ColorFunction -> Function[{x, y}, Hue[x]]]}}, {Plot[
Sinc[x], {x, 0, 10}, ColorFunction -> "DarkRainbow"]}, {Plot[
Sinc[x], {x, 0, 10},
ColorFunction -> Function[{x, y}, If[y > 0, Red, Black]],
ColorFunctionScaling -> False, PlotStyle -> Thick]}, {Plot[
Sin[x], {x, 0, 2 Pi}, ColorFunction -> Function[{x, y}, Hue[y]],
Filling -> Axis]}, {Plot[Sinc[x], {x, 0, 10},
ColorFunction -> "DarkRainbow",
PlotStyle -> Directive[Red, Thick]]}, {Table[
Plot[Sin[4 Pi x], {x, 0, 1/2}, PlotStyle -> Thick,
ColorFunction -> Function[{x, y}, Hue[x]],
ColorFunctionScaling -> cf], {cf, {False, True}}]}, {Plot[
Sinc[x], {x, 0, 10},
ColorFunction -> Function[{x, y}, If[y > 0, Red, Black]],
ColorFunctionScaling -> False, PlotStyle -> Thick]}, {Plot[
Sin[2 x], {x, 0, 2 Pi},
ColorFunction -> Function[{x, y}, Hue[x, 1, Abs[y]]],
ColorFunctionScaling -> {True, False},
PlotStyle -> Thick]}, {Plot[Sin[x], {x, 0, 2 Pi},
Epilog -> {PointSize[0.04], Point[{0, 0}], Point[{Pi, 0}],
Point[{2 Pi, 0}]}]}, {Plot[Floor[x], {x, -2, 3},
Epilog -> {Table[Disk[{i, i}, Offset[2.]], {i, -2, 2}],
Table[{EdgeForm[Black], White,
Disk[{i + 1, i}, Offset[2]]}, {i, -2, 2}]}]}, {Reap[
Plot[Sin[x], {x, 0, 10}, EvaluationMonitor :> Sow[x]];] //
Short}, {data =
Reap[ Plot[ Sin[x], {x, 0, 2 Pi},
EvaluationMonitor :> Sow[{x, Sin[x]}]] ][[-1, 1]];,
ListPlot[data , Filling -> Axis]}, {Block[{k = 0},
Plot[Sin[x], {x, 0, 2 Pi}, EvaluationMonitor :> k++]; k]}, {Plot[
Floor[x^2], {x, 0, 5}]}, {Plot[
Im[Sqrt[-1 + I (y + 1)]], {y, -2, 0}]}, {Plot[
Im[Sqrt[-1 + I (y + 1)]], {y, -2, 0},
Exclusions -> None]}, {Plot[Tan[x], {x, -2, 2},
Exclusions -> {-Pi/2, Pi/2}]}, {Plot[1/(x^3 - x + 1), {x, -2, 2},
Exclusions -> {x^3 - x + 1 == 0}]}, {Plot[
Tan[x^3 - x + 1] + 1/(x + 3 Exp[x]), {x, -2, 2},
Exclusions -> {Cos[x^3 - x + 1] == 0,
x + 3 Exp[x] == 0}]}, {Plot[Floor[Tan[x]], {x, -2, 2},
Exclusions -> {Automatic, Cos[x] == 0}]}, {Plot[
Tan[x], {x, 0, 10}, Exclusions -> {Cos[x] == 0},
ExclusionsStyle -> Dashing[Small]]}, {Plot[Floor[x], {x, 0, 5},
ExclusionsStyle -> {None, Black}]}, {Table[
Plot[Sin[x], {x, 0, 2 Pi},
Filling -> f], {f, {Axis, Top, Bottom, 0.3}}]}, {Plot[{Sin[x],
Cos[x]}, {x, 0, 2 Pi},
Filling -> Axis]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
Filling -> {1 -> Axis}]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
Filling -> {1 -> {2}}]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
Filling -> {1 -> {{2}, Yellow}}]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
2 Pi},
Filling -> {1 -> {1/2, Yellow}}]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
2 Pi}, Filling -> {1 -> {{2}, {Yellow, Green}}}]}, {Table[
Plot[Sin[x], {x, 0, 2 Pi}, Filling -> Axis,
FillingStyle -> c], {c, {Red, Green, Blue,
Yellow}}]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
Filling -> Axis,
FillingStyle -> Directive[Opacity[0.5], Orange]]}, {Plot[
Sin[x], {x, 0, 2 Pi}, Filling -> Axis,
FillingStyle -> {Red, Blue}]}, {Plot[Sin[x], {x, 0, 2 Pi},
ColorFunction -> Function[{x, y}, Hue[y]], Filling -> Axis,
FillingStyle -> Automatic]}, {Plot[Sin[1/x], {x, 0.001, 0.1},
Mesh -> All]}, {Table[
Plot[Sin[1/x], {x, 0.001, 0.1}, MaxRecursion -> i, Mesh -> All,
Ticks -> None], {i, {0, 3, 6}}]}, {{Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> Full],
Plot[Sin[x], {x, 0, 2 Pi}, Mesh -> All]}}, {Plot[
Sin[x], {x, 0, 2 Pi}, Mesh -> 20]}, {Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> {Range[0, 2 Pi, Pi/4]},
MeshStyle -> PointSize[Medium]]}, {Table[
Plot[Tan[x], {x, 0, Pi/2}, MeshFunctions -> {f},
Mesh -> 20], {f, {Function[{x, y}, x],
Function[{x, y}, y]}}]}, {Plot[Tan[x], {x, 0, Pi/2},
Mesh -> {5, 10}, MeshFunctions -> {#1 &, #2 &},
MeshStyle -> {Directive[PointSize[Medium], Red], Blue}]}, {Plot[
Sin[x], {x, 0, 2 Pi}, Mesh -> 10, MeshFunctions -> {#1 &},
MeshShading -> {Red, Blue}]}, {Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> 10, MeshFunctions -> {#1 &},
MeshShading -> {Red, None}]}, {Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> 10, PlotStyle -> Thick, MeshFunctions -> {#1 &},
MeshShading -> {Red, Blue}]}, {Plot[Sin[x], {x, 0, 2 Pi},
Mesh -> 10, PlotStyle -> Green, MeshFunctions -> {#1 &},
MeshShading -> {Red, Blue}]}, {Plot[Sin[x], {x, 0, 10},
Mesh -> 10, PlotStyle -> Directive[Thick, Yellow],
MeshFunctions -> {#1 &},
MeshShading -> {Red, Automatic}]}, {Plot[Sin[x], {x, 0, 10},
Mesh -> 10, PlotStyle -> Thick, MeshFunctions -> {#1 &},
MeshShading -> {Black, Automatic},
ColorFunction -> Function[{x, y}, Hue[x]]]}, {Plot[
Sin[x], {x, 0, 2 Pi}, Mesh -> 10,
MeshStyle -> Automatic]}, {Plot[Sin[x], {x, 0, 2 Pi}, Mesh -> 10,
MeshStyle -> Red]}, {Plot[Sin[x], {x, 0, 2 Pi}, Mesh -> 10,
MeshStyle -> {Red, Blue}, MeshFunctions -> {#1 &, #2 &}]}, {Plot[
Sin[x], {x, 0, 2 Pi}, Mesh -> 10,
MeshStyle -> Directive[PointSize[Large], Red]]}, {Timing[
Plot[Sin[1/x], {x, 0, .01},
PerformanceGoal -> "Quality"]]}, {Timing[
Plot[Sin[1/x], {x, 0, .01}, PerformanceGoal -> "Speed"]]}, {Plot[
Exp[x], {x, 0, 3},
PlotLabel -> "exponential function"]}, {Plot[{Sin[x],
Cos[x]}, {x, 0, 2 \[Pi]},
PlotLabels -> {"sine", "cosine"}]}, {Plot[{Sin[x], Cos[x]}, {x,
0, 2 \[Pi]}, PlotLabels -> Placed[{"sine", "cosine"}, Above]],
Plot[{Sin[x], Cos[x]}, {x, 0, 2 \[Pi]},
PlotLabels -> {Placed["sine", Below],
Placed["cosine", Above]}]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
2 \[Pi]},
PlotLabels -> "Expressions"]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
2 \[Pi]},
PlotLabels -> {Callout["sin", {Scaled[0.25], Above}],
Callout["cos", {Scaled[0.5], Below}]}]}, {Plot[{Sin[x],
Cos[x]}, {x, 0, 2 \[Pi]},
PlotLabels -> {"sine", None}]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
10}]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 10},
PlotLegends -> "Expressions"]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
10}, PlotLegends -> "Placeholder"]}, {Plot[{Sin[x], Cos[x]}, {x,
0, 10},
PlotLegends -> {"one", "two"}]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
10}, PlotStyle -> {Red, Blue},
PlotLegends -> "Placeholder"]}, {Plot[{Sin[x], Cos[x]}, {x, 0,
10}, PlotStyle -> {Red, Blue},
PlotLegends -> Placed["Placeholder", Below]],
Plot[{x, Sqrt[x]}, {x, 0, 5}, PlotStyle -> {Red, Blue},
PlotLegends ->
Placed["Expressions", {0.25, 0.75}]]}, {Plot[{Sin[x],
Cos[x]}, {x, 0, 10},
PlotLegends ->
LineLegend["Expressions", LegendFunction -> Frame]]}, {Table[
Plot[Sin[x], {x, 0, 2 Pi}, PlotPoints -> i,
MaxRecursion -> 0], {i, {5, 10, 15, 25}}]}, {Plot[
Sqrt[x], {x, -5, 5}, PlotRange -> Full]}, {Plot[
Sqrt[x], {x, -5, 5}, PlotRange -> Automatic]}, {Plot[
Sqrt[x], {x, -5, 5}, PlotRange -> 2]}, {Plot[1/x, {x, -2, 2},
Frame -> True]}, {Plot[1/x, {x, -2, 2}, Frame -> True,
PlotRangeClipping -> False]}, {Table[
Plot[Sin[x], {x, 0, 2 Pi},
PlotStyle -> ps], {ps, {Red, Thick, Dashed,
Directive[Red, Thick]}}]}, {Plot[{Sin[x], Sin[2 x],
Sin[3 x]}, {x, 0, 2 Pi}]}, {Plot[{Sin[x], Sin[2 x],
Sin[3 x]}, {x, 0, 2 Pi},
PlotStyle -> {Red, Green, Blue}]}, {Plot[Sin[x], {x, 0, 2 Pi},
PlotStyle -> Thick,
ColorFunction -> Function[{x, y}, Hue[y]]]}, {Plot[
Sin[x], {x, 0, 2 Pi},
PlotStyle -> Directive[Opacity[0.5], Thick], Mesh -> 10,
MeshFunctions -> {#1 &}, MeshShading -> {Red, Blue}]}, {Plot[
Sin[x], {x, 0, 2 Pi}, PlotStyle -> Red,
Mesh -> All]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
PlotTheme -> "Business"]}, {Plot[{Sin[x], Cos[x]}, {x, 0, 2 Pi},
PlotTheme -> "Business", PlotStyle -> 96]}, {Plot[
Sin[x], {x, 0, 8 Pi},
RegionFunction ->
Function[{x, y}, Pi/2 < Mod[x, 2 Pi] < 3 Pi/2]]}, {Plot[
Sin[x], {x, 0, 8 Pi},
RegionFunction -> Function[{x, y}, Abs[y] > 0.5]]}, {Plot[
x^2, {x, 0, 10}]}, {Plot[x^2, {x, 0, 10},
ScalingFunctions -> "Log"]}, {Plot[x^2, {x, 0, 10},
ScalingFunctions -> "Reverse"]}, {Plot[x^2, {x, 1, 10},
ScalingFunctions -> "Reciprocal"]}, {Plot[x^2, {x, 0, 10},
ScalingFunctions -> {"Reverse", "Log"}]}, {Plot[x^2, {x, 0, 10},
ScalingFunctions -> {"Reverse", None}]}, {Plot[x^2, {x, 0, 10},
ScalingFunctions -> {None, {-Log[#] &, Exp[-#] &}}]}, {Plot[
x^2, {x, 1, 10}, ScalingFunctions -> "Log",
Ticks -> {Automatic, 2^Range[10]},
GridLines -> {None, 2^Range[10]}]}, {Plot[x^2, {x, 1, 10},
ScalingFunctions -> "Log", PlotRange -> {1, 100},
AxesOrigin -> {Automatic, 10}]}, {Plot[
Sin[x + 10^20], {x, 0, 2 Pi},
WorkingPrecision -> MachinePrecision]}, {Plot[
Sin[x + 10^20], {x, 0, 2 Pi}, WorkingPrecision -> 20]}},
"Applications" -> {{Plot[{x^(1/2), x, x^2}, {x, 0, 2},
PlotLegends -> "Expressions"]}, {Plot[{Exp[x], Log[x],
x}, {x, -3, 3}, PlotRange -> 3,
PlotStyle -> {Red, Green, Dashed},
AspectRatio -> Automatic]}, {Plot[{x Sin[1/x],
Abs[x], -Abs[x]}, {x, -1/2, 1/2},
PlotStyle -> {Red, Directive[Dashed, Gray],
Directive[Dashed, Gray]}]}, {Plot[Tan[x], {x, -5, 5}],
Plot[Tan[x], {x, -5, 5}, ExclusionsStyle -> Dashed]}, {Plot[
Sin[Floor[x]], {x, 0, 10}, ExclusionsStyle -> Dotted],
Plot[Sin[Floor[x]], {x, 0, 10}, Exclusions -> {Sin[\[Pi] x] == 0},
ExclusionsStyle -> Dashed]}, {Plot[
Sin[Sqrt[2] x] + Sin[x], {x, 0, 20}],
Plot[Sin[Sqrt[2] x] + Sin[x], {x, 0, 20},
MeshFunctions -> {Function[{x, y}, y]}, Mesh -> {{0}},
MeshStyle -> Directive[PointSize[Medium], Red]]}, {Plot[
Sin[Sqrt[2] x] + Sin[x], {x, 0, 50}],
mf = Function[{x, y}, Evaluate@D[Sin[Sqrt[2] x] + Sin[x], x]];,
Plot[Sin[Sqrt[2] x] + Sin[x], {x, 0, 50}, MeshFunctions -> {mf},
Mesh -> {{0}},
MeshStyle -> Directive[PointSize[Medium], Red]]}, {f =
Sin[Sqrt[2] x] + Sin[x];, Plot[f, {x, 0, 50}],
Plot[f, {x, 0, 50},
Exclusions -> {{D[f, x] == 0, D[f, {x, 2}] <= 0}},
ExclusionsStyle -> Directive[Thickness[0.02], Red]],
Plot[f, {x, 0, 50},
Exclusions -> {{D[f, x] == 0, D[f, {x, 2}] >= 0}},
ExclusionsStyle -> Directive[Thickness[0.02], Purple]]}, {f =
Sin[Sqrt[2] x] + Sin[x];, Plot[f, {x, 0, 50}],
Plot[f, {x, 0, 50}, Filling -> {{1 -> {0, {Red, Blue}}}},
PlotLegends ->
SwatchLegend[{Blue, Red}, {"non-negative",
"non-positive"}]]}, {f = Sin[Sqrt[2] x] + Sin[x];,
plot = Plot[f, {x, 0, 50}],
rfi = Function[{x, y}, Evaluate[D[f, x] >= 0]];,
incr = Plot[f, {x, 0, 50}, RegionFunction -> rfi,
PlotStyle -> Blue],
rfd = Function[{x, y}, Evaluate[D[f, x] <= 0]];,
decr = Plot[f, {x, 0, 50}, RegionFunction -> rfd,
PlotStyle -> Red],
Legended[Show[incr, decr],
SwatchLegend[{Blue, Red}, {"increasing", "decreasing"}]]}, {f =
Sin[Sqrt[2] x] + Sin[x];, plot = Plot[f, {x, 0, 50}],
rfcvx = Function[{x, y}, Evaluate[D[f, {x, 2}] >= 0]];,
cvx = Plot[f, {x, 0, 50}, RegionFunction -> rfcvx,
PlotStyle -> Orange],
rfccv = Function[{x, y}, Evaluate[D[f, {x, 2}] <= 0]];,
ccv = Plot[f, {x, 0, 50}, RegionFunction -> rfccv,
PlotStyle -> Blue],
Legended[Show[cvx, ccv],
SwatchLegend[{Orange, Blue}, {"convex", "concave"}]]}, {f =
Sin[Sqrt[2] x] + Sin[x];,
Plot[f, {x, 0,
20}], {min, max} = {NMinValue[{D[f, x], 0 <= x <= 20}, x],
NMaxValue[{D[f, x], 0 <= x <= 20}, x]};,
df = Rescale[D[f, x], {min, max}, {0, 1}], Plot[df, {x, 0, 20}],
cf = Function[{x}, Evaluate[ColorData["Rainbow"][ df]]],
leg = BarLegend[{ColorData["Rainbow"][
Rescale[#, {min, max}, {0, 1}]] &, {min, max}},
LegendMarkerSize -> 150];,
Plot[f, {x, 0, 20}, ColorFunction -> cf,
ColorFunctionScaling -> False, PlotLegends -> leg],
Plot[f, {x, 0, 20}, ColorFunction -> cf,
ColorFunctionScaling -> False, Filling -> 0,
PlotLegends -> leg]}, {Plot[{Re[Exp[I \[Omega]]],
Im[Exp[I \[Omega]]]}, {\[Omega], 0, 10},
PlotLegends ->
"Expressions"]}, {Plot[{Abs[Exp[I \[Omega]]/(1 + \[Omega]^2)],
Arg[Exp[I \[Omega]]/(1 + \[Omega]^2)]}, {\[Omega], -\[Pi], \
\[Pi]}, PlotLegends -> "Expressions"]}, {f =
Exp[I \[Omega]]/(1 + \[Omega]^2);
cf = Function[\[Omega], Evaluate[Hue[Arg[f]/(2 \[Pi]), 0.5]]],
Plot[Abs[f], {\[Omega], -\[Pi], \[Pi]}, ColorFunction -> cf,
ColorFunctionScaling -> False],
Plot[Abs[f], {\[Omega], -\[Pi], \[Pi]}, ColorFunction -> cf,
ColorFunctionScaling -> False, Filling -> Bottom,
PlotLegends ->
BarLegend[{cf, {-\[Pi], \[Pi]}},
LegendMarkerSize -> 150]]}, {s =
DSolve[y'[x] == 1/(1 + y[x]), y, x],
Plot[Evaluate[y[x] /. s /. C[1] -> 0], {x, -2, 5}],
Plot[Evaluate[y[x] /. s /. C[1] -> Range[0, 5]], {x, -5,
5}]}, {s = Reduce[Sin[x^2 + y] == 0, {x, y}],
Plot[Evaluate[{-x^2 + 2 \[Pi] C[1], \[Pi] - x^2 +
2 \[Pi] C[1]} /. C[1] -> Range[-5, 5]], {x, -5, 5}]}},
"PropertiesRelations" -> {{Plot[Sin[x], {x, 0, 10},
Mesh -> All]}, {{Plot[Sin[x^2], {x, 0, 5}],
ParametricPlot[{x, Sin[x^2]}, {x, 0, 5},
AspectRatio ->
1/GoldenRatio]}}, {{ParametricPlot[{Cos[\[Theta]],
Sin[\[Theta]]}, {\[Theta], 0, 2 Pi}],
ParametricPlot[{r Cos[\[Theta]], r Sin[\[Theta]]}, {\[Theta], 0,
2 Pi}, {r, 1, 2}]}}, {{ContourPlot[
x^2 + y^2 == 1, {x, -1, 1}, {y, -1, 1}],
RegionPlot[
1 < x^2 + y^2 < 4, {x, -2, 2}, {y, -2, 2}]}}, {LogLogPlot[
Abs[10^2/((I \[Omega])^2 + 100)], {\[Omega], 10^0,
10^5}]}, {{ListLinePlot[Table[{x, Sin[x]}, {x, 0, 10, 0.25}]],
Plot[Sin[x], {x, 0,
10}]}}, {Plot3D[(x^2 + y^2) Exp[-(x^2 + y^2)], {x, -2,
2}, {y, -2, 2}],
ParametricPlot3D[{-2 Cos[u] Cos[v]^3, -2 Cos[v]^2 Sin[u],
2 Tan[v]}, {u, 0, 2 Pi}, {v, -1, 1}]}}, "PossibleIssues" -> {},
"InteractiveExamples" -> {},
"NeatExamples" -> {{f[n_, x_] :=
Abs[((1/Pi)^(1/4) HermiteH[n, x])/(E^(x^2/2) Sqrt[2^n n!])]^2,
Plot[Evaluate@
Append[Table[f[n, x] + n + 1/2, {n, 0, 7}], x^2/2], {x, -4,
4}, Filling -> Table[n -> n - 1/2, {n, 1, 8}]]}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment