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

48 questions
Filter by
Sorted by
Tagged with
35 views

### 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 ...
675 views

### Fitted planes' normal vector not perpendicular

I fitted a plane into a set of points in R3 using minimization of L2 error (taken from this post: https://gist.github.com/amroamroamro/1db8d69b4b65e8bc66a6). ...
22 views

### visualizing the scatterness of higher dimensional data using python

I have a set of unlabeled data $x \in \mathbb R^n$, and I want to visualize how scattered those points are using python. In dimension 2, we can just use plt.scatter which is quite straightforward. I ...
673 views

### How to plot multiple classifiers' ROC curves using scikitplot? [closed]

I have classified a data with multiple classes (not binary) by using several classifiers, and I would like to compare the performance of these classifiers by drawing their ROC curves using scikitplot. ...
27 views

### Visualize multiple rejection reasons

Goal: Visualize why loans are rejected which can be due to multiple reasons. A loan is either rejected or accepted. Any rejection is caused by one or more rejection reasons. There is a list of ...
110 views

### 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 ...
161 views

### Interactive dendogram with plotly and custom distance, linkage functions

I have a matrix X and usually I use scipy to make a dendogram and plot it: ...
27 views

### Why when I increase the standard deviation in the pdf function the graph looks squeezed instead of more dispersed?

So what I am doing is this: ...
42 views

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 ... 0answers 31 views ### How should multiple *continuous* features on an embedding plot like UMAP be depicted? For the MNIST digits dataset, it is pretty straightforward to colour the various points of its UMAP/t-SNE projection. For continuous values of features, it is less obvious to me. For a case of, say, ... 1answer 53 views ### Detect clusters from graph [closed] I have a csv with near about 156 columns. I want to plot the Scatter graph with one of the columns as X axis and another one as Y axis. By making combinations of 150 columns i will be generating 11K ... 1answer 95 views ### A better way of visualizing extreme oscillation curve in matplotlib? [closed] Here are three curves. I'm training a model and trying to plot the training loss curve; the x-axis is iterations and the y-axis is loss value: All the curves contain many spikes and noises. I'm ... 3answers 3k views ### 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 ... 2answers 408 views ### Best way to visualise impact distance against launch speeds and angle I am modelling the trajectory of a projectile, incorporating atmospheric drag. I am calculating the distance from the launch point for when the projectile impacts the ground. I have generated this ... 0answers 28 views ### Is there a way I can plot my data as an animated graph with respect to time? [closed] I am looking to create an animation that plots data onto a graph so it appears on screen gradually. My data comes in the form of a row vector, where the actual values in the vector will be plotted ... 0answers 39 views ### Python: How to find the value that separates 2 different clusters? I am applying an unsupervised learning algorithm for building an anomaly detection using OneClass SVM method and then plotted it to visualize how it looks. I got 2 clusters: one red and the other ... 0answers 121 views ### Finding similarity dissimilarity between different groups of vectors Suppose I need to combine or group together set of vectors in one area and another group in other areas, however I need to place these groups in a plot so they are scattered in the screen per ... 1answer 976 views ### What to do when a scatter plot doesn't appear to plot all data? ... 1answer 19 views ### Matplotlib: Why would a KNN regression model draw a line through ALL points regardless of K? Having difficulty doing something very basic: create a random dataset taking on values between -1,1, plot them, and also fit a KNN model to the data and fit it over the data. Using numpy to create the ... 2answers 33 views ### Choosing the right type of plot for my pandas dataframe I have been confused because I don't know which type of plot I must choose. I have a data frame with two columns suppose the first one is the id of a person and the second one the number of houses ... 0answers 112 views ### how to visualize the graph use matplotlib on polynomial and multiple regression with multiple predictors Multiple: y=b0+b1X1+b2X2+b3X3....bnXn Polynomial: y=b0+b1X+b2(X)^2+....bn(X)^n Step1: Importing package import pandas as pd import numpy as np import sklearn import matplotlib.pyplot as plt import ... 1answer 985 views ### Calculate a p-value for SVM-plots on Iris dataset (2D-data) [closed] I analyzed the Iris dataset by using the Python libraries: Matplotlib, seaborn, sklearn and mlxtend. An example of a plot is shown : and my code is : ... 0answers 358 views ### Get rotation of noisy rectangular 2d point cloud with pca I have a set of point clouds in nd space. The clouds tend to be rectangular in nature in 2d space but can easily have outliers or look slighly L shaped. I would like to rotate the point clouds so that ... 0answers 453 views ### 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 ... 0answers 339 views ### Matplotlib Plot Difference Between Two Unsorted Value Series I am trying to figure out how to plot the following in Matplotlib. Suppose I have a sample of 1000 random operations. There are two ways to perform each operation: a new way and an old way. My data ... 1answer 47 views ### How to get insights from an amalgamation of histograms I want to see how the age of road traffic accidents victims change throughout the year. Ive done this by amalgamating lists of the ages of victims from 05-16 and created a histogram for each year. Ive ... 1answer 4k views ### 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: ... 0answers 82 views ### Visualisation strategies for weight matrices in convolutional neural networks What are some common strategies to visualise a weight matrix in a convolutional neural network? I.e. visualise a matrix with the form (kH, inD, outD) in 1D convolution, and (kH, kW, inD, outD) in 2D ... 0answers 12 views ### Enhance gap between analytic and interpolated data in visualization I have two data sets, disposed in a 3Dplot. one set represents the interpolated data, the other the analytic. Each set lies on a separate grid. I have plotted the data with python matplotlib on a ... 1answer 1k views ### How to interpret the dendrogram graph axis (hierachical clustering )? Here is the reproducable code with dataset used `from scipy.cluster import hierarchy import matplotlib.pyplot as plt ytdist = np.array([662., 877., 255., 412., 996., 295., 468., 268.,400., 754., ... 1answer 459 views ### Doing PCA with$m$vectors in$d$dimensions and then plotting only$n$vectors, when$n<d<m\$

I have a dataset with about 2 million vectors, the dimension is 200 (D = 200). I want to plot just a few (N = 20) of them in a ...
52 views

### How can I plot the correlation between app downloads and session duration?

For example, the data could be: App A, 100-500 downloads, 20 mins App B, 100-500 downloads, 75 mins App C, 500-1000 downloads, 30 mins and so on. I want the overall correlation as well as app-wise ...
84 views

### Visualizing a time series data to compare the scores of groups based on each day of participation

I have the following data but not sure about the best way to visualize it. Average assignment scores for the users starting to participate in the first, second, third, and so on, days of the course. ...
2k views

### How to Illustrate correlation in binary classification

I ran a correlation in a binary classification problem between one variable and the prediction to determine whether a linear correlation exists. The code: ...
573 views

### How to compute the normalized overlap area between two curves [duplicate]

I am trying to calculate the overlap area (normalized by the total area) of two plots. The plots are from X Y datasets. I saw a lot of questions about getting the overlap area but from normal ...
115k views

### 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 ...
2k views

### How to visualize (make plot) of regression output against categorical input variable?

I am doing linear regression with multiple variables. In my data I have n = 143 features and m = 13000 training examples. Some of my features are continuous (ordinal) variables (area, year, number of ...
3k views

### Can a Precision-Recall curve or a ROC curve be horizontal?

I am working on a binary classification task on imbalanced data. Since the accuracy is not so meaningful in this case. I use Scikit-Learn to compute the Precision-Recall curve and ROC curve in order ...
192 views

### What kind of graph should I choose

I have gathered criminal activity and GDP from 2012 to 2015 for over 30 countries and I'm trying to confirm my hypothesis about how higher GDP decreases criminal activity, but I'm baffled over which ...
2k views

### 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 ...
658 views

### Convert time scalar field to velocity vector field

I am trying to figure out if it's possible to create vector velocity field from some raster containing spatial distribution of scalar variable (timestamp of some mass-media event in my case). Here is ...
6k views

### 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 ...
11k views

### Plotting a Gaussian in Python

I am trying to plot a histogram of my data, and I seem to be a little confused here. I am using matplotlib in Python. Here is the code from their website: ...
2k views

### Too big (?) histogram values when using normed histo options in SciPy and matplotlib

I have been trying to create a normed histogram using either SciPy or matplotlib (or anything for Python). When I create my histogram with 'normed' option disabled, it looks like below (this example ...
837 views

### Need to find cumulative probability distribution given this data set

So I have a data set like so: ...
8k views

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