# Questions tagged [matplotlib]

Matplotlib is a plotting library for Python which may be used interactively or embedded in stand-alone GUIs. Its compact "pyplot" interface is similar to the plotting functions of MATLAB®.

103 questions
Filter by
Sorted by
Tagged with
19 views

### Matplotlib : ValueError: shape mismatch: objects cannot be broadcast to a single shape [closed]

Getting the below error for plotting a bar graph. Kindly help. ...
16 views

### What types of variables are these? And what types of tests could I run?

So, I recently made a sheet of data collected from the 2010 Census on Cincinnati neighborhoods. The data is from demographics about the neighborhoods of the city such as median household income and ...
8 views

### Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
50 views

### How to plot time series data from SQLite database

I am trying to plot time series data by accessing the SQLite database. I successfully connect the database by coding the below script,however, i couldn't figure out how to plot the time series data ...
88 views

### Python: Plotting equation with the Dirac Delta function

I am attempting to plot the expected diffraction pattern from a sharp razor which has a formula of: $$I(p) = \frac 14 \delta^2(p) + \frac {1}{4\pi^2p^2}$$ where $p = \frac {\sin\theta}{\lambda}$ I ...
12 views

### regarding 3D scatterplot with line in Python or Matplotlib

In Matplotlib or other python library, how to generate the 3D scatter plot with line, shown as following? It seems that ...
15 views

### Plot line at X axis based on Values of Y axis - maplotlib/seaborn

I have made a dist plot and now I want to plot a line on the x-axis based on the value of the y-axis. ie. I want to plot a line at various maximas/peaks and also shade a portion of the x-axis between ...
6 views

### Retrieving range on axis based on the peak point in scatter plot

I have a scatter plot that shows data of products sold & sales for each store. As visible in the graph that there is spike in sales from 60-70. I need a way to extract this range. Since i need to ...
24 views

### IndexError: too many indices for array

Attempting to load a dataset and print out a prediction for each array, yet I keep getting an IndexError.... ...
15 views

### Calculating co-variance matrices and plotting the co-variance value

I have an excel file with 10 samples drawn from a two-dimensional normal distribution. There's 20 columns. Sample 1 would be column 1,2. Sample 2 = col 3,4 ect. I'm trying to plot 10 separate ...
32 views

### Python : How to output graphs using lists method and how to change graph lines to “-” or “*” [closed]

Question Please show me Python programming codes that shows graphs using the list method. Moreover, I want to know how to change graph lines to "-" or "*". Thank you for your answer in advance. <...
103 views

### Best way to visualize huge amount of data

I have a data set of around 3M row. I has only 2 category (category- 2:1 ratio). Now i want to visualize(scatter plot) it's distribution to understand can the data linearly separable or not(In order ...
14 views

### How do I plot between 2 variables in a summation equation?

I am new to Python and using Jupyter notebook. Following is the summation equation that I have: $$y(t) = \sum_{i=1}^{t-1} a_{i}y(t-i)$$ How can I plot between variables y and t by formulating this ...
25 views

### how to create multiple plot from a panda Dataframe

I want to plot multiple plots. The data is stored in a pandas dataframe and each row should be a seperate plot. Each row has an ID (ZRD_ID) which doenst matter and a date (TAG) and 24 values to be ...
59 views

### How to creat a plot for the accuracy of a model

Iam pretty new to the whole topic so please dont be harsh. I know these may be simple questions but everybody has to start somewhere ^^ So I created (or more copied) my first little Model which ...
11 views

### Code line explanations: Visuals of LogRegression

Why do we use -1 and +1 in the following code? ...
62 views

### Plotting facetgrid in subplot for IRIS dataset

I'm trying to plot 6 selected pair subplots with the combination of facetgrid of seaborn and scatter plot from matplotlib. I'm getting plot, but subplots remains empty whereas facetgrid gets plotted ...
51 views

### Why is my Python Altair chart printing a blank line?

Wondering if anyone can help me understand why python altair chart is not printing... I’m only seeing this when I run the code: It literally isn’t outputting anything. This is what my chart looks ...
240 views

### Group small values in a pie chart

When plotting a Pie chart from a dictionary using Python's matplotlib, I get some classes that are too mashed together because of their small size. Is there a way to group the smallest values together ...
37 views

### How to put the variable names of pandas data frame on Diagonal of Seaborn PairGrid?

The given below code is not working now(earlier it was working) to put the column names on the diagonal of Seaborn PairGrid. ...
40 views

### How to rotate the plot and find minimum point?

I want to rotate the below curve to 45 degree and then find the minimum point. For this, I have tried with below code: ...
58 views

### Changes in the standard Heatmap plot - symmetric bar colors, show only diagonal values, and column names at x,y axis ticks

I have a heatmap image (correlation between all matrix columns) and I'm straggling to preform all the changes below within the same image: bar colors should be symmetric around zero (e.g., ...
684 views

### How do I change the marker edge color of a seaborn relplot?

