Demandes associées au chapitre-notebook: "Graphiques"

Pour accéder au code relatif à un exemple, double-cliquer sur le triangle du crochet icônique à droite.

Questions relatives à l'information

?*Plot*

?PlotLabel

?Plot

Attributes[Plot]

Exemple 1

Plot[Cos[x], {x, 0, 2 π}];

Exemple 2

Plot[(Sqrt[((((x/Cos)[x] - (1/Sin)[x]))^2)]), {x, π, 2 π}];

Exemple 3

Plot[If[x < 0, 1, Exp[x]], {x, -1, 2}];

Exemple 4

Plot[Table[a (x^3), {a, 1, 3}], {x, -1, 2}];

Table[a (x^3), {a, 1, 3}]

Plot[Evaluate[Table[a (x^3), {a, 1, 3}]], {x, -1, 2}];

Exemple 5

f[x_, a_] := If[x < a, 1, Exp[x] + 5 a]

Plot[f[x, 0], {x, -1, 2}];

courbes = Table[f[x, a], {a, 1, 3}]

Plot[courbes, {x, -1, 5}];

Plot[Evaluate[courbes], {x, -1, 5}, PlotRange -> {0, 50}];

Exemple 6

NSolve[13 (x^4) - ((7 x)/3) - 5 == 0]

x = Last[x /. %]

courbes

Plot[Evaluate[courbes], {x, -1, 2}];

Evaluate[courbes]

Options[Plot]

Print/@Options[Plot];

Exemple 7

Plot[(1/(x - 2)), {x, -5, 5}]

FullForm[%]

Exemple 8

f[x_] := Abs[x - 1] + Abs[((x - 1)/x)]

Plot[f[x], {x, -10, 10}];

Show[% /. Line[pts_] :> Point/@pts];

Plot[f[x], {x, -10, 10}, PlotPoints -> 100];

Show[% /. Line[pts_] :> Point/@pts];

Plot[{f[x], x, -x + 2}, {x, -10, 10}, 
      PlotPoints -> 100];

Show[% /. Line[pts_] :> Point/@pts];

Plot[{f[x], x, -x + 2}, {x, -10, 10}, PlotPoints -> 100, 
      PlotStyle -> {{}, {Dashing[{0.01}]}, {Dashing[{0.03, 0.02}]}}];

Show[% /. Line[pts_] :> Point/@pts];

Clear[f]

Exemple 9

f1[x_] := Cos[1.23758 (x^2)] /; x > 1.215743 && x < 2.652437

f2[x_] := (x^2) + 3 /; x < 1.215743

f3[x_] := 3.1254728 (x^2) - 4.58721 /; x > 2.652437

Plot[{f1[x], f2[x], f3[x]}, {x, 0, ((3 π)/2)}, 
      PlotRange -> {-5, 30}, 
      Ticks -> {{1.215743, 2.652437}, Automatic}, 
      PlotStyle 
        -> {RGBColor[1, 0, 0], RGBColor[0, 1, 0], RGBColor[0, 0, 1]}];

Plot[{f1[x], f2[x], f3[x]}, {x, 0, ((3 π)/2)}, 
      PlotRange -> {-5, 30}, 
      Ticks -> {{1.215743, 2.652437}, Automatic}, 
      PlotStyle 
        -> {Dashing[{0.01, 0.005}], Dashing[{0.001, 0.005}], 
          Dashing[{0.03}]}];

Exemple 10

g[x_] := Sin[2 π x + (π/2)]

Plot[g[x], {x, 0.2, 95.2}];

Solve[g[x] == 0, x]

N[(95.2/π)]

N[((2 0.2)/(3 π))]

Solve[2 π x + (π/2) == π + k π, x]

Table[x /. %, {k, 0, 4}]

Plot[g[x], {x, 0.2, 95.2}, PlotPoints -> 350];

Plot[g[x], {x, 0, 10}, PlotPoints -> 35];

Clear[g]

Plot[Sin[2 π x + (π/2)], {x, 0, 15}, PlotPoints -> 30]; 
    Plot[Sin[2 π x + (π/2)], {x, 0, 15}, PlotPoints -> 40];

Exemple 11

Plot[Sin[x], {x, 0, 95 π}];

Exemple 12

f[n_][x_] := x (n - Log[x])

(∂_x) f[n][x]

y - y0==f'( x0) (x - x0)//.{y0 -> f[n][x0],f' (x0)->((∂_x) f[n][x] /. x -> x0),x0 -> a}

Solve[%, y]

y /. %

tangente[n_][x_][a_] := a - x + n x - x Log[a];

Plot[{f[2][x], tangente[2][x][3]}, {x, 1, 10}];

Plot[
      Evaluate[Append[Table[tangente[2][x][a], {a, 3., 8., 0.3}], 
          f[2][x]]], {x, 1, 10}];

Plot[
      Evaluate[Append[Table[tangente[2][x][a], {a, 3., 8., 0.3}], 
          f[2][x]]], {x, 1, 10}, PlotRange -> {1, 3}];

Plot[
      Evaluate[Join[
          Table[{f[n][x], tangente[n][x][6]}, {n, 2, 3, 0.1}]]], {
        x, 0, 10}];

Show[%, Graphics[{Line[{{6, 0}, {6, 8}}], Circle[{0, 3}, 3]}], 
      AspectRatio -> Automatic];

Exemple 13

f1[x_] := Cos[1.23758 (x^2)] /; x > 1.215743 && x < 2.652437

f2[x_] := (x^2) + 3 /; x < 1.215743

f3[x_] := 3.1254728 (x^2) - 4.58721 /; x > 2.652437

Plot[{f1[x], f2[x], f3[x]}, {x, 0, ((3 π)/2)}, 
      PlotRange -> {-5, 30}, 
      Ticks -> {{1.215743, 2.652437}, Automatic}];

f[x_] := Cos[1.23758 (x^2)] /; x > 1.215743 && x < 2.652437

f[x_] := (x^2) + 3 /; x < 1.215743

f[x_] := 3.1254728 (x^2) - 4.58721 /; x > 2.652437

Plot[f[x], {x, 0, ((3 π)/2)}, PlotRange -> {-5, 30}, 
      Ticks -> {{1.215743, 2.652437}, Automatic}];

Exemple 14

f[x_] := (Sqrt[-(x^2) + 56 x - 783.75])

Plot[f[x], {x, -10, 10}];

Solve[-(x^2) + 56 x - 783.75 == 0]

Clear [f]

Exemple 15

f[n_][x_] := (x^n)

courbes  =  
      Table[Plot[f[n][x], {x, -1, 3},  
          PlotLabel  ->  SequenceForm ["n = ",  n]], {n, 1, 10}];

tableau  =  Partition [courbes,  2];

Show[GraphicsArray[tableau], GraphicsSpacing -> {0, 0.1}];

Clear [courbes,  tableau]

Exemple 16

\(\(courbes\  = 
      Table[Plot[{Exp[x], \(f[n]\)[x]}, {x, \(-1\), 3}, 
			
          PlotStyle -> {Dashing[{0.02}], Dashing[{0.01}]}, \ 
			
          PlotLabel\  -> SequenceForm\ ["n = ", \ n], 
          Frame -> True], {n, 1, 6}]; \)\)

tableau  =  Partition [courbes,  2];

Show[GraphicsArray[tableau], GraphicsSpacing -> {0, 0.1}];

Exemple 17 & 18

Table[Plot[{Exp[x], f[n][x]},{x, 1, 2 n},PlotStyle -> {Dashing[{0.001}], Dashing[{0.01}]},PlotLabel->" n = "n,PlotRange -> {0, 150}],{n, 3, 4}];

Table[Plot[{Exp[x], f[n][x]},{x, 1, 10},PlotStyle -> {Dashing[{0.001}], Dashing[{0.01}]},PlotLabel->" n = "n,PlotRange -> {0, 6000}],{n, 4, 4}];

Table[Plot[{Exp[x], f[n][x]},{x, 1, 14},PlotStyle -> {Dashing[{0.001}], Dashing[{0.01}]},PlotLabel->" n = "n,PlotRange -> {0, 400000}],{n, 5, 5}];

Table[Plot[{Exp[x], f[n][x]},{x, 1, 18},PlotStyle -> {Dashing[{0.001}], Dashing[{0.01}]},PlotLabel->" n = "n,PlotRange -> {0, 30000000}],{n, 6, 6}];

Table[Plot[{Exp[x], f[n][x]},{x, 1, 23},PlotStyle -> {Dashing[{0.001}], Dashing[{0.004}]},PlotLabel->" n = "n,PlotRange -> {0, 2400000000}],{n, 7, 7}];

Table[Plot[{Exp[x], f[4 i + j][x]},{x, 1, 2},PlotStyle -> {Dashing[{0.001}], Dashing[{0.004}]},PlotLabel->" n = "4 i + j,PlotRange -> {2, 4},DisplayFunction -> Identity],{i, 1, 4},{j, 0, 3}];

Show[GraphicsArray[%, DisplayFunction -> $DisplayFunction]]

Exemple 19

Solve[(x^2) + (y^2) == 1, y]

Exemple 20, 21  & 22

☹ ☹ ☹

Exemple 23

Needs["Graphics`ImplicitPlot`"]

((2 x)/33) + ((3 y)/13) - (10/11) = -1((5 x)/17) - 7 y - (15/2) = 7

Solve[{((2 x)/33) + ((3 y)/13) - (7/11) == -1, 
        ((5 x)/17) - 7 y - (15/2) == 7}, {x, y}]

N[%]

Needs["Graphics`ImplicitPlot`"]

ImplicitPlot[{((2 x)/33) + ((3 y)/13) - (7/11) == -1, 
        ((5 x)/17) - 7 y - (15/2) == 7}, {x, -2, 5}];

Exemple 24

ListPlot[Table[(1/i) - (1/(i^2)), {i, 1, 50}]];

ListPlot[Table[(1/i) - (1/(i^2)), {i, 1, 50}], PlotJoined -> True];

Exemple 25

Needs["Graphics`Arrow`"]

?Arrow

Show[%%, Graphics[Arrow[{40, 0.1}, {10, 0.22}]]];

Show[%, Graphics[Text["pic!", {45, 0.1}]]];