Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Hi I'm trying to put together a graphing template. Unfortunately, my arrowheads are a different colour than my functions when the graph is exported to something like a PDF. Is there a way I can manually set the arrowhead colours in CMYK using this setup? I'd also like to change the function arrowheads to lines instead of enclosed arrows. Here's the important parts. The arrowheads come from the last line.

ClearAll["Global`*"];
Interpretation[{f = {  1/(x - 1) + 1, Sin[x], -x, x}, 
  points = {{3, 2}, {-5, -8}}, min = -10, max = 10, size = 0.5, 
  rmin = -10, rmax = 10, gridx = 1, gridy = 1, hlabel = "x", 
  vlabel = "y"}, 
 Panel[Grid[{{Style["Plot Characteristics", Bold], SpanFromLeft},
    {"Functions:", InputField[Dynamic[f]]}
    }]],

 Plot[f, {x, min - 0.58*gridx, max + 0.58*gridx},

   PlotStyle -> {{AbsoluteThickness[1], 
      CMYKColor[0, 0, 0, 1]}, {AbsoluteThickness[1], 
      CMYKColor[0, 0.83, 1, 0]}, {AbsoluteThickness[1], 
      CMYKColor[1, 0, 0, 0]}, {AbsoluteThickness[1], 
      CMYKColor[0.36, 1, 0, 0]}, {AbsoluteThickness[1], 
      CMYKColor[0.63, 0, 1, 0]}, {AbsoluteThickness[1], 
      CMYKColor[0, 0, 0, 1]}}
      ]
  /. Line[x__] :> Sequence[Arrowheads[{-.02, .02}], Arrow[x]]
 ]
share|improve this question

1 Answer 1

up vote 1 down vote accepted

This appears to change the arrow heads to your preferred style:

ClearAll["Global`*"];
Interpretation[{f = {1/(x - 1) + 1, Sin[x], -x, x},
  points = {{3, 2}, {-5, -8}},
  min = -10, max = 10, size = 0.5,
  rmin = -10, rmax = 10,
  gridx = 1, gridy = 1,
  hlabel = "x", vlabel = "y"},
 Panel[Grid[
   {{Style["Plot Characteristics", Bold], SpanFromLeft},
    {"Functions:", InputField[Dynamic[f]]}}]],
 Plot[f, {x, min - 0.58*gridx, max + 0.58*gridx},
   PlotStyle -> {
     {AbsoluteThickness[1], CMYKColor[0, 0, 0, 1]},
     {AbsoluteThickness[1], CMYKColor[0, 0.83, 1, 0]},
     {AbsoluteThickness[1], CMYKColor[1, 0, 0, 0]},
     {AbsoluteThickness[1], CMYKColor[0.36, 1, 0, 0]},
     {AbsoluteThickness[1], CMYKColor[0.63, 0, 1, 0]},
     {AbsoluteThickness[1], CMYKColor[0, 0, 0, 1]}}] /. Line[x__] :>
   Sequence[
    Arrowheads[
     {
      {-.02, 0, Graphics[Line[{{{-1, 1/2}, {0, 0}, {-1, -1/2}}}]]},
      {.02, 1, Graphics[Line[{{{-1, 1/2}, {0, 0}, {-1, -1/2}}}]]}
      }
     ],
    Arrow[x]]]

output

I don't know about the CMYK colors for the arrow heads - I don't see why they should be different from the lines...

share|improve this answer
    
Thanks. At least half the problem is solved. –  keystonethewizard Jun 30 '13 at 3:39
    
@keystonethewizard You can insert CMYKColor calls into the Graphics[] expression that draws the arrow-heads... –  cormullion Jun 30 '13 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.