Skip to content
Advertisement

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.get_tk_widget().grid(column=0, row=3, rowspan=20, sticky=”nesw”) the tool bar is centered

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 data points quickly get

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 a clearly arranged manner. Do you have any Idea how I should plot them? Answer From what I understood this code should

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 fitting the sum of a

How to change colors for decision tree plot using sklearn plot_tree?

How to change colors in decision tree plot using sklearn.tree.plot_tree without using graphviz as in this question: Changing colors for decision tree plot created using export graphviz? Answer Many matplotlib functions follow the color cycler to assign default colors, but that doesn’t seem to apply here. The following approach loops through the generated annotation texts (artists) and the clf tree

Advertisement