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

setting width range for peak detection

How to set width range from 750 to 1250 for example that peaks only appear in this area ? My code: ...
0 votes
0 answers
10 views

Contour graph shows negative values (strange) for the height

When hovering over the contour graph, I got a negative value for the height. However the height is actually the cost function so it will always be positive. Here's the screenshot: Clearly I can see ...
0 votes
1 answer
43 views

How to plot categorical variables with a pie chart

I am concerned with a single column (fruit) from my df: ...
-1 votes
2 answers
23 views

Why I am having trouble plotting the AUC?

I am trying to plot the roc_auc curve however I am not getting any results. Any explanation here? Are there any problems with the number of data? Here is my example : ...
0 votes
1 answer
25 views

Network Visualisation (Python/Excel)

I have a large data set similar to that in the screenshot below: and I want to visualise the whole data set like the diagram below (made with a lot of effort in PowerPoint!) Is there any way to do ...
0 votes
1 answer
30 views

Matplotlib Surface Plot over L domain

I want to create surface plots over certain special domains, e.g., the L-shaped domain below. Currently, I am creating surface plots with matplotlib.pyplot in the typical way, i.e., creating a ...
user avatar
0 votes
0 answers
32 views

Finding steady state regions in a varying graph

Basically, I have to make the code find the sections of the graph where the data values reach a steady state. Once it finds out the steady-state region, I have to find the average of the values of ...
0 votes
1 answer
151 views

Plot distribution of multi classification with features - Python

I have a multi-class classification problem, and continuous features, I want to visualize using python libraries (matplotlib, seaborn, plotly..) the target variable ( 4 classes ) with each given ...
  • 21
0 votes
0 answers
43 views

Why do i need to write regressor.predict(x_train)?

Im currently learning data science and i was unable to understand a particular part in linear regression model. The following is my code - ...
  • 1
0 votes
0 answers
12 views

Why is matplotlib not plotting some boxplots?

I am trying to plot some data so get statistics about it, but matplotlib simply can't plot it as boxplots. I tried with histograms and it workd well: But when i change the code to plot boxplots it ...
0 votes
0 answers
87 views

How can I overlay a contour map over a picture of a country?

So for context, I have a massive dataset of over 2.7 million rows of average download/upload speeds of individuals in Canada, with province/city columns. I would like to plot a contour map of average ...
0 votes
1 answer
43 views

Converting RGB values to contour values

I am using matplotlib to generate a filled contour plot, please consider the below example as a sample contour plot. I want to read off the contour values from such a filled contour plot using opencv'...
0 votes
0 answers
63 views

how do i add a dropdown menu display GOES image on a tkinter popup window

im trying to add a dropdown menu on my tkinter popup window but when ever i run it on my visual studio code ide nothing displays but when i run the code by it self on jupyter everything work fine so ...
0 votes
1 answer
331 views

Plot multiple time series from single dataframe

I have a dataframe with multiple time series and columns with labels. My goal is to plot all time series in a single plot, where the labels should be used in the legend of the plot. The important ...
2 votes
1 answer
734 views

Plotting the confidence interval for a plot in python

I have a curve and I want to create the confidence interval for the curve. Here, I provide a simple example: ...
  • 146
1 vote
0 answers
61 views

Plot polar coordinates (2D) on a Poincáre Sphere surface as either heat map or scatter plot [closed]

I have a dataset with 4 values - amplitude, psi angle, chi angle and class (color). The psi angle and chi angle represent unique points on a . I want plot these psi and chi values on this sphere co-...
0 votes
0 answers
7 views

How to display the graph from the code

I am trying to plot the graph of validation loss against no of epochs. I have managed to train my data with the no of epochs. However, I have difficulty deciding which variables to use to display the ...
0 votes
1 answer
569 views

How can I remove legend from the figure in seaborn?

Here is my diagrams, I want to remove the labels of the second bar that is C1,C2,C3,C4,C5, because it is repeating.
0 votes
1 answer
18 views

How to resolve this error while making bar graph?

...
0 votes
1 answer
39 views

Plotting two pd dataframes with n columns, each df representing an axis coordinate?

