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
12 views

How do I draw a graph mapping one array to another using matplotlib?

How do I draw a graph mapping one array to another using python and matplotlib? I have two arrays of the same length, for instance: [0, 0.25, 0.5, 0.75, 1.0] [0.4, 0.5, 0.6, 0.7, 0.8] I want to draw ...
user avatar
-1 votes
0 answers
17 views

please help, i got an error while trying to my data, i got an error like x and y must be thesame size

...
user avatar
0 votes
0 answers
8 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 ...
user avatar
0 votes
1 answer
21 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'...
user avatar
0 votes
0 answers
11 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
1 vote
1 answer
27 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: ...
user avatar
  • 136
1 vote
0 answers
12 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-...
user avatar
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 ...
user avatar
0 votes
1 answer
24 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.
user avatar
0 votes
1 answer
15 views

How to resolve this error while making bar graph?

...
user avatar
0 votes
1 answer
18 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 ...
user avatar
  • 1
0 votes
0 answers
20 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 ...
user avatar
  • 1
0 votes
0 answers
21 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 ...
user avatar
1 vote
0 answers
54 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 : ...
user avatar
  • 13
1 vote
0 answers
15 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 .
user avatar
  • 11
0 votes
0 answers
17 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 ...
user avatar
1 vote
1 answer
202 views

how to convert pandas plot to OO Matplotlib bar chart

I am trying to convert pandas dataframe bar plot to matplotlib OO concept. ...
user avatar
0 votes
1 answer
61 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 ...
user avatar
  • 13
1 vote
1 answer
120 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 ...
user avatar
0 votes
0 answers
40 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 ...
user avatar
  • 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, ...
user avatar
  • 11
0 votes
0 answers
31 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 ...
user avatar
  • 101
0 votes
0 answers
204 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 ...
user avatar
  • 11
0 votes
0 answers
14 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?
user avatar
  • 101
0 votes
1 answer
67 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 ...
user avatar
0 votes
1 answer
18 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 ...
user avatar
  • 107
0 votes
1 answer
30 views

Rearrange step chart in tkinter

I'm developing this project in Python using the Tkinter, ElementTree, Numpy, Pandas and Matplotlib packages: ...
user avatar
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. ...
user avatar
1 vote
1 answer
99 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 ...
user avatar
0 votes
0 answers
35 views

How to adjust the unadjusted charts in Pandas

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 ...
user avatar
0 votes
0 answers
63 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... ...
user avatar
  • 1
0 votes
0 answers
79 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 ...
user avatar
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 ...
user avatar
0 votes
1 answer
3k 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 ...
user avatar
1 vote
1 answer
50 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 ...
user avatar
  • 219
0 votes
1 answer
3k 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. ...
user avatar
  • 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 ...
user avatar
1 vote
2 answers
161 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 ...
user avatar
  • 43
0 votes
1 answer
56 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 ...
user avatar
  • 101
1 vote
1 answer
56 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: ...
user avatar
  • 43
0 votes
1 answer
341 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 ...
user avatar
  • 43
1 vote
1 answer
16k 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 ...
user avatar
  • 125
0 votes
1 answer
9k 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. ...
user avatar
  • 1
0 votes
1 answer
83 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 ...
user avatar
  • 1
0 votes
1 answer
324 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 ...
user avatar
0 votes
1 answer
52 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: ...
user avatar
  • 1,125
0 votes
1 answer
2k 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: ...
user avatar
0 votes
1 answer
54 views

Matplotlib error

I was trying this simple code and am unable to find the error I made in it. My code: ...
user avatar
1 vote
0 answers
26 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 <...
user avatar