0
$\begingroup$

I am trying to graph the following:

Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {Black, Blue}]  

while making the two curves thicker. I have tried doing

Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {Black, Blue, Thick}] 

Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {Black, Blue, Thickness[.1]}] 

Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {Thickness[.1],Black, Blue}] 

All to no avail. In fact, the latter actually changes the colors slightly for some reason. So any help on how to change the color and make them thicker would be much appreciated!

$\endgroup$
6
  • 4
    $\begingroup$ Check Directive. Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {Directive[Black, Thickness[0.01]], Directive[Blue, Thickness[0.01]]}] $\endgroup$ – Anjan Kumar Jan 9 '18 at 18:15
  • 2
    $\begingroup$ Or you can use lists: Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> ({#, Thickness[0.01]} & /@ {Black, Blue})] $\endgroup$ – Bob Hanlon Jan 9 '18 at 18:45
  • $\begingroup$ Thanks @AnjanKumar! That did the trick perfectly! $\endgroup$ – user46348 Jan 9 '18 at 18:45
  • $\begingroup$ @BobHanlon Yours also works very well, and more compact. Thanks! $\endgroup$ – user46348 Jan 9 '18 at 18:47
  • 1
    $\begingroup$ or Plot[{E^x, x}, {x, -1, 2}, PlotStyle -> {{Thickness[.1], Black}, {Thickness[.1], Blue}}] $\endgroup$ – Mr Puh Jan 9 '18 at 18:48

Browse other questions tagged or ask your own question.