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

181 questions
Filter by
Sorted by
Tagged with
25 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 ...
9 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 ...
27 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, ...
29 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 ...
59 views

### CDF plot overlay histogram in python

I have a dataframe called df['ProgressStep'] I would like to get overlaid CDF plot in histogram. Have tried 2 methods, neither one meet my target perfectly. please help to fine tune the code, either ...
11 views

### I want to create this plot, which is called as Delay Doppler Maps. How to create them, are they heatmaps?

It is a plot for 3 2d arrays. I just wanted to know which type of plot are they, are they heatmaps?
22 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 ...
14 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 ...
22 views

### Rearrange step chart in tkinter

I'm developing this project in Python using the Tkinter, ElementTree, Numpy, Pandas and Matplotlib packages: ...
482 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. ...
49 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 ...
35 views

I would like to adjust the unadjusted charts in Pandas. Suppose I have a data frame of the price of a stock symbol that there is a price gap between two candlesticks due to a capital increase. Sites ...
13 views

### Python Matplotlib: Plot epochs value correctly

How can I change the x-as, starting from 1. As the epoch is starting from 1 and not from zero. I tried to solve it with ticks... ...
40 views

### Stacked Area / Stack Bar Plot with color map based on range of values (Python, Pandas)

I'm trying to create a plot like the one shown in the picture below - where for each x value (a trading period) the y values (Megawatt, MW, see table below) are stacked on top of each other in order ...
385 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 ...
22 views

### Different learning curves on each run

Sorry for the wrong terminology I might use, since I’m a noob. For my supervised learning project for the university I have a dataset (features and labels) which has to evaluated in several ways and ...
729 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 ...
44 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 ...
1k 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 ....
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 ...
116 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 ...
40 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 ...
43 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: ...
135 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 ...
7k 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 ...
3k 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. ...
45 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 ...
144 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 ...
32 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: ...
1k views

### Python: How to plot time interval from a Dataframe in Pandas

I have the a dataframe(df) which has the data of a Job being executed at different time intervals. It includes the following details about the execution of a job: ...
41 views

### Matplotlib error

I was trying this simple code and am unable to find the error I made in it. My code: ...
20 views

### Multiclass Classifier comparison decision regions

How can I get the very same effect of this tutorial in Scikit Documentation with more than 2 classes? Let's say we'll keep only the first dataset (the linear separable one) and substitute it with <...
396 views

### How to show two pictures in one cell in Jupyter Notebook? (matplotlib) (python) [closed]

As a beginner, can someone please help me with this? Is there any way to show both pictures in a single cell's output? My output could only display one picture. Thank you for your time and attention! ...
159 views

My code: ...
28 views

### whats wrong with the graph [closed]

I wanted to plot a bar graph which shows covid cases reported in different regions in different regions of USA. So here is my code: ...
84 views

### plotting time series data using matplotlib python

I am trying to visualize Time series data is as follows following is my code to plot the data plt.plot(data['date'], data['c_16_avg_a']) ...
29 views

### How to improve performance of Tensorflow's CNN example? [closed]

In the example in this link: https://www.tensorflow.org/tutorials/images/cnn, the performance is over 70%, how can I improve it? What parameters do I need to tweak? Thanks.
147 views

### How to plot multiple models val and traing acc/loss curve from csv files?

I trained multiple CNN models, after that, I saved models details (Like , training/Validation Acc/Loss ) by callbacks by using this codes : ...
12 views

### Getting different visualization results for jupiter and datacamp existing code shell. How to solve this? [closed]

The left one image is in jupiter notebook and the right one is from datacamp exercises. Can anyone please let me know why I am getting different results in Jupiter? Used hacker statistics to calculate ...
64 views

### Visualising feature selection results for multiple classifiers and feature subset sizes

I am using information gain feature selection technique to get different features subset sizes for my dataset, like so: ...
31 views

### Time Series data visualization

When I visualize data using matplotlib it displays very well, but when using Plotly, the data display very bad.
26 views

### How to specify a location for text in a graph plotted by Python?

I would like to plot a graph of actual and predicted values with Python after doing a regression. I used the following codes. However, the text "R^2=0.91" is placed on the right hand side ...
55 views

### How to plot segmented bar chart (stacked bar graph) with Python?

cat = {'A':1, 'B':2, 'C':3} dog = {'A':2, 'B':2, 'C':4} owl = {'A':3, 'B':3, 'C':3} Suppose I have 3 dictionary, each containing pairs of (subcategory, count). How ...
64 views

### Distribution of Regression Residuals: Is this a normal distribution?

I've created a histogram as well as a QQPlot from the residuals of my Regression Model: Mean: 0.35 Standard Deviation: 18.14 Judging from these plots, is it okay to say that my residuals are normally ...
24 views

### Information Visualization: which parameters should a data scientist plot to best explain the work behind a Neural Network?

I'm a beginner in the field and I wrote and trained my first Convolutional Neural Network from scratch. I would like to know what types of graphics and parameters a data scientist uses to plot to ...
393 views

### How plot GridSearch results?

I trained an SVM model with GridSearch ...
110 views

### Understanding and find the best eps value for DBSCAN

I'm trying to run the DBSCAN algorithm on this .csv. In the first part of my program I load it and plot the data inside it to check its distribution. This is the first part of the code: ...
12k views

### how to create multiple subplots( scatterplot) in for loop

I want to create scatterplot of target variable with all the other variables in dataframe. Just like we create pairplot but as pairplot with large number of variables will take lot of time and ...