Different shades of the same colour in one plot
up vote
2
down vote
favorite
I want to plot several functions in one plot and have different shades of the same colour for each of the plots. Doing with different colours is easy
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Red},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Green},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Blue},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a4 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Yellow},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a5 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Pink},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3, a4, a5]
But how can I get 5 different shades of red for example?
I tried to use
r1 = LightRed;
r2 = Red;
r3 = Darker[Red];
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r1},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r2},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r3},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3]
which I found in an answer here, but this only gives three choices.
plotting plot-themes
add a comment |
up vote
2
down vote
favorite
I want to plot several functions in one plot and have different shades of the same colour for each of the plots. Doing with different colours is easy
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Red},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Green},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Blue},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a4 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Yellow},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a5 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Pink},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3, a4, a5]
But how can I get 5 different shades of red for example?
I tried to use
r1 = LightRed;
r2 = Red;
r3 = Darker[Red];
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r1},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r2},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r3},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3]
which I found in an answer here, but this only gives three choices.
plotting plot-themes
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to plot several functions in one plot and have different shades of the same colour for each of the plots. Doing with different colours is easy
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Red},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Green},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Blue},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a4 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Yellow},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a5 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Pink},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3, a4, a5]
But how can I get 5 different shades of red for example?
I tried to use
r1 = LightRed;
r2 = Red;
r3 = Darker[Red];
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r1},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r2},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r3},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3]
which I found in an answer here, but this only gives three choices.
plotting plot-themes
I want to plot several functions in one plot and have different shades of the same colour for each of the plots. Doing with different colours is easy
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Red},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Green},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Blue},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a4 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Yellow},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a5 = Plot[4 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, Pink},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3, a4, a5]
But how can I get 5 different shades of red for example?
I tried to use
r1 = LightRed;
r2 = Red;
r3 = Darker[Red];
a1 = Plot[{x^2}, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r1},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a2 = Plot[2 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r2},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
a3 = Plot[3 x^2, {x, 0, 10}, PlotRange -> All,
PlotStyle -> {Thick, r3},
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}];
Show[a1, a2, a3]
which I found in an answer here, but this only gives three choices.
plotting plot-themes
plotting plot-themes
asked 4 hours ago
Konstantinos
8001414
8001414
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
accepted
You can Blend
Red
with White
and Black
:
ClearAll[lightToDark]
lightToDark[n_, c_:Red] := Blend[{{0, White}, {n/2, c}, {n + 3, Black}}, #] & /@ Range[n]
Graphics[Table[{lightToDark[10][[x]], Disk[{x, 0}]}, {x, Range[10]}]]
functions = # x^2 & /@ Range[5];
Plot[functions, {x, 0, 10}, PlotRange -> All,
PlotStyle -> lightToDark[Length@functions],
BaseStyle -> {18, Thick, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}, PlotLegends -> "Expressions"]
add a comment |
up vote
2
down vote
What about
col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]
or the lighter version
col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]
add a comment |
up vote
1
down vote
How about this..
color = Take[Darker[Red, #] & /@ Subdivide[30], {1, -10, 5}];
Plot[Evaluate@Table[n x^2, {n, 5}], {x, 0, 10},
PlotLegends -> "Expressions", PlotRange -> All, PlotStyle -> color,
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(x)"}]
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f187848%2fdifferent-shades-of-the-same-colour-in-one-plot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
You can Blend
Red
with White
and Black
:
ClearAll[lightToDark]
lightToDark[n_, c_:Red] := Blend[{{0, White}, {n/2, c}, {n + 3, Black}}, #] & /@ Range[n]
Graphics[Table[{lightToDark[10][[x]], Disk[{x, 0}]}, {x, Range[10]}]]
functions = # x^2 & /@ Range[5];
Plot[functions, {x, 0, 10}, PlotRange -> All,
PlotStyle -> lightToDark[Length@functions],
BaseStyle -> {18, Thick, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}, PlotLegends -> "Expressions"]
add a comment |
up vote
1
down vote
accepted
You can Blend
Red
with White
and Black
:
ClearAll[lightToDark]
lightToDark[n_, c_:Red] := Blend[{{0, White}, {n/2, c}, {n + 3, Black}}, #] & /@ Range[n]
Graphics[Table[{lightToDark[10][[x]], Disk[{x, 0}]}, {x, Range[10]}]]
functions = # x^2 & /@ Range[5];
Plot[functions, {x, 0, 10}, PlotRange -> All,
PlotStyle -> lightToDark[Length@functions],
BaseStyle -> {18, Thick, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}, PlotLegends -> "Expressions"]
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
You can Blend
Red
with White
and Black
:
ClearAll[lightToDark]
lightToDark[n_, c_:Red] := Blend[{{0, White}, {n/2, c}, {n + 3, Black}}, #] & /@ Range[n]
Graphics[Table[{lightToDark[10][[x]], Disk[{x, 0}]}, {x, Range[10]}]]
functions = # x^2 & /@ Range[5];
Plot[functions, {x, 0, 10}, PlotRange -> All,
PlotStyle -> lightToDark[Length@functions],
BaseStyle -> {18, Thick, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}, PlotLegends -> "Expressions"]
You can Blend
Red
with White
and Black
:
ClearAll[lightToDark]
lightToDark[n_, c_:Red] := Blend[{{0, White}, {n/2, c}, {n + 3, Black}}, #] & /@ Range[n]
Graphics[Table[{lightToDark[10][[x]], Disk[{x, 0}]}, {x, Range[10]}]]
functions = # x^2 & /@ Range[5];
Plot[functions, {x, 0, 10}, PlotRange -> All,
PlotStyle -> lightToDark[Length@functions],
BaseStyle -> {18, Thick, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(X)"}, PlotLegends -> "Expressions"]
edited 3 hours ago
answered 4 hours ago
kglr
175k9197402
175k9197402
add a comment |
add a comment |
up vote
2
down vote
What about
col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]
or the lighter version
col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]
add a comment |
up vote
2
down vote
What about
col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]
or the lighter version
col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]
add a comment |
up vote
2
down vote
up vote
2
down vote
What about
col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]
or the lighter version
col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]
What about
col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]
or the lighter version
col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]
edited 4 hours ago
answered 4 hours ago
Ulrich Neumann
6,520514
6,520514
add a comment |
add a comment |
up vote
1
down vote
How about this..
color = Take[Darker[Red, #] & /@ Subdivide[30], {1, -10, 5}];
Plot[Evaluate@Table[n x^2, {n, 5}], {x, 0, 10},
PlotLegends -> "Expressions", PlotRange -> All, PlotStyle -> color,
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(x)"}]
add a comment |
up vote
1
down vote
How about this..
color = Take[Darker[Red, #] & /@ Subdivide[30], {1, -10, 5}];
Plot[Evaluate@Table[n x^2, {n, 5}], {x, 0, 10},
PlotLegends -> "Expressions", PlotRange -> All, PlotStyle -> color,
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(x)"}]
add a comment |
up vote
1
down vote
up vote
1
down vote
How about this..
color = Take[Darker[Red, #] & /@ Subdivide[30], {1, -10, 5}];
Plot[Evaluate@Table[n x^2, {n, 5}], {x, 0, 10},
PlotLegends -> "Expressions", PlotRange -> All, PlotStyle -> color,
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(x)"}]
How about this..
color = Take[Darker[Red, #] & /@ Subdivide[30], {1, -10, 5}];
Plot[Evaluate@Table[n x^2, {n, 5}], {x, 0, 10},
PlotLegends -> "Expressions", PlotRange -> All, PlotStyle -> color,
BaseStyle -> {18, FontFamily -> "Times New Roman"},
AxesLabel -> {"x", "f(x)"}]
answered 4 hours ago
Okkes Dulgerci
3,7451716
3,7451716
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f187848%2fdifferent-shades-of-the-same-colour-in-one-plot%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown