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
1 answer
60 views

Is this considered a good visualization of clustered data?

I have used sckit-learn to cluster data using K-means (3 clusters). I have an issue with considering the plot as "readable" since clusters are overlapping (even when encircling them) Any ...
SSSOF's user avatar
  • 17
0 votes
1 answer
39 views

Better understand the scatter plots

I'm trying to understand how to read a scatter plot based on the results of my confusion matrix. This is the CM: I saw an high correlation between column 5 and column 6, a low correlation with column ...
JimBelushi2's user avatar
0 votes
1 answer
260 views

How do I prevent ConfusionMatrixDisplay.from_predictions from showing the plot?

ConfusionMatrixDisplay docs say: It is recommend to use from_estimator or from_predictions ...
Dmitry Minkovsky's user avatar
0 votes
0 answers
44 views

Combining Latitude Longitude Data to make Polar Stereographic Plot

I have two 896 row x 608 column pandas dataframes representing latitude and longitude positions of a polar stereographic grid. Combining these seems easy enough to make a single table, but I'm not ...
Socorro's user avatar
  • 91
0 votes
1 answer
436 views

How do I get pcolormesh to plot two distinct colormeshes on the same figure?

I am trying to plot 2 distinct colormeshes on the same figure. They are mutually exclusive, so there are no overlaps. This is my code: ...
megamence's user avatar
  • 109
0 votes
0 answers
26 views

YoloV5 results rendered lead to different picture

I basically trained a custom model to detect peg-solitaire games. In my example I use the results of the detection to render a board with matplotlib ...
grumpyp's user avatar
  • 157
0 votes
0 answers
24 views

Vector plots with quiver matplotlib

Is there a way I can convert this gif (U component wind) into vector plot with quiver (Vector plot with quiver) for u component of wind. The gif consists of 24 images combined for 24 hours. What I ...
pwnkit's user avatar
  • 37
0 votes
2 answers
1k views

pl.datetime plots as days since epoch or 1970, if formatted - polars and matplotlib

I'm attempting to port some old reports from Pandas to Polars. I am happy with the data, and am now attempting to plot a few time series. This is working, but I'm finding that matplotlib just doesn't ...
draeath's user avatar
  • 123
0 votes
1 answer
83 views

Ugly AUC curves. Sklearn. How to make AUC Curves less square

I dislike the square look of this AUC curve (SKLearn). The purpose of this question is "visual". Please post code snippets. This question is not requesting the theory behind the AUC. My goal ...
Full Array's user avatar
1 vote
2 answers
66 views

How can I best plot a dataset to visualize the tradeoff between two or more metrics combined?

Basically I have a datasets in which different metrics are present, imagine inference speed and model accuracy. Some models are fast but have lower accuracy, while some others are some what the ...
Hossein's user avatar
  • 545
0 votes
0 answers
171 views

show data values of scatter plot in Pycharm

How can I make Pycharm to show plotted data point values? I want to show data point values that are plotted using pyplot library. I created a code below that creates annotation objects and implements ...
Matt's user avatar
  • 1
0 votes
0 answers
205 views

How to make the model fitting to the inverse-square law in Python?

I am studying basics of physics. I would like to learn to make a graphical solution to the following problem: In a class room a lighting meter was used to measure the illuminance E at the distance r. ...
self-studying's user avatar
0 votes
1 answer
51 views

problem on converting data to numpy array

I have pandas data frame data=df.loc[[0]] print(data) 0 3.5257,3.5257,3.5257000000000005,3.5257,3.5257... Name: testdata, dtype: object I need to convert it to ...
simond's user avatar
  • 73
0 votes
0 answers
38 views

how to visualise a distribution over time?

Background I'm analysing data where data recency and an attribute of the data, in this case person's age, could serve to identify a simply defined cohort that can be considered defunct. I'd like to ...
John Cattanach's user avatar
3 votes
3 answers
576 views

Could you explain if this plot is good or bad. It is a sentiment analysis modelusing LSTM layers

Could you explain if this plot is good or bad. It is a sentiment analysis modelusing LSTM layers.20% of the data used for validation, and the remaining 80% for training.
SDhakZZZ's user avatar
0 votes
2 answers
38 views

What ML Algo should I use to plot & predict customer location vs. amount spent?

