Re: [guppi-list] Re: Plot idl
- From: Havoc Pennington <rhpennin midway uchicago edu>
- To: guppi-list gnome org
- cc: gnumeric-list gnome org
- Subject: Re: [guppi-list] Re: Plot idl
- Date: Thu, 17 Sep 1998 23:43:59 -0500 (CDT)
On Thu, 17 Sep 1998, Dean Brettle wrote:
>
> Yeah, its a real mess. As far as the IDL is concerned, I would just
> stick with "simple" scatter plots for now with 1 X Vector and 1 Y
> Vector. If the user wants to overlay multiple plots, they can create
> the plots from within gnumeric (through calls to guppi's Plot
> interface), and then use guppi directly to overlay the plots and move
> axes around.
>
Agreed on keeping the IDL simple for now. We'll see how I can do this
inside Guppi and then worry about exporting it.
> Within guppi you could use something like this (simplified and in C for
> brevity):
>
> struct Axis {
> char *label;
> double *minimum;
> double *maximum;
> double *position; /* Allows for left/top, right/bottom, or in between
> */
> };
>
> struct 2DScatterPlot {
> /* Note that Axes can be shared between plots... */
> struct Axis *x_axis;
> struct Axis *y_axis;
>
OK right now I have linked lists of X and Y axes in the ScatterPlot class;
the Axis class used to contain a list of Vector (not called that, but same
thing) with each Vector corresponding to a plot in the array. So plot
(0,1) for example would use the Vector from X axis 0 and Y axis 1.
On your suggestion I split the Vector and the other aspects of Axis today,
which turned out well, but it hasn't rippled throughout the code. It will
do so as I add overlay capability.
> /* ...and so can Vectors (which can also be provided by a remote
> server)*/
> Vector *x_vector;
> Vector *y_vector;
> };
>
> struct TwoDScatterPlotList {
> /* Linked list of plots in display order. */
> /* C array, C++ Vector<>, etc, would work equally well. */
> struct TwoDScatterPlot *plot;
> struct TwoDScatterPlotList *rest_of_plots;
> };
>
This is sort of what I have, only I have been structuring things with axes
rather than the plots; since plots will now hold the data to be plotted,
they will become more central. This is kind of a big change, if you
include the UI changes. I'm also keeping the plots in a matrix rather than
a list because you have to be able to easily blow away an entire row or
column when an axis is added/deleted.
wrt: some of the stuff on the gnumeric-list-only thread -
For plotting Vectors of different lengths, Guppi currently just ignores
the extra values in one of them. If that's not good enough you could just
create a new Vector which is the subset you want of the longer one.
Re: who should hold the values - you could either stuff the values into
Guppi's native format with a one-time operation, or you could subclass
Guppi's "Vector" class to wrap a CORBA object. Or both; both should be
fairly easy to implement. The one-time stuffing will have trouble syncing
with the client, I imagine, and the CORBA object wrapper will be a good
bit slower than Guppi's native object, so it's a tradeoff.
Error bars: these are planned as are many other plot frills, but I'm
trying to get infrastructure before knocking out too many specifics that
have to be kept in sync with the infrastructure.
Other big gaps are PostScript and load/save; I don't even want to think
about it. :-)
Well, I'm exhausted and have to get up early tomorrow, so I had better go
to bed.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]