Thread overview | |||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 18, 2010 Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
I've successfully ported dflplot to gtkD and gotten it to the point where it works in every way (except speed/memory use; gtkD is a little slow/resource hungry) at least as well as the original DFL version. Now that I can't call it dflplot anymore because it supports multiple GUI libs, I'm calling it Plot2Kill. The status of the DFL version hasn't changed since I originally posted about dflplot. Here's what works and what needs work, with respect to the gtkD version wherever there's a difference: Working: Histograms, bar plots, scatter plots, line plots, QQ plots, ROC curves, heat maps, subplot windows, error bars, rotated text, programmatic saving in raster formats, interactive saving from default plot window (right-clicking brings up a save dialog), zooming in on a single figure from subplot window (double-click on the figure to zoom in). Needs work: Documentation needs improvement and needs to be put up somewhere (will happen once I get my own dsource project, as opposed to Scrapple), saving in vector formats, Cairo port, zooming in on areas within a single figure via the GUI (can be done programmatically), customizability of look and feel of figures (things like fonts, colors, margins, line styles, etc.), general refactoring from "make it work" to "make it right" stage. I would say that there will probably not be too many breaking changes (at the source level) to the basic API, i.e. creating a figure and showing it in a default plot window, but the more advanced stuff that you'd care about if you want to integrate plots into your own GUI is likely to be refined via breaking changes. A stable ABI will probably never happen because it constrains the evolution of the project too much. Code: http://dsource.org/projects/scrapple/browser/trunk/dflplot/Porting Demo figure (created and saved programmatically, no longer a screenshot): http://cis.jhu.edu/~dsimcha/plot2killGTK.png How to build: Install gtkD, and then just compile all of the .d files with to a library with -version=gtk. It doesn't matter if you pass in the DFL files when building the GTK version because all the irrelevant code will be version-statemented out. Please let me know if this works properly on OS's besides Windows. I've only tested it on Windows, although GTK is cross-platform and I only used the high-level gtkD functionality in this lib, so I don't see why it wouldn't work on any other OS with gtkD support. |
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | "dsimcha" <dsimcha@yahoo.com> wrote in message news:i1voke$2i9k$1@digitalmars.com... > I've successfully ported dflplot to gtkD and gotten it to the point where > it > works in every way (except speed/memory use; gtkD is a little > slow/resource > hungry) at least as well as the original DFL version. Now that I can't > call > it dflplot anymore because it supports multiple GUI libs, I'm calling it > Plot2Kill. The status of the DFL version hasn't changed since I > originally > posted about dflplot. Here's what works and what needs work, with respect > to > the gtkD version wherever there's a difference: > I love the new name. And if it ends up being a "killer app" (or really a "killer lib") for D, or for data plotting in general, then the name would be all the more appropriate :). This could also be great for providing better benchmarking data (See: http://www.zedshaw.com/essays/programmer_stats.html ). D could use this to help lead the way in statistically-meaningful benchmark data. |
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | dsimcha Wrote:
> Now that I can't call
> it dflplot anymore because it supports multiple GUI libs, I'm calling it
> Plot2Kill.
The produced image looks good and polished enough. But I suggest to find a different name. "dgraphy"? :-)
Bye,
bearophile
|
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | On 18/07/2010 22:36, dsimcha wrote:
> heat maps
Sorry for my ignorance,
What are heat maps good for ?
Since I am more biz software guy, here my question.
Let's say I have this relation
>A Project can have several Cost Centers.
>A Cost Center can have several cost items.
I our sample . Project -P- has say, 10 cost centers.
Cost Center no 1 takes already 60 percent.
The other cost centers (2-10) just take between 10 (blue) and 20 (green) percent.
-- So I want to color cost center no 1 related items in red.. . and the max percentage item in cost center no 2 dark red.
CC No 1 = {5,20,20,15}
Is this what a heat map is made for ?
and sorry , best example I am able to give atm..
bjoern
|
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to BLS | == Quote from BLS (windevguy@hotmail.de)'s article
> On 18/07/2010 22:36, dsimcha wrote:
> > heat maps
> Sorry for my ignorance,
> What are heat maps good for ?
> Since I am more biz software guy, here my question.
> Let's say I have this relation
> >A Project can have several Cost Centers.
> >A Cost Center can have several cost items.
> I our sample . Project -P- has say, 10 cost centers.
> Cost Center no 1 takes already 60 percent.
> The other cost centers (2-10) just take between 10 (blue) and 20 (green)
> percent.
> -- So I want to color cost center no 1 related items in red.. . and the
> max percentage item in cost center no 2 dark red.
> CC No 1 = {5,20,20,15}
> Is this what a heat map is made for ?
> and sorry , best example I am able to give atm..
> bjoern
You've pretty much got it. Heat maps can be thought of as a possible counterpart to bar graphs when you want to plot a dependent variable against two independent variables instead of one. The "hot" color is used to represent the largest value of the dependent variable, the "cold" color is used to represent the smallest value, and the colors are linearly blended for values in between.
There's also the case of a HeatScatter or 2-D histogram for visualizing a joint probability distribution. For small samples, scatter plots are usually used for this. However, for large samples, the amount of points on the scatter plot becomes unwieldy, so instead you bin the data on a 2D grid and the color represents how often joint realizations with a given pair of values occur. For example, the lower right figure in my demo is a HeatScatter where the Y-axis is distributed Normal(1, 1) and the X-axis is distributed Normal(-2, 1) + Y_i.
|
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to BLS | On 19/07/2010 00:01, BLS wrote:
> On 18/07/2010 22:36, dsimcha wrote:
>> heat maps
>
> Sorry for my ignorance,
> What are heat maps good for ?
>
> Since I am more biz software guy, here my question.
>
> Let's say I have this relation
> >A Project can have several Cost Centers.
> >A Cost Center can have several cost items.
>
> I our sample . Project -P- has say, 10 cost centers.
> Cost Center no 1 takes already 60 percent.
> The other cost centers (2-10) just take between 10 (blue) and 20 (green)
> percent.
>
> -- So I want to color cost center no 1 related items in red.. . and the
> max percentage item in cost center no 2 dark red.
> CC No 1 = {5,20,20,15}
>
> Is this what a heat map is made for ?
>
> and sorry , best example I am able to give atm..
> bjoern
My guess was okay, Heat maps are also made for this use case. so no need to answer.
Since Tree maps are not that different from Heat maps, do you have any plans to implement them too ?
Next, Do you have any ideas about zooming ? (zooming a plotting region) ?
and before I forget it again.. Good work David!
bjoern
|
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | On 19/07/2010 00:28, dsimcha wrote:
> You've pretty much got it.
Thanks for your enlightening explanation. I think your plotting tool is also very valuable in standard business environments!
I was just a second too late..so sorry for answering twice and making so much noise. bjoern
|
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to BLS | == Quote from BLS (windevguy@hotmail.de)'s article > On 19/07/2010 00:01, BLS wrote: > > On 18/07/2010 22:36, dsimcha wrote: > >> heat maps > > > > Sorry for my ignorance, > > What are heat maps good for ? > > > > Since I am more biz software guy, here my question. > > > > Let's say I have this relation > > >A Project can have several Cost Centers. > > >A Cost Center can have several cost items. > > > > I our sample . Project -P- has say, 10 cost centers. > > Cost Center no 1 takes already 60 percent. > > The other cost centers (2-10) just take between 10 (blue) and 20 (green) > > percent. > > > > -- So I want to color cost center no 1 related items in red.. . and the > > max percentage item in cost center no 2 dark red. > > CC No 1 = {5,20,20,15} > > > > Is this what a heat map is made for ? > > > > and sorry , best example I am able to give atm.. > > bjoern > My guess was okay, Heat maps are also made for this use case. so no need > to answer. > Since Tree maps are not that different from Heat maps, do you have any > plans to implement them too ? I didn't have any plans to implement them, as I didn't know about them until I looked them up on Wikipedia just now. I'll consider implementing them, but I'm not sure if it will happen soon. > Next, Do you have any ideas about zooming ? (zooming a plotting region) ? This can already be done programmatically (see Figure.xlim() and Figure.ylim()), but is not exposed yet via the default plot window GUI. This will be exposed when I decide how I want to expose it. The most obvious answer is dragging, but the question then becomes, how do you zoom back out? |
July 18, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | On 19/07/2010 00:44, dsimcha wrote: > This can already be done programmatically (see Figure.xlim() and Figure.ylim()), will have a look. > but is not exposed yet via the default plot window GUI. This will be exposed when > I decide how I want to expose it. The most obvious answer is dragging, but the > question then becomes, how do you zoom back out? Scaling : The solution which comes immediately in mind is by using a scale factor. (1.0 by default) I think the more interesting part is creating a rectangular area within your graph. ( I mean press left mouse button and create a rectangle) figure out which are the min. and max. values for each of the series, depending on the rectangle area. (series == ranges, I guess) Dragging ? Not sure what you mean. bjoern |
July 19, 2010 Re: Plot2Kill 0.02 | ||||
---|---|---|---|---|
| ||||
Posted in reply to dsimcha | "dsimcha" <dsimcha@yahoo.com> wrote in message news:i2004b$2vvo$1@digitalmars.com... > == Quote from BLS (windevguy@hotmail.de)'s article >> On 19/07/2010 00:01, BLS wrote: >> > On 18/07/2010 22:36, dsimcha wrote: >> >> heat maps >> > >> > Sorry for my ignorance, >> > What are heat maps good for ? >> > >> > Since I am more biz software guy, here my question. >> > >> > Let's say I have this relation >> > >A Project can have several Cost Centers. >> > >A Cost Center can have several cost items. >> > >> > I our sample . Project -P- has say, 10 cost centers. >> > Cost Center no 1 takes already 60 percent. >> > The other cost centers (2-10) just take between 10 (blue) and 20 >> > (green) >> > percent. >> > >> > -- So I want to color cost center no 1 related items in red.. . and the >> > max percentage item in cost center no 2 dark red. >> > CC No 1 = {5,20,20,15} >> > >> > Is this what a heat map is made for ? >> > >> > and sorry , best example I am able to give atm.. >> > bjoern >> My guess was okay, Heat maps are also made for this use case. so no need >> to answer. >> Since Tree maps are not that different from Heat maps, do you have any >> plans to implement them too ? > > I didn't have any plans to implement them, as I didn't know about them > until I > looked them up on Wikipedia just now. I'll consider implementing them, > but I'm > not sure if it will happen soon. > >> Next, Do you have any ideas about zooming ? (zooming a plotting region) ? > > This can already be done programmatically (see Figure.xlim() and > Figure.ylim()), > but is not exposed yet via the default plot window GUI. This will be > exposed when > I decide how I want to expose it. The most obvious answer is dragging, > but the > question then becomes, how do you zoom back out? What I do in one of my projects is : Press an hold the right mouse button to select the point which stays fixed, then dragging up zooms in, dragging down zooms out. If you set the zoom to work on an exponential scale it feels better also. Ie, scale by pow(2, (mousey-starty)/20), or something like. |
Copyright © 1999-2021 by the D Language Foundation