gnuplot-like style for histograms

24 views
Skip to first unread message

Sebastien Binet

unread,
Jul 12, 2013, 1:13:06 PM7/12/13
to plotinum...@googlegroups.com
hi there,

I have been trying to create histogram plots more in line with what
people in my field are accustomed to.
ie: something like the attached histogram.

I didn't find a way, w/o copy-pasting sections of plot.Plot and
plotter.Histogram, to:
- have the complete bounding box of the plot (ie: 2
plot.horizontalAxis and 2 plot.verticalAxis)
- have only the "external" lines for each histogram bin.

Did I miss something ?

Also, I am wondering what would be the best way to implement a
"histogram infos" box in which informations about the histogram would
be displayed:
Entries: 1000
Mean: 10
RMS: 42
...

- should this be implemented as a plot.Legend ? (and shoved in place
of the one of plot.Plot ?)
- as a sub-plotter of MyHistogramPlotter ? (so they are automatically
passed informations from that histogram)

-s
wpt.png

Ethan Burns

unread,
Jul 12, 2013, 4:56:43 PM7/12/13
to plotinum...@googlegroups.com
Hi Sebastien,

Plotinum doesn't support a full box outlining the draw area.  I don't like that style much, so I didn't implement it.  I may accept a patch to support it, if it is very unobtrusive.

There will never be complete agreement on how types of plots should look.  Plotinum allows users to create custom ways of displaying data in case the default styles are insufficent.  These are called "Plotters."  You should be able to make histograms that look the way that you want by writing your own custom Plotter for them.  It will take some extra effort on your part, but you can probably reuse much of the code for plotter.Histogram.  I also recommend that you take a look at the wiki page on how to create your own plotter (https://code.google.com/p/plotinum/wiki/CreatingCustomPlotters).  If you need additional help, then feel free to ask here on plotinum-discuss.

You can add additional information, like entries, mean, and rms, with plotter.Labels.  It lets you add text to your plot at any arbitrary data point.


Hope this helped,
Ethan

Sebastien Binet

unread,
Jul 12, 2013, 8:45:06 PM7/12/13
to Ethan Burns, plotinum...@googlegroups.com
Ethan,

On Fri, Jul 12, 2013 at 10:56 PM, Ethan Burns <burns...@gmail.com> wrote:
> Hi Sebastien,
>
> Plotinum doesn't support a full box outlining the draw area. I don't like
> that style much, so I didn't implement it. I may accept a patch to support
> it, if it is very unobtrusive.

ok. what do you think about the attached patch ?
(names are tentative...)

I am not completely satisfied with it though: when glyphes extend the
drawarea, the xlow/yleft/xup/yright axes don't join anymore...

-s
gnuplot.style.patch

Ethan Burns

unread,
Jul 14, 2013, 5:13:27 PM7/14/13
to plotinum...@googlegroups.com, Ethan Burns
Thanks for the patch.  My preference would be to leave it as-is for now.


Ethan

Dan Kortschak

unread,
Jul 14, 2013, 7:47:24 PM7/14/13
to Sebastien Binet, Ethan Burns, plotinum...@googlegroups.com
My comments on this: if a patch that makes this kind of behaviour
possible is accepted in the future, is to not make it closed-ended but
rather programmatically definable: The PlotStyle field would accept a
closure that makes the relevant alterations and Gnuplot would be a func
that makes alterations that result in a gnuplot-styled plot.

Dan

Sebastien Binet

unread,
Jul 15, 2013, 2:46:25 AM7/15/13
to Dan Kortschak, Ethan Burns, plotinum...@googlegroups.com
Dan,
I actually considered this but discarded it as -in order to be doable-
it would have required to expose more of the internals of the plot
package (verticalAxis, horizontalAxis and a bunch of their internal
methods).

-s

Dan Kortschak

unread,
Jul 15, 2013, 6:27:49 AM7/15/13
to Sebastien Binet, Ethan Burns, plotinum...@googlegroups.com
On Mon, 2013-07-15 at 08:46 +0200, Sebastien Binet wrote:
> I actually considered this but discarded it as -in order to be doable-
> it would have required to expose more of the internals of the plot
> package (verticalAxis, horizontalAxis and a bunch of their internal
> methods).

Yeah, fair enough. I think there may be reason in the future to expose
more of the internals, but this is obviously up to Ethan.

Reply all
Reply to author
Forward
0 new messages