I have two dataframes which each have n columns (changes depending input), where each dataframe represents an axis coordinate. Each column represents separate lines I want to plot. Example dfs (1st ...
  • 1
0 votes
0 answers
55 views

Facing problem on X-axis and Y-axis in VS Code

Helow everyone. I am facing a problem on x axis and y axis. when i got the output then the output plot look like as,, The problem is output plot do not show the x-axis label and y axis label. Please ...
  • 1
0 votes
0 answers
95 views

How to plot rate distributions from a binary target

I'm trying to do EDA on a dataset and I have found some visualizations someone else was able to produce but I can't seem to figure out how they did it. The dataset looks roughly like this: default ...
2 votes
1 answer
228 views

Plotting confusion matrix for multi classification problem

I am using google colab to solve a multi-classification problem. I am trying to plot the confusion matrix for this problem, I have tried doing so using : ...
  • 23
1 vote
0 answers
20 views

clustering algorithms' evaluation [closed]

How can I show clustering performance of various clustering algorithms on various datasets using adjusted mutual information and adjusted rand index. for instance, the plot below .
  • 11
0 votes
0 answers
29 views

Which plot should I use for plotting discrete variable with binary variable?

I am two columns Age(discrete), and Purchase(binary). I want to visualize it to understand which age group is most interested in purchasing things. I was thinking of plotting something like a line ...
1 vote
1 answer
312 views

how to convert pandas plot to OO Matplotlib bar chart

I am trying to convert pandas dataframe bar plot to matplotlib OO concept. ...
0 votes
1 answer
390 views

How to save the history epochs and plots in files from keras models

I have a question, that maybe is very simple, but I can't do it: I have 3 neural networks which are trained with 100 epochs, and I need to save all the history's train displayed at the end in a .txt ...
  • 13
1 vote
1 answer
169 views

Elegant way to plot the L2 regularization path of logistic regression in python?

Trying to plot the L2 regularization path of logistic regression with the following code (an example of regularization path can be found in page 65 of the ML textbook Elements of Statistical Learning ...
0 votes
0 answers
52 views

How to draw Reward vs Episode Graph

I have just started learning reinforcement learning and I was following some tutorials on youtube. I found out out that no one was explaining how to draw reward vs episode graph. So I concluded that ...
  • 1
1 vote
1 answer
31 views

How can I improve this chart?

I have a chart like this: There are some problems that I am stuck: Some columns value are very small compared to others, so I cannot identify whether they are zeros or not (I used logarithm scale, ...
  • 11
0 votes
0 answers
36 views

Trying to understand a PCA output

I recently ran a code to generate PCA for a movie ratings dataset. Actually there were two different datasets, a 'movies' and a 'ratings' one. The movie had about 9700 rows of different movie titles ...
  • 101
0 votes
1 answer
151 views

need an explanation of the For Loop in the DBSCAN algorithm Demo

In the following code of the DBSCAN algorithm, as a beginner I need an explanation for what happens to the data in the bottom for loop and why ? Generate sample data ...
0 votes
1 answer
25 views

configuring axis in matplotlib

x = np.random.rand(200) and y = 12 * x - 4 + np.random.randn(200) After ploting the (x,y) values I get the following graph in matplotlib: How can I configure the axis so all samples are clearly ...
  • 107
0 votes
1 answer
33 views

Rearrange step chart in tkinter

I'm developing this project in Python using the Tkinter, ElementTree, Numpy, Pandas and Matplotlib packages: ...
0 votes
1 answer
2k views

Bar plot not showing up in Jupyter Notebook

I am trying to create a bar plot for a Pandas Series and the bar plot is not showing up in Jupyter notebook. When I run the cell, I only get the following and I do not see the bar plot. ...
1 vote
1 answer
130 views

Types Of Plots for Discrete Data

So I have a lot of discrete variables in my dataset and want to visualize them (univariate for now). I went through various articles over the internet and it is suggested that histograms and count ...
0 votes
1 answer
1k views

What's the issue with my code for visualizing linear regression in 3 dimensions with matplotlib? [closed]

I am trying to use linear regression that takes two variables "Idade" and "LF" and tries to predict a third one, "DGAF". I'm trying to both do the scatterplot with the ...
0 votes
1 answer
4k views

Plot a training/validation curve in Pytorch Training [closed]

I have the following training method and I'm confused how may I modify the code to plot a training and validation curve history graph with matplotlib ...
1 vote
1 answer
66 views

How to plot multiple bar charts with different infill and outline?

I have the CSV's of data. I want to plot the distribution of every attribute or a single one to compare the distribution from other CSV's, Since all attributes are the same but the distribution is ...
  • 219
0 votes
1 answer
4k views

How to plot the bar charts of precision, recall, and f-measure?

I have used 4 machine learning models on a task and now I am struggling to plot their bar charts just like shown below in the image. I am printing classification report to get precision, recall etc. ...
  • 219
1 vote
0 answers
28 views

Distplot 'a' parameter, does not make logical sense to me, can anyone explain?

Most sns plot parameters have names that make somewhat logical sense, For example scatterplot has the x attribute to choose what to plot on the x-axis, and y for y-axis. Similarly kdeplot uses the ...
1 vote
2 answers
175 views

Autenocoder and anomaly detection task

I'm trying to create an autoencoder for the anomaly detection task, but I'm noticing that even if it performs very well on the training set, it starts to stop recreating half of the test set. I tried ...
  • 53
0 votes
1 answer
83 views

Visualization with many lines, colors, and markers

I have a bunch of plots as the one reported below. The data is from measurements performed on different times and different days. In the plot (which is a cumulative distribution function, if that ...
  • 101
1 vote
1 answer
89 views

Create a single time series plot of multiple devices [closed]

I have a dataset where there are stored the measurements of 30 devices. Each device has about 4000 values and it is structured as well: ...
  • 53
0 votes
1 answer
517 views

Plot overlapping time series [closed]

I'm trying to plot my test set and test set predictions to check the differences and see how my autoencoder reconstructed the data, but since I have a test set 30x10 I have a huge visualization ...
  • 53
1 vote
1 answer
20k views

TypeError: Image data of dtype object cannot be converted to float [closed]

I am trying to convert files stored in a CSV file dataset to grayscale. I run the code which worked on my previous dataset but I now get this error: TypeError: Image data of dtype object cannot be ...
  • 125
0 votes
1 answer
15k views

How can I get rid of the white space in matplotlib?

I am doing a course in edx. While plotting in python, there is always a blank space before the beginning of the plot. In StackExchange, I have found a solution, which is mentioning the axis limit. ...
  • 1
0 votes
1 answer
131 views

How do i get the loss function graph?

I used Mini-batch gradient descent to train the model, but i am unable to get the proper loss graph. The loss graph is always showed as a straight line. I know there is something wrong but would ...
  • 1
0 votes
1 answer
488 views

What is "Missing" in output of plot_tree API of XGBoost

What this "Missing" term means here at each node after split in Image? and also what is at leaf, is this means prediction value? I converted Output variable to 1 and 0. I tried searching on ...
0 votes
1 answer
69 views

Unsynchronized time series visualization

I would like to visualize a large amount of events composed of time serie windows. A typical event would be: Problem is, my events are not synchronized, and so if I plot them all, it would look like: ...
  • 1,155