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.










share|improve this question


























    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.










    share|improve this question
























      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.










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 4 hours ago









      Konstantinos

      8001414




      8001414






















          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]}]]


          enter image description here



          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"]


          enter image description here






          share|improve this answer






























            up vote
            2
            down vote













            What about



            col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
            GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]


            enter image description here



            or the lighter version



            col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
            GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]



            enter image description here






            share|improve this answer






























              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)"}]


              enter image description here






              share|improve this answer





















                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
                });


                }
                });














                draft saved

                draft discarded


















                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]}]]


                enter image description here



                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"]


                enter image description here






                share|improve this answer



























                  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]}]]


                  enter image description here



                  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"]


                  enter image description here






                  share|improve this answer

























                    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]}]]


                    enter image description here



                    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"]


                    enter image description here






                    share|improve this answer














                    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]}]]


                    enter image description here



                    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"]


                    enter image description here







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited 3 hours ago

























                    answered 4 hours ago









                    kglr

                    175k9197402




                    175k9197402






















                        up vote
                        2
                        down vote













                        What about



                        col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
                        GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]


                        enter image description here



                        or the lighter version



                        col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
                        GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]



                        enter image description here






                        share|improve this answer



























                          up vote
                          2
                          down vote













                          What about



                          col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
                          GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]


                          enter image description here



                          or the lighter version



                          col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
                          GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]



                          enter image description here






                          share|improve this answer

























                            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]]


                            enter image description here



                            or the lighter version



                            col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
                            GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]



                            enter image description here






                            share|improve this answer














                            What about



                            col=Table[RGBColor[i, 0, 0], {i, 0.5, 1, .1}]
                            GraphicsRow[Map[Graphics[{#, Rectangle}] &,col]]


                            enter image description here



                            or the lighter version



                            col = Table[RGBColor[1, i, i], {i, 0. , .8, .2}]
                            GraphicsRow[Map[Graphics[{#, Rectangle}] &, col]]



                            enter image description here







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 4 hours ago

























                            answered 4 hours ago









                            Ulrich Neumann

                            6,520514




                            6,520514






















                                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)"}]


                                enter image description here






                                share|improve this answer

























                                  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)"}]


                                  enter image description here






                                  share|improve this answer























                                    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)"}]


                                    enter image description here






                                    share|improve this answer












                                    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)"}]


                                    enter image description here







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 4 hours ago









                                    Okkes Dulgerci

                                    3,7451716




                                    3,7451716






























                                        draft saved

                                        draft discarded




















































                                        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.




                                        draft saved


                                        draft discarded














                                        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





















































                                        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







                                        Popular posts from this blog

                                        Trompette piccolo

                                        Slow SSRS Report in dynamic grouping and multiple parameters

                                        Simon Yates (cyclisme)