Create two linked graph in Python - python

Good morning.
I am nwe to Python, I would need to make two "linked" graphs, so that the value in one of them could be selected (in the image the one on the right) and the other would be updated (In the image the one on the left)
The data is a "normal" dataframe with 5 columns, the graph on the right is the first column and depending on where you will select in that graph, update the 2nd graph with the data from the row, updating as the selection is changed.
I don't know how it could be possible in Python or what libraries to use.
Greetings and thank you

Related

Tibco SPOTFIRE - How to create lists of unique values from data table for creating a new data table

i'm pretty new about using spotfire and I've to realize some bar and line charts like those graphs I realized with python and matplotlib :
bar chart from python
line chart from python
In order to realize those graphs, I created a set of unique values for the x axis which contains differents sprints of stories (refer to jira and agile method for more informations) and i created 3 lists (begin, planned and ends) for gathering all of the business values for each sprint occurence. Then I created a pandas dataframe gathering my 4 new lists and I used the columns with matplolib to realize the graphs (the second graph shows the cumulative sum of begin and end business values per sprints).
My question is : is it possible to create a list of unique values for the x axis in spotfire and how to create a data table from another data table, just like I did for the python graphs ? All I can get for the moment by using spotfire is this :
bar and line charts from spotfire
I already tried to merge each graphs of the same category together in order to get the same result however the two x axis (begin and ends) do not have the same number of values and i get some errors if i try. If anyone had a solution that can solve that problem, it would be great.
PS : I can't give any data files cause i'm working for a society and some of those data could be confidential and sorry for potential clerical errors, cause i'm french.

python, how to have dynamically updating plotting, with pre-computed values in dataframe?

I didn't read a Python programming assignment clearly enough apparently and I'm required to have dynamically updating plot. That lab is already late and I'm not really fishing for a complete answer just a nudge in the right direction how I should implement this because thus far Ive only implemented static regular plots in matplotlib.
I'm doing this in jupyter notebook thusfar.
I already have pre-computed x (which is just indeces from 0 until the last one)
and pre-computed y (for each indeces from 0 until last one). There isn't going to be new data.
the key is to have the plot start such that the first 7 x's are visible, and then for those x's, you would have the y's visible.
then the plot should update such that the 0eth x disappears, and 8th x appears and is plotted. So the it keeps rolling like a 7-sized window rightwards across those values.

Creating heatmap of US locations changing over time with python

The data I have is a set of occurrences of a general event in various US states for a given set of years. All I care about illustrating is 1) the year of the occurrence(s), and 2) the location (state) of the occurrence(s).
I am using state capital latitude and longitudes as the location of each point plotted, and want each point on the map to have a color corresponding to the number of occurrences in that state, in that year. I would like to create a map subplot; essentially create one of these maps for each year of available data and plot all those maps together to visualize the change in location of events over time.
So far, the closest thing I have found I can do is create a scattergeo plot using python and plotly (i.e. the figure at the bottom of this: https://plot.ly/python/map-subplots-and-small-multiples/ ), which gives me the desired map subplot over time, but I cannot figure out how to make each of the submaps into a heat map, rather than a simple scatterplot. Any ideas would be greatly appreciated! As you can probably tell I'm a python noob, but I hope I was able to make my problem clear!

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.

Showing a table after rotating by 90 in wx-python

I have to display a table with multiple columns but only a single row. Displaying it in the normal way using wxGrid doesnt look appealing at all and makes it hard for the user to read. I want to know if there is any way in which I can flip the table and display its contents vertically? Also is there any other way to make the data more presentable?
Just label the rows with the column names and the make one column. Then you could scroll through it that way. You just need to call SetRowLabelValue(rowNum, label). You may find this tutorial helpful (see the end): http://www.blog.pythonlibrary.org/2010/04/04/wxpython-grid-tips-and-tricks/
You could use a ListBox, but then you'd lose the label information.

Categories