Im using real customer csv files from my ecommerce store. I was initially going to use k cluster with 2 values. I want the two values to be Province Code, and amount spend on my store. This will ...
ChickenJoe's user avatar
0 votes
1 answer
83 views

unable to bar plot the data for all the columns

I am trying to plot the data in a loop, I am using the below code to build the plot. but Its running for all the loop, I can see the column name is getting printed for all th but its building the plot ...
prakashrajansakthivel's user avatar
0 votes
1 answer
248 views

AttributeError: module 'graphing' has no attribute 'histogram'

I want to make a histogram plot, after importing the library called graphing it gives me an error even when it has been installed. ...
Lisa Chukwu's user avatar
0 votes
1 answer
551 views

Linear Regression line not showing in plot

It's a silly problem, I know, but it's getting my nerves. Everything seems fine, but I cannot get the line to show on the plot. I've put it in a public Google notebook, for your convenience. t ...
Ignacio Guerrero's user avatar
0 votes
2 answers
96 views

Understanding the relationship between two features

I am trying to solve classification task. Could you suggest me, if these two features are independent? the plot looks strange
Любовь Пономарева's user avatar
1 vote
1 answer
201 views

Annotate Statistical Significance on a Python Matplotlib graph

I'm tyring to compare a normal distribution to a histogram of actual data. I'm plotting the two with the following Python code: ...
DVCITIS's user avatar
  • 131
0 votes
0 answers
393 views

Creating a scatter plot with matplotlib with large dataset

I am trying to create a scatter plot from instrument peak area data recorded every tenth of a second or so. For some reason, when I try to plot it with Matplotlib, I get a straight line, which is not ...
Peter Bright's user avatar
0 votes
0 answers
44 views

Can python's matplotlib render images as quickly as R's Cairo device?

I need to render 100k of plots. I already am doing this quickly enough with R's Cairo device. But I am also considering using python. But, I also already know python's rendering of plots is several ...
ivan866's user avatar
  • 200
0 votes
2 answers
2k views

How to plot categorical variables with a pie chart

I am concerned with a single column (fruit) from my df: ...
Tom Bomer's user avatar
-1 votes
2 answers
747 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 : ...
minattosama's user avatar
0 votes
1 answer
600 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 ...
Barry O'Keeffe's user avatar
0 votes
1 answer
220 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
1 answer
903 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 ...
Legna's user avatar
  • 21
0 votes
1 answer
1k 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 ...
Luís Otávio's user avatar
0 votes
1 answer
183 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'...
Digvijay Rawat's user avatar
0 votes
1 answer
1k 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 ...
Davgrabner's user avatar
2 votes
1 answer
2k 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: ...
Sadcow's user avatar
  • 146
1 vote
0 answers
115 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-...
Tarun Maganti's user avatar
1 vote
1 answer
3k 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.
Tariq Hussain's user avatar
0 votes
1 answer
106 views

How to resolve this error while making bar graph?

...
nithin krishna's user avatar
0 votes
1 answer
269 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 ...
HK44's user avatar
  • 1
2 votes
1 answer
2k 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 : ...
AAA's user avatar
  • 145
1 vote
0 answers
24 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 .
Alireza's user avatar
  • 11
1 vote
1 answer
497 views

how to convert pandas plot to OO Matplotlib bar chart

I am trying to convert pandas dataframe bar plot to matplotlib OO concept. ...
Dharmeshsharma's user avatar
0 votes
1 answer
1k 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 ...
megasaw's user avatar
  • 13
1 vote
1 answer
422 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 ...
lostwanderer's user avatar
1 vote
1 answer
35 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, ...
Will's user avatar
  • 11
0 votes
0 answers
46 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 ...
ShridharK's user avatar
  • 101
0 votes
1 answer
367 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 ...
soufi-43's user avatar
0 votes
1 answer
30 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 ...
joseph's user avatar
  • 107
0 votes
1 answer
42 views

Rearrange step chart in tkinter

I'm developing this project in Python using the Tkinter, ElementTree, Numpy, Pandas and Matplotlib packages: ...
PureEncoding's user avatar
0 votes
1 answer
5k 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. ...
Brindha Ganesan's user avatar
1 vote
1 answer
277 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 ...
ml_learner15's user avatar
0 votes
1 answer
2k 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 ...
J. Dionisio's user avatar
0 votes
1 answer
7k 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 ...
Charith Jayasanka's user avatar

1
2 3 4 5