I am trying to output a complex facet grid plot in the format of the following image: But the problem is that I don't want the edge color of the markers to be white, I want it to be the face color. ...
359 views

### In elbow curve how to find the point from where the curve starts to rise?

I am computing a distance metric on my data. The result is then being sorted in ascending order. The samples having distance more than a specific threshold are to be marked as outliers and will be ...
38 views

### Export frequency and group to excel sheet in column after plotting by matplotlib

I got the nice plot but I want to export the data of x and y in column to excel sheet ...
91 views

### How can I adjust the legend when visualizing clusters in two dimensions?

How can I change the legend as we can see now the legend has some cluster numbers missing. How can I adjust the legend so that it can show all the cluster numbers (such as Cluster 1, Cluster 2 etc, no ...
57 views

### Pandas, make the bars of a bar graph have equal widths

What do I need to change so that ax1 uses the same width for bars as ax2? ...
66 views

### Why are the regions/decision boundaries overlapping with multi-class classification using SVM in sci-kit?

I am using the SVM in scikit-learn library for doing multiclass classification. I am wondering why these regions (decision boundaries) are overlapping (as seen in the picture below)? Could someone ...
47 views

### Exporting from matplotlib

I'm finding a quicker method to export plots ...
13 views

### How do i annotate my markers in such a way to visualize buy and sell? [duplicate]

my dummy data for close price ...
211 views

### Matplotlib pyplot: How to plot multiple trends in different areas of the plot?

I am trying plot some trends using matplotlib.pyplot. The task is straightforward, but there is one detail I can't get right. I wish to plot a numpy.array called ...
11 views

### How to draw proper chart of distributional tree?

I am using python with matplotlib and need to visualize distribution percentage of sub-groups of an data set. imagine this tree: ...
156 views

### Seaborn subplots massive whitespace

I'm trying to plot three heatmaps in a vertical column using Seaborns subplot method. ...
119 views

### Place a marker on a plot

I want to place a Call Marker on a plot. Call should be "buy" whenever the smaller moving average (21) crosses over longer moving average (34) AND the Call should be "sell" whenever smaller moving ...
100 views

### Meaning of confidence interval in seaborn barplot

I'm working with titanic data.I'm using seaborn barplot to understand the data so what this line means?I know it's 95% confidence interval,but how to understand this graph some of the line is long ...
93 views

### Making Inference from a Correlation Heatmap

I have constructed a Heatmap of my dataset for visualization. I have searched on various sites regarding what can I infer from the heatmap and I am unable to get any clear understanding from them. I ...
445 views

...
18 views

### How do I fix mis-rendered matplotlib?

How do I correct my data or format it so that it is presentable, and fix my graphs? Dataset is 345551 rows × 7 columns. I am using numpy, pandas, seaborn and matplot lib. It seems that my pricing ...
13 views

### Plotting the value change in regression CNN

I have trained my CNN on thousands of images with different hyperparameters, now I want to show the difference on the output for each individual image. I mean ...
930 views

### Jupyterlab Inline Interactive plot

I am trying to make my inline plots in jupyterlab interactive. So far, I have tried a suggestion as pointed out here, among others: https://stackoverflow.com/questions/50149562/jupyterlab-interactive-...
59 views

### Is there a way to put a separate line between clusters for k-Means Clustering?

k-Means Clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. here is a piece of code to perform a 2-d k-Means ...
50 views

### Which plot to use for data spanned on multiple years?

I've a dataset of - Number of accidents that happens in each state. The dataset spans from 2001 to 2014. Which plot should I use to represent the information - number of accidents in each state per ...
216 views

### Plotting Weibull distribution on Wind Speed

I have a 720 hourly set of wind speed and wind direction data and I want to fit the Weibull Distribution on it. After searching for some time, I wrote the following code in Python to get my ...
16 views

### Z values get rescaled while plotting in 3d

x_3d = 5.171875 , 5.3125 , 5.171875 ... 6 y_3d = 0, 1, 2, 3, 4, 5, .... 1500 (1500 points) z_3d = -10.493983 , 22.128998 , -14.582531 , 34.687847 , 11....
231 views

### How to create a heatmap inside a polar chart [closed]

I would like to build something like this. Creating a polar chart isn´t an issue, but i have no idea how to implement the round areas and the color gradients into the plot.
37 views

### Plot misclassfied values in matplotlib

I have two lists. One is target and another is predicted values in a binary classification. The target is always zero. And I have to plot the results of the prediction against target in such a way, ...
128 views

### Scatter Plot with Conditions

Suppose I have a data frame name = ['A', 'B', 'C'] score = [2,4,6] I want to create a scatter plot with the following conditions, color the bubble as green if ...
19 views

### Is my iPython Installation Valid?

I just want to know if my ipython is properly installed. I have both Python and Anaconda installed on my Windows. I entered the "pip3 install ipython" command on the Command Prompt and it downloaded ...