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
0
votes
1
answer
3k
views
how to limit datetime in x axis
Hello folks,
I am trying to plot three variables in a single XY plot. I am having a problem setting the x-axis limit which is for time. I tried setting limits using x_limit but getting ...
1
vote
1
answer
5k
views
Plot Decision boundary in 3D plot [duplicate]
I am running logistic regression on iris dataset. I computed thetas and this is how I draw a decision boundary line.
...
1
vote
1
answer
790
views
Plot hurricane track
Hello folks,
Recently while going through a research paper I happened to come across a plot showing the hurricane track(figure attached). Can anyone say how it is plotted or anyone has ...
3
votes
1
answer
135
views
F1 score graph skewed
The following code
...
0
votes
1
answer
569
views
Plotting clustered sentences in Python
I have the following three sentences, extracted from a dataframe. I would like to check the similarity and create clusters based on their level of similarity.
...
0
votes
1
answer
731
views
Bar plot with varying length
Hello folks,
I am trying to plot a grouped bar plot of two variables with varying lengths, which means the x and y length of both the variables are different. The format of the data is ...
0
votes
1
answer
705
views
Vertical lines of overlapping points in Seaborn Swarmplot
When I plot my data to see its distribution via Swarmplot, these two vertical lines that seems to even overlap occur in the figure.
It seems to occur even around values that are not that dense, such ...
-1
votes
1
answer
3k
views
Matplotlib Bar graph -ValueError: shape mismatch:(x,y)
While plotting the bar graph for number of attempt on x-aixs and time-taken on y-axis as per below code, getting Value error.Trace of error is included below.
...
0
votes
1
answer
3k
views
Changing the default scale of a plot to a "custom scale"
I am trying to change the scale of the x_axis for a plot.
The default is generating divisions of 20 units (0-20-40-60-80-100-120).
I tried changing to log, but then I get 0-10-100, which helps ...
1
vote
1
answer
58
views
Having and issue plotting horizontal chart
So for some weird reason I can't manage to fix the plotting issue
Any suggestions?
...
1
vote
0
answers
1k
views
Finding multiple histogram graphs with Seaborn
When graphing with matplotlib I get this 4 histograms model: 4 Histograms
Using Seaborn I am getting the exact graph I need but I cannot replicate it to get 4 at a time:
I want to get 4 of the ...
1
vote
0
answers
402
views
Images matching using bf.match and drawing using cv2.drawMatches Python
I have successfully matched 2 images using bf.Match and drawn matches as well. Now, I am trying to match multiple images from 2 different directories.
For this, I am using 2 different array to store ...
1
vote
1
answer
5k
views
Size Issue when Plotting the Predicted Vaue
I wrote a simple Stock Prediction Algorithm and got the predicted value. Then, I wanted to plot the relation between Adjusted close price and predicted value, but got the ...
0
votes
1
answer
507
views
What does the term 'Facet' in Seaborn FacetGrid imply?
I am a newbie to data science. I have a very basic understanding of Seaborn. My understanding is that it is used to plot grids. That said, I intend to have a better understanding of 'FacetGrid' and ...
0
votes
1
answer
132
views
Smoothing or averaging plots to better represent trends and their variations
My picture looks like this. It shows some percent variation but, due to fluctuations, curves are not very smooth at all.
I would like to draw a smoother image, without altering too much the data (it ...
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 ...
1
vote
0
answers
388
views
logarithmic exponential function python
The code below (I found from googling) does the trick in terms of outcome. What I need to work out is the formula for this, so for any Y point we can get corresponding X.
This is part of a larger ...
0
votes
1
answer
14k
views
Sns Heatmap save as png jpeg image with full labels visible via python
I am trying to save my heat map in png format using the below code, but the labels are getting trimmed when I am saving the heatmap. Please help to keep the labels inside the figure.
...
2
votes
0
answers
3k
views
Different scales for 2D plots grouped in 3D perspective in python
I'm trying to realize a plot similar to the one in the following figure:
I started from the code contained in the answer here:
https://stackoverflow.com/questions/34099518/plotting-a-series-of-2d-...
3
votes
1
answer
845
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 ...
0
votes
1
answer
5k
views
Plot dataframe with two columns on the x axis
how would I plot the data below with the x axis as Year & Month? Each Year-month combination has a unique monthly count (Y). I am unsure how to proceed, given than they are in different columns, ...
-1
votes
1
answer
288
views
Meaning of 'hue" in seaborn [closed]
I know what "hue" does a little
I'm studying kaggle and the image is about bike sharing demand analysis
What I want to know is
shouldn't the second images's sum of each point's y axis be the first ...
0
votes
1
answer
4k
views
plotting histogram together with variance
I have a small piece of code that print values gotten from a csv file into a histogram. This is all done using matplotlib library
...
2
votes
1
answer
9k
views
matplotlib graph to plot values and variance
I am really new to the world of matplotlib graphing as well as using those graphs to understand data.
I have written a simple python code where I read a .csv file ...
3
votes
1
answer
541
views
Error while plotting Logistic Regression Classification
I was trying to plot by using the following code
...
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 ...
2
votes
2
answers
272
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 ...
1
vote
1
answer
1k
views
Making sense of a accuracy plot for a 5 fold training using random forest
I'm using sklearn.model_selection.learning_curve for 5 fold training of data. The code is as given below.
...
1
vote
0
answers
213
views
Data Visualization of Feature Distribution Plot
I have been trying my best to plot this type of feature distribution plot using Python. I looked for what they are called to replicate the plot, but couldn't find the name of it?
The Reference of the ...
0
votes
1
answer
10k
views
Change number format of confusion matrix
I have the following confusion matrix:
I would like to change the format of the numbers that, when they exceed the value 99, appear in scientific format.
I would like them to appear in a standard ...
1
vote
1
answer
4k
views
How to plot time series data from SQLite database
I am trying to plot time series data by accessing the SQLite database. I successfully connect the database by coding the below script,however, i couldn't figure out how to plot the time series data ...
2
votes
1
answer
5k
views
Python: Plotting equation with the Dirac Delta function [closed]
I am attempting to plot the expected diffraction pattern from a sharp razor which has a formula of:
$$ I(p) = \frac 14 \delta^2(p) + \frac {1}{4\pi^2p^2}$$
where $p = \frac {\sin\theta}{\lambda}$
I ...
-3
votes
1
answer
97
views
Python : How to output graphs using lists method and how to change graph lines to "-" or "*" [closed]
Question
Please show me Python programming codes that shows graphs using the list method.
Moreover, I want to know how to change graph lines to "-" or "*".
Thank you for your answer in advance.
<...
4
votes
2
answers
3k
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 ...
2
votes
0
answers
41
views
How do I plot between 2 variables in a summation equation?
I am new to Python and using Jupyter notebook.
Following is the summation equation that I have: $$y(t) = \sum_{i=1}^{t-1} a_{i}y(t-i)$$
How can I plot between variables y and t by formulating this ...
1
vote
1
answer
311
views
how to create multiple plot from a panda Dataframe
I want to plot multiple plots.
The data is stored in a pandas dataframe and each row should be a seperate plot.
Each row has an ID (ZRD_ID) which doenst matter and a date (TAG) and 24 values to be ...
3
votes
1
answer
4k
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 ...
3
votes
0
answers
503
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 ...
0
votes
1
answer
485
views
Why is my Python Altair chart printing a blank line?
Wondering if anyone can help me understand why python altair chart is not printing...
I’m only seeing this when I run the code:
It literally isn’t outputting anything.
This is what my chart looks ...
2
votes
2
answers
16k
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 ...
3
votes
1
answer
702
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.
...
0
votes
1
answer
980
views
How to rotate the plot and find minimum point?
I want to rotate the below curve to 45 degree and then find the minimum point.
For this, I have tried with below code:
...
0
votes
1
answer
559
views
Changes in the standard Heatmap plot - symmetric bar colors, show only diagonal values, and column names at x,y axis ticks
I have a heatmap image (correlation between all matrix columns) and I'm straggling to preform all the changes below within the same image:
bar colors should be symmetric around zero (e.g., correlation ...
4
votes
1
answer
20k
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.
...
9
votes
3
answers
12k
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 ...
-2
votes
1
answer
230
views
Export frequency and group to excel sheet in column after plotting by matplotlib
I got the nice plot but I want to export the data of x and y in column to excel sheet
...
1
vote
1
answer
3k
views
How can I adjust the legend when visualizing clusters in two dimensions?
How can I change the legend as we can see now the legend has some cluster numbers missing. How can I adjust the legend so that it can show all the cluster numbers (such as Cluster 1, Cluster 2 etc, no ...
3
votes
2
answers
2k
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?
...
2
votes
0
answers
418
views
Why are the regions/decision boundaries overlapping with multi-class classification using SVM in sci-kit?
I am using the SVM in scikit-learn library for doing multiclass classification. I am wondering why these regions (decision boundaries) are overlapping (as seen in the picture below)?
Could someone ...
1
vote
1
answer
132
views
Exporting from matplotlib
I'm finding a quicker method to export plots
...