Gaël Ecorchard | 6 May 2011 11:49
Picon
Favicon

Shift by the first value

Hello everyone,

I wrote a very simple dataset plugin which shifts a dataset so that the dataset
starts with 0. Mostly useful to shift a time axis (x axis) that doesn't start
with t=0 at the beginning of the measurement.

Notice that this can be done with builtin features, but it is not as easy:
- define a function "start = lambda x: x[0]", then 
- create a new dataset "newdataset = olddataset - start(olddataset)").

------------ plugin start ------------
import veusz.plugins as plugins

class ZeroShiftDatasetPlugin(plugins.DatasetPlugin):
    """Dataset plugin to shift a dataset, so that it starts at 0."""

    # tuple of strings to build position on menu
    menu = ('Compute', 'Shift by first value...')

    # internal name for reusing plugin later
    name = 'ZeroShift'

    # string which appears in status bar
    description_short = 'Shift dataset by its first value'

    # string goes in dialog box
    description_full = ('Shift a dataset by its first value. '
                        'The new dataset starts with zero.')

    def __init__(self):
(Continue reading)

Stefan Costea | 13 May 2011 18:46
Picon
Favicon

Log window, contour labels

Hello, 

First of all, thank you for this great application. I'm using it in embedded
mode for plotting tens of data files.

First question: does or will Veusz have a 'log window' where all actions that
took place in GUI mode translate to script mode ?

Second question: how do I change contour options in script mode (others than in
the examples put on Veusz website, such as contour labels options) ?
Jeremy Sanders | 13 May 2011 19:50
Gravatar

Re: Log window, contour labels

Stefan Costea wrote:

> First question: does or will Veusz have a 'log window' where all actions
> that took place in GUI mode translate to script mode ?

Not really, but the saved file format is just script mode commands. Just 
save the plot and look at what is produced in a text editor.

> Second question: how do I change contour options in script mode (others
> than in the examples put on Veusz website, such as contour labels options)
> ?

The easiest way is to change the option in gui mode and look at what was 
done in the saved file.

I was writing an automatically generated api documentation but unfortunately 
other things have taken priority :-(

Jeremy
Jeremy Sanders | 13 May 2011 19:51
Gravatar

Re: Shift by the first value

Gaël Ecorchard wrote:

> Hello everyone,
> 
> I wrote a very simple dataset plugin which shifts a dataset so that the
> dataset starts with 0. Mostly useful to shift a time axis (x axis) that
> doesn't start with t=0 at the beginning of the measurement.

Thanks for the plugin. Is it ok if I include it in Veusz?

Jeremy

_______________________________________________
Veusz-discuss mailing list
Veusz-discuss <at> gna.org
https://mail.gna.org/listinfo/veusz-discuss
Ian Riley | 20 May 2011 05:22
Picon
Picon
Favicon

Some initial thoughts

Veusz is great.  Well done Jeremy.

A couple of things would help to make it more useful where I publish.

[1] Axis labelling should have consistent precision/style (e.g. 0.0 0.5 
1.0 1.5 2.0 rather than 0 0.5 1 1.5 2, or 1x10^2 1x10^3 1x10^4 rather 
than 100 1000 10^4, and such like). On first look, I couldn't see any 
option to control this.

[2] Legends should have symbol only, line only, and symbol+line options. 
  If a figure uses only symbols to distinguish datasets then only 
symbols should appear in legend, and vice versa.  A mixture of line 
types and symbols should only be used if they indicate separate 
categories of data, e.g. solid line = treated, dashed line = untreated, 
symbol 1 = species 1, symbol 2 = species 2 etc. So what might be helpful 
is to not only have a way to control whether symbol, line or both are 
given in a legend, but also to have two legend types - one for symbol 
types and one for line types.  Of course, a way around this for me would 
be not to include a legend in the figure itself but rather include this 
information in the figure caption. So it is really not that much of a 
limitation.

These thoughts are just for your information. I guess, I could get 
inside the code, see how it all works and write extensions to do these 
things. We will see.

Keep up the good work. Ian
Benjamin K. Stuhl | 20 May 2011 06:02
Picon
Favicon

Re: Some initial thoughts

On Thu, May 19, 2011 21:22, Ian Riley wrote:
> [2] Legends should have symbol only, line only, and symbol+line options.
>   If a figure uses only symbols to distinguish datasets then only
> symbols should appear in legend, and vice versa.  A mixture of line
> types and symbols should only be used if they indicate separate
> categories of data, e.g. solid line = treated, dashed line = untreated,
> symbol 1 = species 1, symbol 2 = species 2 etc. So what might be helpful
> is to not only have a way to control whether symbol, line or both are
> given in a legend, but also to have two legend types - one for symbol
> types and one for line types.  Of course, a way around this for me would
> be not to include a legend in the figure itself but rather include this
> information in the figure caption. So it is really not that much of a
> limitation.

If this is an urgent concern, note that you can add "dummy" plot widgets
that exist only to provide symbols for the key, rather than put the key
labels on your actual widgets. I've done this to insert blank slots in a
multi-column key so that the key fits better around my data. It's hardly a
fix, but it might be a viable work-around.

Regards,
-- BKS
Jeremy Sanders | 20 May 2011 12:13
Gravatar

Re: Some initial thoughts

Ian Riley wrote:

> [1] Axis labelling should have consistent precision/style (e.g. 0.0 0.5
> 1.0 1.5 2.0 rather than 0 0.5 1 1.5 2, or 1x10^2 1x10^3 1x10^4 rather
> than 100 1000 10^4, and such like). On first look, I couldn't see any
> option to control this.

I'm away again at the moment, but you can change this by going to the 
formatting properties for the axis, going to the Tick labels tab, and 
changing the Format option. 

The drop down box gives you some sample options (hover over the mouse to get 
details). It uses C-style formatting for the numbers, with extra Veusz 
options (%Vxxxx) for Veusz specific options. Unfortunately it's not that 
well documented. You can use %.1Ve to get scientific notation with a single 
decimal point (%.0Ve for no decimal points).

Jeremy

Gmane