Hi Andrew

On 27/05/12 21:09, Dawes, Andrew M. wrote:
> I would like to write a plugin that would allow users (i.e. my research 
> students :-) to effectively calibrate the x and y axes of a graph by clicking 
> on data points and entering known values. This could be done at least two 
> ways:
> 
> a) create new axes that match the calibrated scale
> b) create new datasets that transform raw data to calibrated data
> 
> My first question is: does veusz do something like this already? And second, 
> can dataset plugins access mouse click events or graph coordinates in any way?
> 
> I'm happy to hear about any other solutions to this. The application is for 
> calibrating spectroscopic data to known spectra. We have some calibrated 
> references, and use those to scale data from other sources.

I'm afraid a plugin can't access mouse clicks or screen coordinates.
Plugins are run in the user interface thread so it would be hard for
them to wait for a click. There probably ought to be some sort of window
plugin where a user could easily add a new Qt window.

You can, however, access mouse clicks in embedded mode, if that is
useful. That's where you are using veusz as a python module. You could
load up a vsz file in a simple python script and get the clicks there
using GetClick(). These are returned as axis coordinates.

An alternative might be to use fitting to fit some sort of special
function to your calibration data to get the scaling parameters.
Alternatively, you could write a dataset or tools plugin where the user
iteratively enters parameters to make the data do what you want.

Jeremy


_______________________________________________
Veusz-discuss mailing list
Veusz-discuss@gna.org
https://mail.gna.org/listinfo/veusz-discuss

Répondre à