Skip to content

GnuplotRB loops undefinitely when trying to generate a histogram #10

@do-you-dare

Description

@do-you-dare

I got some issues when trying to generate a histogram. I had no problems with points and lines, just with histograms. Below is a minimal example that recreates the behavior - at least on my machine.

require 'daru'
require 'gnuplotrb'
include GnuplotRB

days = %w(Monday Tuesday Wednesday Thursday Friday Saturday Sunday)
mean = [121.2, 95.6, 91.06, 133.037, 81.88, 82.33, 200.45]
std = [206.05, 94.35, 108.15, 208.53, 114.27, 104.77, 320.66]

cdata = Daru::DataFrame.new({ day: days, mean: mean, sd: std }, name: "test")

plot = Plot.new(cdata,
                style_data: 'histograms',
                style_fill: 'pattern',
                title: "Test")

plot.to_png 'test.png'

If I change style_data to lines, it works as expected.

I'm using Ruby 2.3.0, with gnuplotrb 0.3.4 and daru 0.1.4.1. Gnuplot is version 5.0 patchlevel 3.

Thanks for your work with this :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions