Skip to content

Tag: matplotlib

fixing the toolbar i made with tkinter

i created a simple program with Tkinter but i have a small problem i have a graph and i am using .grid() to place it and webar1.get_tk_widget().grid(column=2, row=3, rowspan=20, sticky=”nesw”) the result is: the first result but then when i am aligning it to the left with column 0 like that bar1.g…

Recenter plot after set_xdata and set_ydata

I can use the set_xdata and set_ydata functions to update an existing matplotlib plot. But after updating I want to recenter the plot so that all the points fall into the “view” of the plot. In the below example, the y data keeps getting bigger but the zoom level of the plot remains same so the da…

Create a third curve from other two using python

I have two lists of xy coordinates, which I use to plot two curves. I’m interested in the area above the curves, so I used fill_between to arrive at this: Now, what I want is a way to get the coordinates that were not covered by the colored areas, so I can then plot a third curve like the red

Plot confidence interval of a duration series

I measured the duration of 6000 requests. I got now an Array of 6000 elements. Each element represents the duration of a connection request in milliseconds. [3,2,2,3,4,2,2,4,2,3,3,4,2,4,4,3,3,3,4,3,2,3,5,5,2,4,4,2,2,2,3,5,3,2,2,3,3,3,5,4……..] I want to plot the confidence interval in Python and in…

Gaussian curve fitting in physics

I have this data, I tried to fit by a Gaussian function but I can’t found an appropriate function, I tried using curve_fit from scipy.optimize : I used this code : this is the result of this fit : Very bad fit The error message : Answer First, you’re not fitting a Gaussian function, you’re f…