[Chart] Arrows

Tim Docker tim at dockerz.net
Tue May 28 12:17:57 BST 2013


Hi,

  think it would probably be done with a new type of plot, perhaps 
called ArrowField? Something like the below. This is assuming that you 
want to size the arrow heads in device coordinates (not plot 
coordinates). That way zooming the graph will change the lengths of the 
arrows, but not the size of the arrow heads.

Tim

data ArrowStyle = ArrowStyle {
     -- | Styling for the arrow body
     arrow_line_style_ :: CairoLineStyle,

     -- | Styling for the arrow head
     arrow_fill_style_ :: CairoFillStyle,

     -- | The length of the arrow head in device coordinates
     arrow_head_length_ :: Double,

     -- | The width of the arrow head in device coordinates
     arrow_head_width_ :: Double,

     -- | The amount by which the rear of the arrow head cuts back in 
device coordinates
     arrow_head_indent :: Double
}

data PlotArrowField x y = PlotArrowField {
     plot_afield_title_        :: String,

     plot_afield_style_        :: ArrowStyle,

     -- | The arrows to be plotted
     plot_afield_values_       :: [(x,y,x,y)]
}




On 28/05/13 01:21, Sacha Sokoloski wrote:
> Hello,
>
> I'm trying to plot a vector field, and would like to be able to have 
> arrowheads at the ends of my lines in a lines plot. What would be the 
> best way to go about this?
>
> Cheers,
>
>  - Sacha
>
> _______________________________________________
> Chart mailing list
> Chart at projects.haskell.org
> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart




More information about the Chart mailing list