Is it possible to display matplotlib plots in columns without using subplots? - python

I'm creating an HTML report with a lot of plots and corresponding tables. It's quite big, so it would be great if the user could copy/paste the plot title into Find In Page to quickly find the associated table(s).
This answer made me realise that's not possible and that printing the title to the screen would help.
However, I want to display the charts in 2 columns.
Is it possible to print the title, display a plot, print a title to the right, display a plot to the right, begin next column, and so on, without using plt.subplots()?
If not in matplotlib, are there any plotting packages that could do this?

Related

How do I show plot zoomed in?

I'm using matplotlib to show a plot with %matplotlib widget in jupyter lab. Almost every time I show the plot, next thing I have to do is zoom in and examine one of the sections of the plot. I would like to be able to show the plot zoomed into that section, and if I want to examine the rest of the plot, as I sometimes do, I would press back button and see all of it.
This is similar to showing subplot with relevant data or using plt.xlim, except I would like to do it in a single plot so the data I'm looking at can occupy more screen space, and plt.xlim just shows relevant stretch of data without possibility to zoom out again.
How do I do this is jupyter lab?

Bubble chart data input in Python (dash_alternative_viz) with Highcharts

Last days I play around with Highcharts in Python Dash with dash_alternative_viz library.
Link: https://github.com/plotly/dash-alternative-viz
I can create various charts, but I have major problem with creating Bubble chart. I do not know how to input data to this kind of chart. I tried many ways but as a result I get error or empty chart.
Like here below simple bar chart:
Does anybody used this package and somehow generated the Bubble chart, and can share source code so I can see how to deliver input in right format.
Thanks,
Albert

Context menu to select data source in matplotlib subplots (Jupyter)

I'm trying to build a dynamically customizable plot in jupyter with matplotlib. I already have sliders where I can select how many subplots shall be shown (x*y). But now I want to fill these subplots with data. I have a fix set of data series, and would like to have a context menu when I do a right click on the subplot where I could select the data series that shall be displayed. But I can't find any solution how to pop up a windows on a subplot and return the selected series. Do you have any idea/example for me how to solve this?
Thanks and best regards!

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.

How to create a user created textbox on top of matplotlib figure?

BackGround
I'm making this software right plot data as boxplots and scatter plots. To make the graph more informative and clear I wanted the user to be able to drag-create a textbox on top of the figure if they wanted to add notes. This way when people share the figure it can be explained through these notes.
Current Approach and Problem
I have used annotate function to create a textbox in the upper right corner of the screen to tell the user how many data points have been used, but there are of few problems with this approach.
This is the code I used to create a text box to tell the user how many data pts there are.
self.axes.text(.98, .98, 'Number of Data Points: {}'.format(len(self.cleanedY)),
verticalalignment='top', horizontalalignment='right',
transform=self.axes.transAxes,
color='black', fontsize=9.5)
Extensive input that would have to be asked of the user. This includes the position coordinates, the actual text box, type of alignment.
The only way I know how to collect this info would be to create a Qdialog window prompting for all these inputs, which would be too cumbersome.
User doesn't have much control over being able to freely position the textbox and would have to know exact decimals to position the text box on the figure.
This is incredibly inefficient and inflexible. I want a way for the user to EASILY create these notes on the plot figure.
TLDR: Is there any way to develop a simple drag and create textbox option on a plot figure?
I'm not sure if this is what your looking for, but i found this similar example online. It doesn't allow for user to create a textbox, but adds annotations to the figure and allows you to move them around.
here's the link
http://scipy-cookbook.readthedocs.io/items/Matplotlib_Drag_n_Drop_Text_Example.html

Categories