13
$\begingroup$

In version 9 I could do the following with the output as shown.

ListPlot[Table[{x, x^2}, {x, 0, 1, 0.1}], PlotRange -> All, Filling -> Axis, FillingStyle -> (Arrow[#] &)] 

Mathematica graphics

Now in version 10.0.2 with the same input I get the following.

Mathematica graphics

How do I get my arrows back? PlotTheme Classic does not help. Thanks

$\endgroup$
3
  • 5
    $\begingroup$ plot /. Line -> Arrow can be a quick fix. $\endgroup$ Commented Jan 18, 2015 at 17:58
  • 2
    $\begingroup$ Another quick fix is PlotMarkers -> "\[FilledUpTriangle]" $\endgroup$ Commented Jan 18, 2015 at 18:04
  • 1
    $\begingroup$ @ybeltukov Not exactly the same but very clever! $\endgroup$ Commented Jan 18, 2015 at 18:06

1 Answer 1

10
$\begingroup$

It seems this form still works:

ListPlot[ Table[{x, x^2}, {x, 0, 1, 0.1}], PlotRange -> All, Filling -> {1 -> {Axis, Arrow[#] &}} ] 

enter image description here


Caveat

The use of a Function as a filling style seemed undocumented, therefore one cannot expect the feature to remain or remain unchanged in new versions of Mathematica. ybeltukov notes in a comment that the form above does not work with multiple plot sets. In light of this I suppose that it would be better to write our own plotting function using Graphics primitives if this kind of customization is needed, since that functionality is documented and hopefully will not incompatibly change in future releases. (This is often faster as well as it avoids a lot of overhead associated with generalized plotting.) Post-processing is quick but also easily breaks between versions as the plotting output format often changes.

$\endgroup$
3
  • 1
    $\begingroup$ How to do the same thing for several lists of points? Even {1 -> {Axis, Arrow[#] &}, 2 -> {Axis, Arrow[#] &}} produces a strange error Filling::invfillentry: "{2->{Axis,Arrow[#1]&},2->{Axis,Arrow[#1]&}} is not a valid Filling specification. " $\endgroup$ Commented Jan 18, 2015 at 18:35
  • $\begingroup$ @ybeltukov Problem noted in the answer, along with my thoughts. $\endgroup$ Commented Jan 18, 2015 at 18:44
  • $\begingroup$ @Mr.Wizard Many thanks for your answer which I have now accepted. Also your comment. Probably a Graphics construct is best as you suggest. $\endgroup$ Commented Jan 19, 2015 at 22:01

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.