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
5 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 ...
  • 27
0 votes
1 answer
82 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 ...
  • 123
0 votes
1 answer
31 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 ...
1 vote
2 answers
36 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 ...
  • 495
0 votes
0 answers
20 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 ...
  • 1
0 votes
0 answers
39 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. ...
0 votes
1 answer
18 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 ...
  • 73
0 votes
0 answers
21 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 ...
3 votes
3 answers
542 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.
0 votes
2 answers
28 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 ...
0 votes
1 answer
18 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 ...
0 votes
1 answer
54 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. ...
0 votes
1 answer
191 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 ...
0 votes
2 answers
71 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
1 vote
1 answer
115 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: ...
  • 131
0 votes
0 answers
180 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 ...
0 votes
0 answers
18 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 ...
  • 200
0 votes
0 answers
20 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
96 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
2 answers
672 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
215 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
205 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
97 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
101 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
528 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
166 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
1 answer
150 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
151 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
105 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
152 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
857 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
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: ...
  • 146
1 vote
0 answers
92 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
8 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
2k 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
38 views

How to resolve this error while making bar graph?

...
0 votes
1 answer
137 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
2 votes
1 answer
893 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 : ...
  • 35
1 vote
0 answers
21 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
1 vote
1 answer
414 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
801 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
259 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 ...
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
40 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
270 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
28 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
38 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
4k 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
188 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
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 ...

1
2 3 4 5