Skip to main content
added 64 characters in body
Source Link
Vitaliy Kaurov
  • 74.9k
  • 9
  • 212
  • 380

Would something like this work?A function that works for any symmetric range:

plt[rng_] := Block[{r = 3rng, tcks, f},  f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0,   "+" <> ToString[x] <> "Q", x < 0, ToString[x] <> "Q", x == 0, ""];   tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }];    Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks},   AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1],   AxesLabel -> {"Input", "Output"},   AxesStyle -> Arrowheads[{-0.0805, 0.0805}]]]], ImageSize -> 300]]  plt /@ {3, 5} // Row 

enter image description hereenter image description here

Would something like this work?

Block[{r = 3, tcks, f}, f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0, "+" <> ToString[x] <> "Q", x < 0, ToString[x] <> "Q", x == 0, ""]; tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }]; Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}, AxesStyle -> Arrowheads[{-0.08, 0.08}]]] 

enter image description here

A function that works for any symmetric range:

plt[rng_] := Block[{r = rng, tcks, f},  f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0,   "+" <> ToString[x] <> "Q", x < 0, ToString[x] <> "Q", x == 0, ""];   tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }];    Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks},   AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1],   AxesLabel -> {"Input", "Output"},   AxesStyle -> Arrowheads[{-0.05, 0.05}], ImageSize -> 300]]  plt /@ {3, 5} // Row 

enter image description here

added 42 characters in body
Source Link
Vitaliy Kaurov
  • 74.9k
  • 9
  • 212
  • 380

Would something like this work?

Block[{r = 3, tcks, f},   f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0,  "+" <> ToString[x] <> "Q",  x < 0, ToString[x] <> "Q", x == 0, ""]; tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }]; Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}]],   AxesStyle -> Arrowheads[{-0.08, 0.08}]]] 

enter image description hereenter image description here

Would something like this work?

Block[{r = 3, tcks, f},   f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0, "+" <> ToString[x] <> "Q",  x < 0, ToString[x] <> "Q", x == 0, ""]; tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }]; Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}]] 

enter image description here

Would something like this work?

Block[{r = 3, tcks, f}, f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0,  "+" <> ToString[x] <> "Q", x < 0, ToString[x] <> "Q", x == 0, ""]; tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }]; Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"},   AxesStyle -> Arrowheads[{-0.08, 0.08}]]] 

enter image description here

added 115 characters in body
Source Link
Vitaliy Kaurov
  • 74.9k
  • 9
  • 212
  • 380

Would something like this work?

With[Block[{r = 3}, Plot[Round[n]tcks, {nf},   -rf[x_] := Which[x == 1, r}"+Q",   x == Ticks-1, "-Q", x > {Transpose[{Range[-r0, r]"+" <> ToString[x] <> "Q",   Range[-r x < 0, r]ToString[x] Q<> }]"Q",   x == 0, ""];  tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] Q}]; Plot[Round[n], {n, -r, r}], Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}]] 

enter image description hereenter image description here

Would something like this work?

With[{r = 3}, Plot[Round[n], {n, -r, r},    Ticks -> {Transpose[{Range[-r, r], Range[-r, r] Q }],    Transpose[{Range[-r, r], Range[-r, r] Q }]}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}]] 

enter image description here

Would something like this work?

Block[{r = 3, tcks, f},   f[x_] := Which[x == 1, "+Q", x == -1, "-Q", x > 0, "+" <> ToString[x] <> "Q",    x < 0, ToString[x] <> "Q", x == 0, ""];  tcks = Transpose[{Range[-r, r], f /@ Range[-r, r] }]; Plot[Round[n], {n, -r, r}, Ticks -> {tcks, tcks}, AspectRatio -> Automatic, ExclusionsStyle -> Opacity[1], AxesLabel -> {"Input", "Output"}]] 

enter image description here

deleted 1 characters in body
Source Link
Vitaliy Kaurov
  • 74.9k
  • 9
  • 212
  • 380
Loading
Source Link
Vitaliy Kaurov
  • 74.9k
  • 9
  • 212
  • 380
Loading