How to change the tick of the color bar legend to black Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?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

Why is there so little support for joining EFTA in the British parliament?

My mentor says to set image to Fine instead of RAW — how is this different from JPG?

How to make an animal which can only breed for a certain number of generations?

Meaning of 境 in その日を境に

Does the universe have a fixed centre of mass?

How do I find my Spellcasting Ability for my D&D character?

How can I list files in reverse time order by a command and pass them as arguments to another command?

Improvising over quartal voicings

Why did Bronn offer to be Tyrion Lannister's champion in trial by combat?

Where and when has Thucydides been studied?

NIntegrate on a solution of a matrix ODE

How to name indistinguishable henchmen in a screenplay?

malloc in main() or malloc in another function: allocating memory for a struct and its members

How could a hydrazine and N2O4 cloud (or it's reactants) show up in weather radar?

Can I cut the hair of a conjured korred with a blade made of precious material to harvest that material from the korred?

How does the body cool itself in a stillsuit?

3D Masyu - A Die

How does TikZ render an arc?

Proving that any solution to the differential equation of an oscillator can be written as a sum of sinusoids.

Does the main washing effect of soap come from foam?

Why can't fire hurt Daenerys but it did to Jon Snow in season 1?

Do i imagine the linear (straight line) homotopy in a correct way?

Is the Mordenkainen's Sword spell underpowered?

Why do C and C++ allow the expression (int) + 4*5?



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



Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?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 yesterday









      m_goldberg

      89k873200




      89k873200










      asked yesterday









      bakerbaker

      312




      312




















          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
              yesterday


















            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 yesterday









                  Carl WollCarl Woll

                  75.1k3100197




                  75.1k3100197





















                      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
                        yesterday















                      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
                        yesterday













                      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 yesterday

























                      answered yesterday









                      C. E.C. E.

                      51.3k3101207




                      51.3k3101207











                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        yesterday
















                      • $begingroup$
                        Thanks! It is a hack, but is should do the job!
                        $endgroup$
                        – baker
                        yesterday















                      $begingroup$
                      Thanks! It is a hack, but is should do the job!
                      $endgroup$
                      – baker
                      yesterday




                      $begingroup$
                      Thanks! It is a hack, but is should do the job!
                      $endgroup$
                      – baker
                      yesterday











                      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 yesterday









                          m_goldbergm_goldberg

                          89k873200




                          89k873200



























                              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

                              Личност Атрибути на личността | Литература и източници | НавигацияРаждането на личносттаредактиратередактирате

                              Are there any AGPL-style licences that require source code modifications to be public? Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Force derivative works to be publicAre there any GPL like licenses for Apple App Store?Do you violate the GPL if you provide source code that cannot be compiled?GPL - is it distribution to use libraries in an appliance loaned to customers?Distributing App for free which uses GPL'ed codeModifications of server software under GPL, with web/CLI interfaceDoes using an AGPLv3-licensed library prevent me from dual-licensing my own source code?Can I publish only select code under GPLv3 from a private project?Is there published precedent regarding the scope of covered work that uses AGPL software?If MIT licensed code links to GPL licensed code what should be the license of the resulting binary program?If I use a public API endpoint that has its source code licensed under AGPL in my app, do I need to disclose my source?

                              How does Billy Russo acquire his 'Jigsaw' mask? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why does Bane wear the mask?Why does Kylo Ren wear a mask?Why did Captain America remove his mask while fighting Batroc the Leaper?How did the OA acquire her wisdom?Is Billy Breckenridge gay?How does Adrian Toomes hide his earnings from the IRS?What is the state of affairs on Nootka Sound by the end of season 1?How did Tia Dalma acquire Captain Barbossa's body?How is one “Deemed Worthy”, to acquire the Greatsword “Dawn”?How did Karen acquire the handgun?