Category "matplotlib"

Function for subplots for real time plotting

I have a code which gives me 4 individual live plotting graphs for 4 different sensors. But, I want them in a single frame using subplots. Pasting 2 pieces of c

Geopandas not plotting correct colors

My Geopandas DataFrame has 3 polygons and 9 points with color_rgba column computed with matplotlib.colors.to_rgba function: import contextily as ctx import geop

how to set plt.xlimit with date and time

I can only set the x axis limit to a certain date, but not with hours, minutes seconds. My code looks like this: plt.figure() plt.plot(data.date,sig,'b-') plt.x

Tkinter DPI bug depends on how import is entered?

I have a weird question. In essence: why does the way I enter the pyplot import line into iPython influence my plot?! Try this (on Windows 10): Use a high-DPI m

Shap value plotting error on Databricks but works locally

I want to do a simple shap analysis and plot a shap.force_plot. I noticed that it works without any issues locally in a .ipynb file, but fails on Databricks wit

How to set space between the axis and the label in matplotlib

My code: #importing required libraries import numpy as np from matplotlib.patches import Polygon import matplotlib.pyplot as plt #plotting data def func(x):

Shap - The color bar is not displayed in the summary plot

When displaying summary_plot, the color bar does not show. shap.summary_plot(shap_values, X_train) I have tried changing plot_size. When the plot is higher th

Visualize Tensor [1,64,112,112] using matplotlib

I have a output tensor after convolution of dimensions [1,64,112,112]. Is there any way I can visualize this using matplotlib only, keeping in mind that imshow(

Stacked bars are unexpectedly annotated with the sum of bar heights

My data: names_col = ['Count','Freq'] dat = [['Matching', 56935],['Mismatching', 100587]] plot_df = pd.DataFrame(data=dat,columns=names_col) I trying plot stac

Getting Errors when combining Bar graph with line plot in Sea born [duplicate]

I am trying to combine a bar chart(with hue) and line plot (with hue). I am able to plot them separately. But together, I get some garbage gra

Bind event to click on plot in tkinter canvas

I can bind a click event to a plot (i. e. to print the coordinates that were clicked) like so: from matplotlib.backend_bases import MouseButton import matplotli

change seaborn scatter plot legend from number to text

Here is how I plot the decision boundary of my SVC` classifier. X, y = make_classification(n_samples=100, n_features=2, n_redundant=0, n_clusters_per_class=

Polygonal scatter diagram with python

I have a matrix of N observations and F features. Among the N observations, 5 represent reference samples that I wish to compare with others (with distance or s

coloring lines generated from numerical points

I calculate the eigenvalues of large matrices depending on a parameter and would like to plot the eigenvalues in different colors. So I do not have functions wh

Solve linear Inequalities

I want to solve a system of inequalities A x <= b, namely to visualize the set of solutions of this system. Are there any ways to do this in Python? The solu

are contour data (X,Y) ordered in a connected clockwise path in matplotlib?

As in the title: pl = plt.contour(X,Y,Z,levels=[0]) paths = pl.allsegs I wonder how are the data points in paths ordered. Specifically is it oriented clockwis

Connect lines in plot

I have a plot with the numbers 1-9 on the y axis. I have a data frame (gaze data) with numbers in this range over time. ex: 333337777772221115556668888

Reordering the high-level clusters from seaborn clustermap results

Is there a way to get from a to b in the following figure with scripting? I am using seaborn.clustermap() to get to a (i.e. the order of the rows are preserved.

x and y must be the same size

Using python I'm trying to plot a sin wave and random distribution, then show where the ratio is greater than or equal to 3. I think I'm 90% of the way there bu

Python scatterplot clustering

I have many scatterplots, that show subsequent events in time (i uploaded two pictures).I would like to separate these clusters of points and find their center