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

217 questions
13
votes
3 answers

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 code! Having arrived at an intermediate level…
Uralan
  • 143
  • 1
  • 8
9
votes
3 answers

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 discarded. Below is a plot of all distance…
Faiz Kidwai
  • 235
  • 1
  • 2
  • 12
7
votes
1 answer

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. However, in maximum cases, the starting points of…
Faisal
  • 71
  • 1
  • 1
  • 2
7
votes
3 answers

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 the clusters in an n-dimensional space. Which…
Federico Caccia
  • 760
  • 1
  • 6
  • 18
6
votes
1 answer

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 : # mydataset.shape = (50k,32,32,3) plt.hist(mydataset.reshape(-1)) do the trick? or should I be doing something…
Hossein
  • 565
  • 6
  • 14
6
votes
1 answer

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: plt.annotate(temp.index, (temp.gre_total, temp.ugrad_gpa)) plt.show() But that throws an error. I…
Aakash Dusane
  • 173
  • 1
  • 1
  • 6
6
votes
1 answer

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 to plot a correlation matrix or a correlation graph…
5
votes
2 answers

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 year, in 1 plot.
ashukid
  • 927
  • 8
  • 15
5
votes
2 answers

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

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? fig, ax = plt.subplots(1, 2) sns.countplot(y =…
radioactive
  • 405
  • 2
  • 4
  • 7
5
votes
2 answers

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 enter the values manually, but I couldn't manage to…
hael
  • 51
  • 1
  • 1
  • 3
5
votes
3 answers

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 negative ones with 'x'. I am using python and here…
Nitish
  • 91
  • 1
  • 1
  • 7
5
votes
2 answers

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

Normally when I draw bar plot its simple as import matplotlib.pyplot as plt from pylab import rcParams import seaborn as sb %matplotlib inline rcParams['figure.figsize'] = 5, 4 sb.set_style('whitegrid') x = range(1, 10) y =…
Mutafaf
  • 133
  • 1
  • 2
  • 6
4
votes
2 answers

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 data = pd.read_csv plt.scatter(data.index,data.coulumn1) I want the same graph using seaborn but I am not sure how to implement…
E199504
  • 607
  • 1
  • 6
  • 12
4
votes
2 answers

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 to choose model type).I already try this and the…
Taimur Islam
  • 951
  • 4
  • 12
  • 17
4
votes
1 answer

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. In matplotlib, I can change the color of marker…
Russell Gould
  • 81
  • 1
  • 1
  • 4
1
2 3
14 15