Adding data to particular data point on plot using mouse click - python

I have developed subplots in mayavi and I want to add data on a particular point on that graph after clicking on that point. I have used mayavi.mlab.text3d but the text is not present on the data point. How to fix 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?

Moving Data of Scatter Plot Graph manually

I'm building a dashboard using Dash in Python . My requirement is to plot a Scatter plot with values and move those values manually up and down which will perform a call back based on the new value the dot is moved inside the scatter plot.
My question is there a way to move the dots inside the scatter plot ? I read through internet and I was not able to find any solution . However I can see hovering/clicking the dots that does a call back but was not moved. Can anyone help me with this question.
Thanks,
Prathap

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

Python, matplotlib, wxpython - Anyway to move an canvas from one frame to another?

So I don't really have any code to show as it's a very large script I have currently. Having said that I will try and add a simple example shortly.
Basically lets say I have two frames in wxpython, each containing a single panel with a matplotlib canvas. Lets call these canvases graph1 and graph2.
So I know how to plot directly into graph1, using standard methods.
I was wondering if there is any way I could change the location of graph1 into that of graph2, i.e. move the plot to the second frame (window).
Basically I am trying to implement a full screen option for the user, which upon clicking a graph will maximise it into the second frame. I am hoping I can do this just by changing the references rather than re-drawing etc. as I want it to keep the original state of the graph when it maximises.

Python Visualization: Determining Data Attributes Visually by Mouse Hover and Click

I am rendering very large X,Y,Z scientific datasets in the lateral plane and would like to click on the results to obtain greater textual detail about the area chosen by mouse-click.
So, for example, imagine a scientific dataset which is rendered as a filled contour plot and there is a bright spot. I would like to click on that spot to obtain a link or other textual information.
This would necessitate having another plane that would provide attribute information.
I would be most appreciative for any direction that others have used in similar cases. I expect this problem has been solved previously so I would prefer not reinventing the wheel.
Sounds like you'll need to dive into matplotlib's event handling code. This allows you to take some action when you click on a piece of the plot, or press a key, or whatever. Here are the example programs on the matplotlib site that have to do with event handling.

Categories