haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

feature request: some kind of raster plot

Open eflister opened this issue 10 years ago • 4 comments

i know it isn't in keeping with the vector emphasis of Chart, but i frequently have need for heatmaps of 2-d functions:

screen shot 2015-08-20 at 6 57 31 pm

it would be a pain to drag in JuicyPixels or something just for this. for now, i faked it like:

    spots = area_spots_4d_max_radius .~ 2
          $ area_spots_4d_palette    .~ palette
          $ area_spots_4d_values     .~ values
          $ area_spots_4d_opacity    .~ 0.9
          $ def

    palette = uncurryRGB (rgbUsingSpace sRGBSpace) <$> (\h -> hsv h 1 1) <$> [0..360-1]
    values = (\((x,y),v) -> (x, y, 2::Int, v)) <$> f

where f :: (Fractional a, Fractional b) => [((b,b), a)], but this is obviously not an efficient rendering.

eflister avatar Aug 21 '15 03:08 eflister

vector contours of same would also be appreciated!

eflister avatar Aug 21 '15 03:08 eflister

This actually came up on reddit recently:

https://www.reddit.com/r/haskell/comments/3a21tx/color_mapheat_map_plotting_without_gnuplot/

It wouldn't be too hard to add.

There's actually a long running pull request for contour plots (https://github.com/timbod7/haskell-chart/pull/47). I haven't merged it as I didn't like it's lack of smoothing. Would this be useful to you as is?

timbod7 avatar Aug 24 '15 11:08 timbod7

Also, an older discussion on heatmaps on the mailing list:

http://projects.haskell.org/pipermail/chart/2012-May/000028.html

timbod7 avatar Aug 24 '15 11:08 timbod7

yeah, i'm not too picky -- basic support for heatmap and contour would be appreciated, it can always be improved later...

eflister avatar Aug 26 '15 23:08 eflister