Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several vertical plots side-by-side on the same scale? #33

Open
estan opened this issue Mar 8, 2016 · 1 comment
Open

Several vertical plots side-by-side on the same scale? #33

estan opened this issue Mar 8, 2016 · 1 comment
Labels

Comments

@estan
Copy link

estan commented Mar 8, 2016

I'm in the process of trying to achive a series of side-by-side plots like this:

hole_plots

The plots show results from the analysis of a drill core. The scale on the left is the depth down the drilled hole, and it should always be visible. The user should then be able to add and remove plots (showing e.g. element concentrations, rock density, ...) alongside this scale. In the sketch above I've shown two plots added, the first has two plot items, the second has one plot item.

My question is how to best accomplish this with PythonQwt?

My idea is to use a lone QwtScaleWidget for the scale, put it as the first item in a QHBoxLayout, and then each of the QwtPlot widgets in the same QHBoxLayout. But when using a "detached" QwtScaleWidget like this, how can I make sure that the QwtPlot widgets I put alongside it really line up with the scale properly? The positioning must be perfect, since the whole point is that the user can look at different results along the analysed core and compare them.

I'll also need to allow "zooming" and scrolling. I plan on implementing the zooming by simply adjusting the plot axis scale of all the plots simultaneously when the zoom is changed, and scrolling with a QScrollBar where I attach the scroll bar's rangeChanged signal to a slot that update the plot axis scale of all the plots. Do you see any immediate drawbacks to this approach?

@estan
Copy link
Author

estan commented Mar 9, 2016

I realize the above was a little vague, so to be more brief/specific, my questions are:

  • How can I align the "origin" of multiple QwtPlot widgets to the origin of a separate QwtScaleWidget? The independent variable in each QwtPlot will be the same (the depth down the drill hole), but the dependent variables (element concentration, density, ...) can be on distinct scales, which is why I'm keeping them as separate plots (and also because you wouldn't want all the plot items in the same plot). E.g. in the above sketch, the scale of the plot to the right could have been say 0...50 instead of 0...100, so distinct from the one on the left.
  • Is there any way to accomplish the look above with a single plot? (I'm guessing not).

Any advice on this is much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants