Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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®.

Filter by
Sorted by
Tagged with
13 votes
3 answers
3k views

What do Python's pandas/matplotlib/seaborn bring to the table that Tableau does not?

I spent the past year learning Python. As a person who thought coding was impossible to learn for those outside of the CS/IT sphere, I was obviously gobsmacked by the power of a few lines of Python ...
Uralan's user avatar
  • 143
9 votes
3 answers
11k 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 ...
Faiz Kidwai's user avatar
7 votes
3 answers
274 views

How to plot clusters in nice a way?

I have a large text dataset clusterized. Each cluster is represented by a centroid of the vectorized texts that belong to it, the number of texts, the created date, and other parameters. I can't plot ...
Federico Caccia's user avatar
6 votes
1 answer
45k views

How can I get rid of the white space in matplotlib?

I am doing a course in edx. While plotting in python, there is always a blank space before the beginning of the plot. In StackExchange, I have found a solution, which is mentioning the axis limit. ...
Faisal's user avatar
  • 61
6 votes
1 answer
17k views

Is there a way to Label/Annotate My Bubble Plot (Scatter plot with a z-axis) on matplotlib?

I would like to label my bubble plot, with the labels being INSIDE the bubbles. Something like this. Is There any way to do that? What I've tried: ...
Aakash Dusane's user avatar
6 votes
1 answer
6k views

How can I plot/display a dataset or an image distribution?

I want to view a specific image or a dataset's distribution, and see if they are different. Does simply writing something like : ...
Hossein's user avatar
  • 565
6 votes
1 answer
3k views

Correlation between specific columns of a data set

I have a CSV file which has 150 columns belonging to 7 categories but I want a correlation between 2 categories. The categories are movies and music, 12 and 19 columns respectively. Is there a way ...
Maha Kamal's user avatar
5 votes
3 answers
51k views

Scatter plot for binary class dataset with two features in python

I have my dataset that has multiple features and based on that the dependent variable is defined to be 0 or 1. I want to get a scatter plot such that all my positive examples are marked with 'o' and ...
Nitish's user avatar
  • 91
5 votes
2 answers
9k views

How can I draw bar graph in python on aggregated data?

Normally when I draw bar plot its simple as ...
Mutafaf's user avatar
  • 133
5 votes
2 answers
47k views

How to show percentage (text) next to the horizontal bars in matplotlib? [closed]

I am using seaborn's countplot to show count distribution of 2 categorical data. Fine it works but I want the percentages to show on top of the bars for each of the plot. Please how do I do it? ...
radioactive's user avatar
5 votes
2 answers
30k views

Plotting in Multiple Linear Regression in Python 3

So I'm working on linear regression. So far I've managed to plot in linear regression, but currently I'm on Multiple Linear Regression and I couldn't manage to plot it, I can get some results if I ...
hael's user avatar
  • 51
5 votes
2 answers
117 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 ...
ashukid's user avatar
  • 907
4 votes
2 answers
2k 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 ...
Taimur Islam's user avatar
4 votes
2 answers
850 views

Seaborn Scatter plot

I have a dataset containing of only one column, using matplotlib I was able to do the scatter plot the following way ...
E199504's user avatar
  • 605
4 votes
1 answer
18k 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. ...
Russell Gould's user avatar
4 votes
1 answer
2k views

Seaborn subplots massive whitespace [closed]

I'm trying to plot three heatmaps in a vertical column using Seaborns subplot method. ...
Tasty213's user avatar
  • 439
4 votes
1 answer
5k 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-...
N.M's user avatar
  • 191
4 votes
0 answers
2k 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.
AgentMoe's user avatar
3 votes
3 answers
592 views

Could you explain if this plot is good or bad. It is a sentiment analysis modelusing LSTM layers

Could you explain if this plot is good or bad. It is a sentiment analysis modelusing LSTM layers.20% of the data used for validation, and the remaining 80% for training.
SDhakZZZ's user avatar
3 votes
2 answers
37k views

ValueError: not enough values to unpack (expected 4, got 2)

I have written this code fig, (axis1, axis2,axis3, axis4)=plt.subplots(2,2,figsize=(10,4)) and I am getting this error ...
Mukul Agrawal's user avatar
3 votes
1 answer
354 views

Pandas Profiling Not Working

I have been working on EDA lately and i got to know about Pandas Profiling , but i am unable to import the module Pandas_Profiling , I could import the module on Google Collab but couldnt import the ...
Sahil Rathout's user avatar
3 votes
1 answer
248 views

ggplot (in R)/matplotlib (in Python) with linear model?

How can I plot the histogram below, using ggplot (R) and/or matplotlib (...
Learner132's user avatar
3 votes
1 answer
3k 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 ...
G.M's user avatar
  • 181
3 votes
2 answers
1k 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? ...
user134068's user avatar
3 votes
1 answer
2k 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 ...
cwanderroycbooks's user avatar
3 votes
1 answer
42 views

Ploting eigenvectors

I've generated two clouds of 3d points from multivariate_normal ...
s0nicYouth's user avatar
3 votes
1 answer
34k views

TypeError: Image data of dtype object cannot be converted to float [closed]

I am trying to convert files stored in a CSV file dataset to grayscale. I run the code which worked on my previous dataset but I now get this error: TypeError: Image data of dtype object cannot be ...
Jack's user avatar
  • 155
3 votes
2 answers
5k views

How plot GridSearch results?

I trained an SVM model with GridSearch ...
AziZ's user avatar
  • 149
3 votes
1 answer
123 views

F1 score graph skewed

The following code ...
E199504's user avatar
  • 605
3 votes
1 answer
503 views

Error while plotting Logistic Regression Classification

I was trying to plot by using the following code ...
Pradeep Singh's user avatar
3 votes
1 answer
642 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. ...
Girish Kumar Chandora's user avatar
3 votes
1 answer
5k 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 ...
JJJohn's user avatar
  • 623
3 votes
1 answer
469 views

unable to plot contour/surf graph of cost vs parameters for multiple linear regression.In python

After running gradient descent I have three arrays theta1 theta2 and J all three of size num_iterationx1. I tried plotting contours using the contour function in Axes3D and 3d surface plot using surf ...
roaibrain's user avatar
  • 163
3 votes
1 answer
10k views

Plotting multivariate linear regression

For practicing linear regression, I am generating some synthetic data samples as follows. First it generates 2000 samples with 3 features (represented by x_data). ...
lame_coder's user avatar
3 votes
0 answers
534 views

how can i plot probability distribution of my classes in the way below?

All, I would like to plot the following: I have a binary classification problem where I am using xgboost as my 'model' below: ...
Maths12's user avatar
  • 526
3 votes
1 answer
741 views

Plotting Gradient Descent in 3d - Contour Plots

I have generated 3 parameters along with the cost function. I have the $\theta$ lists and the cost list of 100 values from the 100 iterations. I would like to plot the last 2 parameters against cost ...
m2rik's user avatar
  • 321
3 votes
0 answers
455 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 ...
Shadab Hussain's user avatar
2 votes
1 answer
3k views

Any suitable way to describe the distributions of 2 Pandas Dataframes visually/graphically?

I am aware of the fact that the Pandas Dataframe's Statistical description can easily be obtained using df.describe(). I am having 2 dataframes of the same ...
JChat's user avatar
  • 197
2 votes
1 answer
4k views

Seaborn distplot and KDE data confusion

I'm running through a tutorial to understand the histogram plotting. Given the seaborn tips dataset, by running the sns.distplot(tips.tip); function the following ...
Andrea Moro's user avatar
2 votes
2 answers
255 views

How to plot number of Trees and OOBs score with Grid Search

I searched to find the answer but I don´t find something with Grid Search. I create a random forest and gradient boosting regressor with grid search. Now I want to make a visualization to see if the ...
ml_learner's user avatar
2 votes
2 answers
15k 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 ...
Mouad Alami's user avatar
2 votes
2 answers
5k 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 ...
Harish Kumar's user avatar
2 votes
1 answer
866 views

How can I get variable values from a plot?

I would like to know if there is any way in python to automatically determine the values of point a and b marked in the graph below. Said a different way, finding the values when my plot shows a ...
Nirmine's user avatar
  • 121
2 votes
1 answer
4k views

Histogram is extremely skewed to the left

everyone. Hope you are all okay. I am pretty bad at visualizations in Python. I am working on a movie dataset and now I want to understand how values of variable 'vote_count' for every movie in the ...
user641597's user avatar
2 votes
1 answer
69 views

Name of this type of cross variable interaction Plot

In recent papers of Social Network Analysis , I have been observing this particular type of graph used increasingly. I looked for what they are called to replicate the graph, but couldn't find the ...
Pujan Paudel's user avatar
2 votes
2 answers
9k views

keras plotting loss and MSE

Can someone give me a tip on how I could incorporate MSE & loss plots? I have been following some machinelearningmastery posts to plot this but the application is classification and I am ...
bbartling's user avatar
  • 403
2 votes
1 answer
1k views

Twitter Retweet Network Visualization

I am trying to visualize retweet network in order to find out which users are most likely to have most influence on other users. Here is my code: ...
Stefan Radonjic's user avatar
2 votes
1 answer
355 views

How to add numbers to the axes of a graph?

I am trying to make a graph of k (as in k-means) vs error, and I can't get it to show the actual number of k on the x-axis (1-15, not just the even numbers), nor any any numbers at all if I add a ...
Chor Hatara Hud'u Keturi's user avatar
2 votes
1 answer
2k views

Validation curve unlike SKLearn sample

I'm trying to implement the validation curve based on this SKLearn tutorial. On the site, it shows how based on the parameters the model goes from under- to overfitted, finding the optimal parameter ...
lte__'s user avatar
  • 1,320
2 votes
1 answer
28k views

how to create multiple subplots( scatterplot) in for loop

I want to create scatterplot of target variable with all the other variables in dataframe. Just like we create pairplot but as pairplot with large number of variables will take lot of time and ...
Strange119's user avatar

1
2 3 4 5