Hellow!
I have some x coordinate, how can i get y coordinate of QwtPlotItem?
In advance many thanks for your help!
Hellow!
I have some x coordinate, how can i get y coordinate of QwtPlotItem?
In advance many thanks for your help!
No information about almost nothing - do you really expect a useful answer for such a request ?
Uwe
Sorry for my bad english
As i understend you not understend my answer
I have some qwt item in the my plot, item consist of many points
Is there some function through which i can get x coordinate throught y coordinate of some point in my item
For example:
I have graphic of y = 2*x
cout << item->someFunction(2) // I get 1, because in the point with coordinate y = 2, there is x coordinate = 1
Is there such function?
And if there is not such funtion, how can i write such function?
O.k. so you have some individual type of plot item - nothing derived from QwtPlotCurve or QwtPlotAbstractSeriesItem.
Qwt doesn't know about what is displayed by user type plot items ( or any function that was used to build points ). How do you expect such a method to be implemented ?Is there some function through which i can get x coordinate throught y coordinate of some point in my item
Then x = 0.5 * yI have graphic of y = 2*x
Uwe
For example:
I have graphic of y = 2*x
cout << item->someFunction(2) // I get 1, because in the point with coordinate y = 2, there is x coordinate = 1
Here you have found the solution yourself. ;-)
To find the x for a given y value you divide that y value by 2.
More complex functions can have the same y value for several x values. So that wouldn't be very usefull. If that's not the case you can calculate it easily like you did.
A side note... Provided there exists function y = f(x), the inverse of that function --- x = g(y) where for every x: y=f(x) doesn't have to be a function. A simple example is y = x^2. An inverse relation has two solutions for all arguments but 0 (e.g. 4 = 2^2 but also 4 = (-2)^2 therefore g(4) = {-2, 2} ). Therefore such mapping as you want can't possibly exist in a general situation.
Ok, i am understend
Thank you for your help!
Bookmarks