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®.
216 questions
1
vote
0
answers
436
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 ...
4
votes
1
answer
3k
views
Seaborn subplots massive whitespace [closed]
I'm trying to plot three heatmaps in a vertical column using Seaborns subplot method.
...
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 ...
1
vote
1
answer
2k
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 ...
2
votes
2
answers
8k
views
0
votes
2
answers
92
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 data ...
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-...
3
votes
1
answer
6k
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 ...
5
votes
2
answers
158
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 ...
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 ...
2
votes
0
answers
32
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....
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.
0
votes
1
answer
109
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, ...
2
votes
1
answer
2k
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 ...
0
votes
1
answer
63
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 ...
1
vote
1
answer
330
views
Naming the Axes of my Graph on iPython Using Matplotlib.pyplot
I am new to data science. I use Anaconda on windows 7.
I plotted a sine curve by doing the following on iPython:
...
0
votes
1
answer
971
views
how to draw a negative exponential plot of this situation with python
I have a dataset with binary output ($Y$) and I have a column (Duration) contains the duration of each task that is stored by "days" and varied from 1day to 350 days.
when I think logically in our ...
2
votes
1
answer
1k
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 ...
2
votes
0
answers
194
views
Python equivalent of Wolfram Language ParametricPlot3D?
The Wolfram Language as a ParametricPlot3D that can be used to interactively examine parametric functions in 3D. Which Python package and function(s) best ...
1
vote
0
answers
96
views
same color scheme for 2 pie charts
I want to visualize statistics from two large dataframes with similar data in two pie charts. I would like for these two charts to use the same color when the same category appears in the chart. I ...
1
vote
0
answers
82
views
How to draw diagram like this one (errorsbar)
I would like to draw a graph that looks like this one from:
The closest I have come is this graph:
by this code:
...
1
vote
1
answer
93
views
How to make this plot with python
I want to draw plot by python based on this data
...
2
votes
1
answer
281
views
Why do histogram bars vanish when we keep the bins value high in matplotlib?
Also, the histogram bar widths are different on certain values of bin.
How to keep the bar widths uniform?
I have tried using the rwidth but that dos not solve my problem.
Data:
...
1
vote
1
answer
2k
views
What's the best way to plot a bar graph with large numeric difference in values?
I'm graphing the value of the Ruble against the US Dollar in the 1990s. There was hyper-inflation from 1992-1997 (where the "y" values expanded from 125 to 6000). On Jan 1st 1998, the government ...
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 ...
2
votes
0
answers
138
views
How to force histogram plots to have same axes?
I am comparing my trained model with other benchmark models with the error histogram but the axis of histogram is different for each method as shown in figure.For instance to plot the error histogram ...
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?
...
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 ...
2
votes
1
answer
87
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 ...
0
votes
1
answer
358
views
matplotlib subplots_adjust - meaning of parameters
What are the meaning of values in subplots_adjust ?
left = 0.125 # the left side of the subplots of the figure
The documentation has number 0.125, etc but there is no explanation.
2
votes
2
answers
19k
views
Stacked barchart, bottom parameter triggers Error: Shape mismatch: objects cannot be broadcast to a single shape
I am working in python3 and I want to obtain a stacked barchart plot, showing three different variables on 5 different columns.
My code works fine if I do not add the 'bottom parameter' in plt.bar (...
0
votes
1
answer
3k
views
How to set limits of Y-axes in countplot?
df in my program happens to be a dataframe with these columns :
...
0
votes
1
answer
3k
views
How to print x-axes labels in pandas.Series.plot()?
I am trying to visualise my data to understand the data skewness. For that purpose, I use the below and get desired output -
...
2
votes
2
answers
10k
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 ...
1
vote
1
answer
153
views
How to place multiple graphs in same coordinate system (pandas,mathplotlib) -> look pic [closed]
in short how to set graphs in same coordinate system, not separated as in pic each in its own coordinate system in one frame....
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 :
...
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:
...
3
votes
1
answer
73
views
Ploting eigenvectors
I've generated two clouds of 3d points from multivariate_normal
...
3
votes
1
answer
277
views
ggplot (in R)/matplotlib (in Python) with linear model?
How can I plot the histogram below, using ggplot (R) and/or matplotlib (...
2
votes
1
answer
13k
views
Matplotlib -- TypeError: 'module' object is not callable
I am new into ML. As per video tutorials when i try to execute the following lines i get an error.
However the instructor get successful execution.
Error is :
i have google about it but didnt get any ...
2
votes
1
answer
15k
views
How to extract numerical data from a matplotlib scatter plot in python?
I have a scatter plot with about 19,000 data points. By visual inspection, I noticed some points for which I want to look at the corresponding numerical data from the data frame (basically a subset of ...
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:
...
1
vote
1
answer
90
views
How do I assign a title to each of the histograms I have posted at the same time? [closed]
fig, axes = plt.subplots(1,7, sharey=True)
df2.loc[df2.country == 'BR','date_created'].hist(xrot=90,bins=30,ax=axes[0],figsize=(20,4));
df2.loc[df2.country == 'CH','date_created'].hist(xrot=90,bins=...
3
votes
1
answer
494
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 ...
1
vote
1
answer
1k
views
Error when box plot [closed]
Code:
...
2
votes
1
answer
502
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 ...
5
votes
2
answers
31k
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 ...
5
votes
3
answers
52k
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 ...
2
votes
1
answer
2k
views
How to scatter plot with each dimension having its own color
I want to get insight for some values. I have two vectors of 300 dimensions, and want to compare them coordinate by coordinate. So I thought to plot each point with a different color, but the color ...