How to change the tick of the color bar legend to black?How to add a common color legend to a grid of density plots?How to set the color of plot legend independent of the plot itselfHow to change the font of a color bar?add a color bar legend to a 3D plotHow to add a Bar Legend to a density plot over the surface of a sphere?Customizing DensityPlot[]'s automatic bar legendPlacing a bar legend right up against a ListDensityPlotHow to change only the PlotLegend sizeIs that possible to adjust the bar legend size in GraphicsGrid or DensityPlot automatically?Creating a white and black color function

What is the relationship between spectral sequences and obstruction theory?

Do I have an "anti-research" personality?

How to have a sharp product image?

Any examples of headwear for races with animal ears?

Shrinkwrap tetris shapes without scaling or diagonal shapes

Why was Germany not as successful as other Europeans in establishing overseas colonies?

How to get a plain text file version of a CP/M .BAS (M-BASIC) program?

Term for maladaptive animal behavior that will lead to their demise?

Stop and Take a Breath!

How much cash can I safely carry into the USA and avoid civil forfeiture?

How can I change the color of a part of a line?

Is contacting this expert in the field something acceptable or would it be discourteous?

How to stop co-workers from teasing me because I know Russian?

Error message with tabularx

A ​Note ​on ​N!

What does KSP mean?

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

Sci-fi novel series with instant travel between planets through gates. A river runs through the gates

How can I practically buy stocks?

