Align plots in Qt - python

I want to be able to nicely align the description and the plot of following configuration:
I want to achieve that every plot has the same size, i.e. they end all on the same imaginary vertical line. The channel names should be aligned. Currently, I'm using a QGridLayout. The plots were created using Qwt.

Related

Get boxplot rectangles coordinates in plotly

I need to draw additional graphics on top of plotly go.Box traces, therefore I need to know X and Y coordinates for boxplot rectangle vertices. So far the only solution I came up with is basically recalculating everything (quartiles; X positions based on boxgap, boxgroupgap, etc.), then manually setting the y-axis range to know where everything will end up on the plot. This seems very cumbersome.
Is there a way in python to get the coordinates of go.Box boxplot elements, especially the grouped boxplots with categorical x-axis? As far as I understand these coordinates are calculated in JS frontend -- maybe there is some trick to get them back with Dash using callbacks?

How to delete a plot from chart space in pptx python?

I'd like to delete plot that is in the chart space. Does any one know how to do that with pptx python? Since there's option to delete plots in powerpoint GUI. Is there any way I can do that with python pptx?
I have four charts in a slide and I want to first store the shapes of plots and then delete the plots inside of the charts.
Reading the docs I found this paragraph that shows in more detail how plots work:
A plot is like a sub-chart, containing one or more series and drawn as
a particular chart type, like column or line. This distinction is
needed for charts that combine more than one type, like a line chart
appearing on top of a column chart. A chart like this would have two
plot objects, one for the series appearing as columns and the other
for the lines. Most charts only have a single plot and python-pptx
doesn’t yet support creating multi-plot charts, but you can access
multiple plots on a chart that already has them.
From your question I assume that you want to delete the plot to replace it with a new one. I suggest that you delete the series inside the existing plot and add to it the new series you need.

Adjusting width of single data barplot

I am automating making reports based on particular locations. Certain graphs contain bar graphs with only one bar and they span the width of the graph. I tried using axes.set_xlim(0, len(data)-1) but ended up with the graph looking like the top one in the attached picture, if there are more than one bars. When I have multiple bars, usually leaving out axes.set_xlim gives a decent graph (last graph in picture). I know using width in the graph will only work is there are two or more bars.
I used len(data) since data is a list and the length would tell me how many bars are going to pop up.
My graph code is within a for loop, so each iteration will have a different length for data
Is there a way to adjust the widths accordingly?

How to add box plots on top of scatter plot

I want to plot boxplots on top of the scattered points like this.
I know I have to bin the data into intervals first but I couldn't find the function that does all of this. Sample x and y data are saved here as .npy.
I would look into using matplotlib. Boxes can be drawn as such:
https://matplotlib.org/gallery/pyplots/boxplot_demo_pyplot.html?highlight=boxplot
and scatter plots can also be drawn as such: https://matplotlib.org/gallery/lines_bars_and_markers/scatter_demo2.html?highlight=scatter
There is a search functionality on their site, along with plenty of documentation on how to utilize their library.
As for your specific question, you can specify zorder when drawing many of the things in matplotlib, and you could use that to define your boxplots to be on top. I believe if no zorder is defined that it draws items in the order they are encountered in your program (so you could draw scatter plots and then box plots and they should appear correctly as in your diagram above!

Is there an easy way to zoom two plot widgets at once?

I am currently working on a graphical display tool for EEG data. My group wants to be able to zoom the plot to see certain channels. However, there is a separate widget beside the waveform plot which displays the labels for the channels.
I want to make it so that when the waveform plot is zoomed (say using ViewBox's RectMode zoom), the channel labels will also zoom. I have included a picture of our display for reference.

Categories