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

Filter by
Sorted by
Tagged with
10
votes
3answers
2k 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 ...
0
votes
0answers
14 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
0answers
8 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
0answers
24 views

i want to plot with python that i saw in picture [closed]

I tried this. and i want to do something like this picture with python , pandas , Matplotlib Not with R language :
1
vote
0answers
22 views

How to plot a bar and line on the same chart with separate axes? [migrated]

I'm trying to plot bars and a line on different y axes on the same chart using matplotlib. They don't appear on the same chart for some reason, the following code works in certain situations but it ...
0
votes
0answers
6 views

How to parallel plot the following table showing improvement of classifier for every subject

parallel_coordinates(data,'Subject', colormap='Dark2', linewidth=5, alpha=.8) plt.ylabel('Direction of Preference $\\rightarrow$', fontsize=12) This is giving me ...
1
vote
0answers
16 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-...
0
votes
0answers
18 views

How does scatter plot with multiple features work?

Plotting one independent(100 rows) and one dependent(100 rows) feature is straightforward. But how plotting multiple independent(100 rows, 10 columns) with one dependent(100 rows, 1 column) feature ...
2
votes
0answers
31 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
1answer
39 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
1answer
20 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
1answer
62 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 ...
0
votes
0answers
5 views

Having a single y-axis values while plotting two variables on secondary axis

I am trying to plot three variables, in a graph using primary and secondary axis with one variable on primary axis and two on secondary axis. My code ...
2
votes
1answer
178 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 ...
2
votes
1answer
41 views

Error while plotting Logistic Regression Classification

I was trying to plot by using the following code ...
1
vote
1answer
308 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
2answers
86 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
1answer
28 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
0answers
34 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 ...
0
votes
1answer
42 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 ...
0
votes
0answers
17 views

What types of variables are these? And what types of tests could I run?

So, I recently made a sheet of data collected from the 2010 Census on Cincinnati neighborhoods. The data is from demographics about the neighborhoods of the city such as median household income and ...
0
votes
0answers
16 views

Precision-Recall for CNN place recognition problem

Given 3450 query and 3450 reference images in a place recognition problem, I plot the ...
1
vote
1answer
226 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
0answers
648 views

Python: Plotting equation with the Dirac Delta function

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 ...
0
votes
0answers
43 views

regarding 3D scatterplot with line in Python or Matplotlib

In Matplotlib or other python library, how to generate the 3D scatter plot with line, shown as following? It seems that ...
0
votes
0answers
19 views

Plot line at X axis based on Values of Y axis - maplotlib/seaborn

I have made a dist plot and now I want to plot a line on the x-axis based on the value of the y-axis. ie. I want to plot a line at various maximas/peaks and also shade a portion of the x-axis between ...
0
votes
0answers
8 views

Retrieving range on axis based on the peak point in scatter plot

I have a scatter plot that shows data of products sold & sales for each store. As visible in the graph that there is spike in sales from 60-70. I need a way to extract this range. Since i need to ...
0
votes
0answers
57 views

IndexError: too many indices for array

Attempting to load a dataset and print out a prediction for each array, yet I keep getting an IndexError.... ...
0
votes
0answers
17 views

Calculating co-variance matrices and plotting the co-variance value

I have an excel file with 10 samples drawn from a two-dimensional normal distribution. There's 20 columns. Sample 1 would be column 1,2. Sample 2 = col 3,4 ect. I'm trying to plot 10 separate ...
-2
votes
1answer
33 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. <...
2
votes
2answers
154 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
0answers
15 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 ...
0
votes
1answer
31 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
1answer
126 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 ...
0
votes
0answers
19 views

Code line explanations: Visuals of LogRegression

Why do we use -1 and +1 in the following code? ...
2
votes
0answers
129 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
1answer
101 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 ...
1
vote
2answers
798 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 ...
1
vote
1answer
125 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. ...
-1
votes
1answer
58 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
1answer
147 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., ...
0
votes
1answer
2k 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. ...
6
votes
1answer
924 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 ...
-1
votes
1answer
46 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
1answer
334 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 ...
2
votes
2answers
126 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
0answers
93 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
1answer
55 views

Exporting from matplotlib

I'm finding a quicker method to export plots ...
0
votes
0answers
13 views
1
vote
0answers
266 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 ...