Dressing up Plots in Mathematica

PlotStyle to control what your graphs look like

Plotting graphs in different colors

The key to plotting graphs in different colors is to use the PlotStyle option with the name of one of the supported colors.  (There are fancier ways to do this, some of which allow you to vary the color over the curve, but that is beyond the scope of this notebook.)  To use this method, you must first load Graphics:

<< Graphics`

Plot[{Sin[x], Cos[x]}, {x, -2 π, 2  π}, 
      PlotStyle -> {Red, Blue}]

ImplicitPlot[(x^2) - (y^2) == 1, {x, -5, 5}, 
      PlotStyle -> Green]

See below for a list of the supported colors.

Making a graph dashed

You can make a graph dashed by using the Dashing options.  You must pass Dashing a list of relative widths for each segment.  For example, Dashing[{0.03}] gives a line with each segment 0.03 times the total width of the graph.

Plot[{Sin[x], Cos[x]}, {x, -2 π, 2  π}, 
      PlotStyle -> {Yellow, Dashing[{ .03}]}]

The following would make long dashes and short spaces:

Plot[Cos[x], {x, -2 π, 2  π}, 
      PlotStyle -> Dashing[{ .05, 0.02}]]

You can combine dashing and color together:

Plot[{Sin[x], Cos[x]}, {x, -2 π, 2  π}, 
      PlotStyle -> {{Yellow, Dashing[{ .02}]}, {Red, 
            Dashing[{0.03, 0.02, 0.005, 0.02}]}}]

Colors to choose from for your graphs

Below is a table of all the predefined colors you can call by name in Mathematica:

Code to generate the color chart

I copied the list of colors out of the help browser (and tweaked it just a little):

\(colors = 
      Flatten[{{"AliceBlue", "AlizarinCrimson"}, {"Antique", "Apricot"}, {"Aquamarine", "AureolineYellow"}, {"Azure", "Banana"}, {"Beige", "Bisque"}, {"Black", "BlanchedAlmond"}, {"Blue", "BlueViolet"}, {"Brick", "Brown"}, {"BrownMadder", "BrownOchre"}, {"Burlywood", "BurntSienna"}, {"BurntUmber", "CadetBlue"}, {"CadmiumLemon", "CadmiumOrange"}, {"CadmiumYellow", "Carrot"}, {"Cerulean", "Chartreuse"}, {"Chocolate", "ChromeOxideGreen"}, {"CinnabarGreen", "Cobalt"}, {"CobaltGreen", "ColdGray"}, {"Coral", "CornflowerBlue"}, {"Cornsilk", "Cyan"}, {"CyanWhite", "DarkGoldenrod"}, {"DarkGreen", "DarkKhaki"}, {"DarkOliveGreen", "DarkOrange"}, {"DarkOrchid", "DarkSeaGreen"}, {"DarkSlateBlue", "DarkSlateGray"}, {"DarkTurquoise", "DarkViolet"}, {"DeepCadmiumRed", "DeepCobaltViolet"}, {"DeepMadderLake", "DeepNaplesYellow"}, {"DeepOchre", "DeepPink"}, {"DeepSkyBlue", "DimGray"}, {"DodgerBlue", "Eggshell"}, {"EmeraldGreen", "EnglishRed"}, {"Firebrick", "Floral"}, {"ForestGreen", "Gainsboro"}, {"GeraniumLake", "Ghost"}, {"Gold", "Goldenrod"}, {"GoldOchre", "Green"}, {"GreenishUmber", "GreenYellow", "Gray"}, {"Honeydew", "HotPink"}, {"IndianRed", "Indigo"}, {"Ivory", "IvoryBlack"}, {"Khaki", "LampBlack"}, {"Lavender", "LavenderBlush"}, {"LawnGreen", "LemonChiffon"}, {"LightBeige", "LightBlue"}, {"LightCadmiumRed", "LightCadmiumYellow"}, {"LightCoral", "LightGoldenrod"}, {"LightGray", "LightPink"}, {"LightSalmon", "LightSeaGreen"}, {"LightSkyBlue", "LightSlateBlue"}, {"LightSlateGray", "LightSteelBlue"}, {"LightViridian", "LightYellow"}, {"LimeGreen", "Linen"}, {"Magenta", "ManganeseBlue"}, {"Maroon", "MarsOrange"}, {"MarsYellow", "MediumAquamarine"}, {"MediumBlue", "MediumOrchid"}, {"MediumPurple", "MediumSeaGreen"}, {"MediumSlateBlue", "MediumSpringGreen"}, {"MediumTurquoise", "MediumVioletRed"}, {"Melon", "MidnightBlue"}, {"Mint", "MintCream"}, {"MistyRose", "Moccasin"}, {"Navajo", "Navy"}, {"NavyBlue", "Oak"}, {"OldLace", "Olive"}, {"OliveDrab", "Orange"}, {"OrangeRed", "Orchid"}, {"PaleGoldenrod", "PaleGreen"}, {"PaleTurquoise", "PaleVioletRed"}, {"PapayaWhip", "Peach"}, {"PeachPuff", "Peacock"}, {"PermanentGreen", "PermanentRedViolet"}, {"Peru", "Pink"}, {"Plum", "PowderBlue"}, {"PrussianBlue", "Purple"}, {"Raspberry", "RawSienna"}, {"RawUmber", "Red"}, {"RoseMadder", "RosyBrown"}, {"RoyalBlue", "SaddleBrown"}, {"Salmon", "SandyBrown"}, {"SapGreen", "SeaGreen"}, {"Seashell", "Sepia"}, {"Sienna", "SkyBlue"}, {"SlateBlue", "SlateGray"}, {"Smoke", "Snow"}, {"SpringGreen", "SteelBlue"}, {"TerreVerte", "Thistle"}, {"Titanium", "Tomato"}, {"Turquoise", "TurquoiseBlue"}, {"Ultramarine", "UltramarineViolet"}, {"VanDykeBrown", "VenetianRed"}, {"Violet", "VioletRed"}, {"WarmGray", "Wheat"}, {"White", "Yellow"}, {"YellowBrown", "YellowGreen"}, {"YellowOchre", "Zinc"}}]\)

colortable = 
      Table[Show[
          Graphics[{Symbol[colors[[k]]], Rectangle[{0, 0}, {1, 10}]}], 
          PlotLabel -> StyleForm[colors[[k]], FontSize -> 12], 
          DisplayFunction -> Identity], {k, 1, 
          Length[colors]}]

Show[GraphicsArray[Partition[colortable, 3]]]