What is the difference between `command a[bc]d` and `command `ab,cd`

Will tsunami waves travel forever if there was no land?

Does this extra sentence in the description of the warlock's Eyes of the Rune Keeper eldritch invocation appear in any official reference?

a sore throat vs a strep throat vs strep throat

how to sum variables from file in bash



How to change the tick of the color bar legend to black?


How to add a common color legend to a grid of density plots?How to set the color of plot legend independent of the plot itselfHow to change the font of a color bar?add a color bar legend to a 3D plotHow to add a Bar Legend to a density plot over the surface of a sphere?Customizing DensityPlot[]'s automatic bar legendPlacing a bar legend right up against a ListDensityPlotHow to change only the PlotLegend sizeIs that possible to adjust the bar legend size in GraphicsGrid or DensityPlot automatically?Creating a white and black color function













4












$begingroup$


Is there any option that allows one to change the ticks and borders of the bar legend in a density plot to black?



enter image description here










share|improve this question











$endgroup$
















    4












    $begingroup$


    Is there any option that allows one to change the ticks and borders of the bar legend in a density plot to black?



    enter image description here










    share|improve this question











    $endgroup$














      4












      4








      4





      $begingroup$


      Is there any option that allows one to change the ticks and borders of the bar legend in a density plot to black?



      enter image description here










      share|improve this question











      $endgroup$




      Is there any option that allows one to change the ticks and borders of the bar legend in a density plot to black?



      enter image description here







      plotting






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 22 at 14:00









      user64494

      3,65311222




      3,65311222










      asked Apr 20 at 14:52









      bakerbaker

      463




      463




















          3 Answers
          3






          active

          oldest

          votes


















          2












          $begingroup$

          You can use PlotLegends -> BarLegend[Automatic, FrameStyle->Black] instead of Automatic to color the frame (although as CE notes, the FrameStyle option will be colored red):



          DensityPlot[
          Sin[x] Sin[y], x,-4,4, y,-3,3,
          ColorFunction->"SunsetColors",
          FrameStyle->Black,
          PlotLegends->BarLegend[Automatic, FrameStyle->Black]
          ]


          enter image description here






          share|improve this answer









          $endgroup$




















            2












            $begingroup$

            I don't see a way to style BarLegend from DensityPlot but there are some potential workarounds. (Carl has shown how to provide the settings I show below directly in DensityPlot.)



            bar = BarLegend["Rainbow",
            FrameStyle -> Red,
            TicksStyle -> Darker@Green,
            LabelStyle -> Blue];

            Legended[
            DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
            bar
            ]


            Mathematica graphics



            The coloring of some of the options to BarLegend indicate that they don't work but they do:



            Mathematica graphics



            produces the bar seen above, even though FrameStyle and TicksStyle are colored red. It's just something to be aware, it may mean that Wolfram Research aren't committed to making this work in future versions of Mathematica.



            Another way to get more control of the color bar is to draw it yourself. Here's an example:



            bar = ParametricPlot[
            x, y, x, 0, 1, y, 0, 1,
            Frame -> True,
            FrameTicks -> None, All, None, None,
            FrameStyle -> Red,
            FrameTicksStyle -> Darker@Green,
            PlotRange -> 0, 1, 0, 1,
            ColorFunction -> (ColorData["Rainbow", #2] &),
            AspectRatio -> 10
            ];

            Legended[
            DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
            bar
            ]


            Mathematica graphics






            share|improve this answer











            $endgroup$












            • $begingroup$
              Thanks! It is a hack, but is should do the job!
              $endgroup$
              – baker
              Apr 20 at 20:16


















            1












            $begingroup$

            It is something of a hack, but you can steal the bar legend from ContourPlot. Like so.




            1. Make a contour plot and select and copy the vertical bar legend.



              ContourPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
              ColorFunction -> "SunsetColors",
              PlotLegends -> Automatic]


              grab_bar




            2. Assign the copied graphic to a variable.



              bar




            3. Use the variable in your density plot.



              DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
              ColorFunction -> "SunsetColors",
              FrameStyle -> Black,
              PlotLegends -> bar]


              plot







            share|improve this answer









            $endgroup$













              Your Answer








              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',
              autoActivateHeartbeat: false,
              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%2f195652%2fhow-to-change-the-tick-of-the-color-bar-legend-to-black%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









              2












              $begingroup$

              You can use PlotLegends -> BarLegend[Automatic, FrameStyle->Black] instead of Automatic to color the frame (although as CE notes, the FrameStyle option will be colored red):



              DensityPlot[
              Sin[x] Sin[y], x,-4,4, y,-3,3,
              ColorFunction->"SunsetColors",
              FrameStyle->Black,
              PlotLegends->BarLegend[Automatic, FrameStyle->Black]
              ]


              enter image description here






              share|improve this answer









              $endgroup$

















                2












                $begingroup$

                You can use PlotLegends -> BarLegend[Automatic, FrameStyle->Black] instead of Automatic to color the frame (although as CE notes, the FrameStyle option will be colored red):



                DensityPlot[
                Sin[x] Sin[y], x,-4,4, y,-3,3,
                ColorFunction->"SunsetColors",
                FrameStyle->Black,
                PlotLegends->BarLegend[Automatic, FrameStyle->Black]
                ]


                enter image description here






                share|improve this answer









                $endgroup$















                  2












                  2








                  2





                  $begingroup$

                  You can use PlotLegends -> BarLegend[Automatic, FrameStyle->Black] instead of Automatic to color the frame (although as CE notes, the FrameStyle option will be colored red):



                  DensityPlot[
                  Sin[x] Sin[y], x,-4,4, y,-3,3,
                  ColorFunction->"SunsetColors",
                  FrameStyle->Black,
                  PlotLegends->BarLegend[Automatic, FrameStyle->Black]
                  ]


                  enter image description here






                  share|improve this answer









                  $endgroup$



                  You can use PlotLegends -> BarLegend[Automatic, FrameStyle->Black] instead of Automatic to color the frame (although as CE notes, the FrameStyle option will be colored red):



                  DensityPlot[
                  Sin[x] Sin[y], x,-4,4, y,-3,3,
                  ColorFunction->"SunsetColors",
                  FrameStyle->Black,
                  PlotLegends->BarLegend[Automatic, FrameStyle->Black]
                  ]


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 20 at 17:44









                  Carl WollCarl Woll

                  76.1k3100198




                  76.1k3100198





















                      2












                      $begingroup$

                      I don't see a way to style BarLegend from DensityPlot but there are some potential workarounds. (Carl has shown how to provide the settings I show below directly in DensityPlot.)



                      bar = BarLegend["Rainbow",
                      FrameStyle -> Red,
                      TicksStyle -> Darker@Green,
                      LabelStyle -> Blue];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics



                      The coloring of some of the options to BarLegend indicate that they don't work but they do:



                      Mathematica graphics



                      produces the bar seen above, even though FrameStyle and TicksStyle are colored red. It's just something to be aware, it may mean that Wolfram Research aren't committed to making this work in future versions of Mathematica.



                      Another way to get more control of the color bar is to draw it yourself. Here's an example:



                      bar = ParametricPlot[
                      x, y, x, 0, 1, y, 0, 1,
                      Frame -> True,
                      FrameTicks -> None, All, None, None,
                      FrameStyle -> Red,
                      FrameTicksStyle -> Darker@Green,
                      PlotRange -> 0, 1, 0, 1,
                      ColorFunction -> (ColorData["Rainbow", #2] &),
                      AspectRatio -> 10
                      ];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics






                      share|improve this answer











                      $endgroup$












                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        Apr 20 at 20:16















                      2












                      $begingroup$

                      I don't see a way to style BarLegend from DensityPlot but there are some potential workarounds. (Carl has shown how to provide the settings I show below directly in DensityPlot.)



                      bar = BarLegend["Rainbow",
                      FrameStyle -> Red,
                      TicksStyle -> Darker@Green,
                      LabelStyle -> Blue];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics



                      The coloring of some of the options to BarLegend indicate that they don't work but they do:



                      Mathematica graphics



                      produces the bar seen above, even though FrameStyle and TicksStyle are colored red. It's just something to be aware, it may mean that Wolfram Research aren't committed to making this work in future versions of Mathematica.



                      Another way to get more control of the color bar is to draw it yourself. Here's an example:



                      bar = ParametricPlot[
                      x, y, x, 0, 1, y, 0, 1,
                      Frame -> True,
                      FrameTicks -> None, All, None, None,
                      FrameStyle -> Red,
                      FrameTicksStyle -> Darker@Green,
                      PlotRange -> 0, 1, 0, 1,
                      ColorFunction -> (ColorData["Rainbow", #2] &),
                      AspectRatio -> 10
                      ];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics






                      share|improve this answer











                      $endgroup$












                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        Apr 20 at 20:16













                      2












                      2








                      2





                      $begingroup$

                      I don't see a way to style BarLegend from DensityPlot but there are some potential workarounds. (Carl has shown how to provide the settings I show below directly in DensityPlot.)



                      bar = BarLegend["Rainbow",
                      FrameStyle -> Red,
                      TicksStyle -> Darker@Green,
                      LabelStyle -> Blue];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics



                      The coloring of some of the options to BarLegend indicate that they don't work but they do:



                      Mathematica graphics



                      produces the bar seen above, even though FrameStyle and TicksStyle are colored red. It's just something to be aware, it may mean that Wolfram Research aren't committed to making this work in future versions of Mathematica.



                      Another way to get more control of the color bar is to draw it yourself. Here's an example:



                      bar = ParametricPlot[
                      x, y, x, 0, 1, y, 0, 1,
                      Frame -> True,
                      FrameTicks -> None, All, None, None,
                      FrameStyle -> Red,
                      FrameTicksStyle -> Darker@Green,
                      PlotRange -> 0, 1, 0, 1,
                      ColorFunction -> (ColorData["Rainbow", #2] &),
                      AspectRatio -> 10
                      ];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics






                      share|improve this answer











                      $endgroup$



                      I don't see a way to style BarLegend from DensityPlot but there are some potential workarounds. (Carl has shown how to provide the settings I show below directly in DensityPlot.)



                      bar = BarLegend["Rainbow",
                      FrameStyle -> Red,
                      TicksStyle -> Darker@Green,
                      LabelStyle -> Blue];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics



                      The coloring of some of the options to BarLegend indicate that they don't work but they do:



                      Mathematica graphics



                      produces the bar seen above, even though FrameStyle and TicksStyle are colored red. It's just something to be aware, it may mean that Wolfram Research aren't committed to making this work in future versions of Mathematica.



                      Another way to get more control of the color bar is to draw it yourself. Here's an example:



                      bar = ParametricPlot[
                      x, y, x, 0, 1, y, 0, 1,
                      Frame -> True,
                      FrameTicks -> None, All, None, None,
                      FrameStyle -> Red,
                      FrameTicksStyle -> Darker@Green,
                      PlotRange -> 0, 1, 0, 1,
                      ColorFunction -> (ColorData["Rainbow", #2] &),
                      AspectRatio -> 10
                      ];

                      Legended[
                      DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3],
                      bar
                      ]


                      Mathematica graphics







                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Apr 20 at 19:57

























                      answered Apr 20 at 17:30









                      C. E.C. E.

                      51.4k3101207




                      51.4k3101207











                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        Apr 20 at 20:16
















                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        Apr 20 at 20:16















                      $begingroup$
                      Thanks! It is a hack, but is should do the job!
                      $endgroup$
                      – baker
                      Apr 20 at 20:16




                      $begingroup$
                      Thanks! It is a hack, but is should do the job!
                      $endgroup$
                      – baker
                      Apr 20 at 20:16











                      1












                      $begingroup$

                      It is something of a hack, but you can steal the bar legend from ContourPlot. Like so.




                      1. Make a contour plot and select and copy the vertical bar legend.



                        ContourPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                        ColorFunction -> "SunsetColors",
                        PlotLegends -> Automatic]


                        grab_bar




                      2. Assign the copied graphic to a variable.



                        bar




                      3. Use the variable in your density plot.



                        DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                        ColorFunction -> "SunsetColors",
                        FrameStyle -> Black,
                        PlotLegends -> bar]


                        plot







                      share|improve this answer









                      $endgroup$

















                        1












                        $begingroup$

                        It is something of a hack, but you can steal the bar legend from ContourPlot. Like so.




                        1. Make a contour plot and select and copy the vertical bar legend.



                          ContourPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                          ColorFunction -> "SunsetColors",
                          PlotLegends -> Automatic]


                          grab_bar




                        2. Assign the copied graphic to a variable.



                          bar




                        3. Use the variable in your density plot.



                          DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                          ColorFunction -> "SunsetColors",
                          FrameStyle -> Black,
                          PlotLegends -> bar]


                          plot







                        share|improve this answer









                        $endgroup$















                          1












                          1








                          1





                          $begingroup$

                          It is something of a hack, but you can steal the bar legend from ContourPlot. Like so.




                          1. Make a contour plot and select and copy the vertical bar legend.



                            ContourPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                            ColorFunction -> "SunsetColors",
                            PlotLegends -> Automatic]


                            grab_bar




                          2. Assign the copied graphic to a variable.



                            bar




                          3. Use the variable in your density plot.



                            DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                            ColorFunction -> "SunsetColors",
                            FrameStyle -> Black,
                            PlotLegends -> bar]


                            plot







                          share|improve this answer









                          $endgroup$



                          It is something of a hack, but you can steal the bar legend from ContourPlot. Like so.




                          1. Make a contour plot and select and copy the vertical bar legend.



                            ContourPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                            ColorFunction -> "SunsetColors",
                            PlotLegends -> Automatic]


                            grab_bar




                          2. Assign the copied graphic to a variable.



                            bar




                          3. Use the variable in your density plot.



                            DensityPlot[Sin[x] Sin[y], x, -4, 4, y, -3, 3, 
                            ColorFunction -> "SunsetColors",
                            FrameStyle -> Black,
                            PlotLegends -> bar]


                            plot








                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 20 at 18:29









                          m_goldbergm_goldberg

                          89.2k873200




                          89.2k873200



























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f195652%2fhow-to-change-the-tick-of-the-color-bar-legend-to-black%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

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                              What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company