Questions tagged [matplotlib]

matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms.

The matplotlib library is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in python scripts, the python and ipython shell (a la Matlab or Mathematica), web application servers, and six graphical user interface toolkits.

55 questions
20
votes
2 answers

How to name the ticks in a python matplotlib boxplot

Python matplotlib has a boxplot command. Normally, all the parts of the graph are numerically ticked. How can I change the ticks to names instead of positions? For illustration, I mean the Mon Tue Wed labels like in this boxplot:
Peter Smit
  • 2,030
  • 3
  • 23
  • 36
15
votes
2 answers

Show average instead of median in boxplot

When plotting a boxplot with python matplotblib, the lines halfway the plot is the median of the distribution. Is there a possibility to instead have the line at the average. Or to plot it next to it in a different style. Also, because it is common…
Peter Smit
  • 2,030
  • 3
  • 23
  • 36
9
votes
4 answers

Finding outliers without assuming normal distribution

I have small datasets of size 40-50 points. Without assuming that the data is normally distributed I wanted to find out the outliers with 90% confidence at least. I thought boxplot could be a good way to do that but I am not sure. Any help…
Abhi
  • 191
  • 1
  • 1
  • 6
6
votes
4 answers

How to display magnitude of change over time between two series?

Disclaimer: I know absolutely nothing about statistics. I've had trouble searching for answers to my question, as I don't have much knowledge about the terminology of statistics. I'm currently trying to plot a graph with two sets of values that are…
boopyman
  • 225
  • 3
  • 6
5
votes
2 answers

Interpreting weird box plot with reversed whiskers

Although I'm fairly new to box plots, I thought I had got the hang of them, until I came upon this one today. I don't know what to make of that bottom "whisker" drawn inside the box. This population is composed by only four values: 16.5, 17.14,…
Filipe Correia
  • 173
  • 1
  • 2
  • 8
4
votes
1 answer

Label on the y-axis in a normalised histogram

If you have a histogram with frequency on the y-axis and bins for different ranges of values on the x-axis, then it is reasonable that the label on the y-axis should be frequency. But if these frequencies are normalised, what is the correct y-label?…
3
votes
1 answer

Fitting Pareto distribution to data example in SciPy

In docs.scipy.org there's code to sample data from a Pareto distribution and then fit a curve on top of the sampled data. I could understand most of the code snippet except the term max(count)*fit/max(fit) in the call to plt.plot. Here's the code…
3
votes
3 answers

Python: "Normalizing" kde, so it always lines up with histogram

In Python, I am attempting to find a way to plot/rescale kde's so that they match up with the histograms of the data that they are fitted to: The above is a nice example of what I am going for, but for some data sources , the scaling gets…
3
votes
1 answer

What to do when a scatter plot doesn't appear to plot all data?

df = pd.DataFrame({'input': [3009861162, 548584145, 950178496, 984257236, 447403092, 447403094, 445305942, 445306198, \ 2592658903, 2592921015, 2592920999], 'output': [2917869018, 622408909, 621393093, 749384917,…
hlkstuv_23900
  • 133
  • 1
  • 6
3
votes
1 answer

Plot the probability mass function

I am trying to plot the probability mass function of a sample of a discrete metric. If it was continuous, I know that using pandas it would be as simple as calling: sample.plot(kind="density") But I'm afraid that this is not enough (or not right)…
2
votes
1 answer

Plotting histogram for given ages correctly

I am plotting a histogram with given 'ages': import matplotlib.pyplot as plt import numpy as np ages=[1, 1, 1, 2, 2, 2, 2, 2, 2, 30, 30, 30, 150, 152] plt.hist(ages, edgecolor='black') plt.title("Scores vs.…
cpx
  • 263
  • 3
  • 9
2
votes
0 answers

Outlier detection in curve fitting

In this picture you can see the measured datapoints (blue) and a curve I fit in (orange). The value with x=10000 seems like an outlier, and I am thinking about removing it, to get a better fitting curve. However, I don't want to remove it…
Marco
  • 121
  • 2
2
votes
2 answers

Violin plot of 2 numpy arrays with seaborn

I would like to compare the distribution of 2 numpy arrays using a violin plot made with seaborn. The maximal value in both arrays is 1. The plot suggests a higher maximum. Am I misunderstanding the violin plot? import numpy as np import seaborn as…
2
votes
1 answer

How to compare volatilities of cryptocurrencies

Data: daily spread (highest price - lowest price at a given day) of Bitcoin, Ethereum and Ripple. The spread values are an absolute amount in US$. Bitcoin is worth much more than the other two and Ethereum is worth much more than Ripple, so when I…
2
votes
0 answers

Estimating the multivariate normal distribution parameters from a set of 3D points

I have a set of 3D points, which look as follows: They form a shape similar to Gaussian/parabolic function or a mixture of these and my goal is to extract this shape. I thought I could estimate parameters of a multivariate Gaussian from these…
1
2 3 4