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®.
216 questions
3
votes
0
answers
43
views
How can i plot large .nc files with xarray and matplotlib?
I have a 11GB .nc file with lon/lat positions, and particle trajectories on the ocean surface for a timespan of 40 days.
For small files (Approx 140MB) i use xarray, netCDF4, matplotlib and cartopy to ...
3
votes
0
answers
60
views
A stupid question about contour plots
I am trying to make a contour plot for a point distribution using mat plot lib, but I find that the outermost points in the distribution are not included inside the perimeter of the outermost contour ...
1
vote
1
answer
50
views
implementing the SIRD model in python
im doing a project for my class where im trying to implement the sird model with the vaccinated population. Ive written my code based on the equations i have but something seems off in my graph. the ...
1
vote
2
answers
62
views
Basis of plotting
I need some help in clearing out basics of plotting in various plotting packages. Specifically matplotlib, seaborn and plotly. Certain fundamental principles are always same across all packages. Can ...
1
vote
0
answers
24
views
Annotations in matplotlib barplot
I would like to annotate the bars for the plot based on this groupby in a static fashion. Given that the cluster groups all happen to have genders that roll up to the same value per cluster, static ...
1
vote
0
answers
42
views
How to predict price behavior according to model predictions for a week ahead?
I wrote the simplest linear regression model (I'm a noob, please don't scold me; this is my first model) to predict the price of solana, I would like to get some advice or tips on how to improve. The ...
0
votes
1
answer
61
views
How can I create this type of visualisation using Python?
I have csv file containing some hierarchical data and I’d like to create a visualisation like this:
Anybody know how I can do this, preferably using matplotlib?
1
vote
0
answers
25
views
Plotting related multiple plots sharing an axis but each disjoint from each other
I want to plot related multiple plots sharing an axis but each disjoint from each other, i.e., same x-axis feature and scale but each of the other features has their own separate y-axis region with it'...
1
vote
0
answers
320
views
Why do seaborn.histplot and pyplot.hist generate two different histograms on the same data?
I'm trying to visualize a customer data, two of the variables I'm looking at are verified_status and video_transcription_length.
...
0
votes
1
answer
549
views
Seaborn distplot and countplot displaying incorrect y-axis
I have a simple dataset created using NLTK's FreqDist function, and have successfully converted the distribution to a pandas dataframe. When visualizing that dataframe using seaborn, I get a weird ...
3
votes
1
answer
1k
views
Pandas Profiling Not Working
I have been working on EDA lately and i got to know about Pandas Profiling ,
but i am unable to import the module Pandas_Profiling , I could import the module on Google Collab but couldnt import the ...
0
votes
1
answer
164
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 ...
0
votes
1
answer
149
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 ...
0
votes
1
answer
990
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 ...
0
votes
1
answer
2k
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:
...
0
votes
1
answer
3k
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 ...
0
votes
1
answer
312
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
350
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 ...
0
votes
1
answer
327
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 ...
3
votes
3
answers
614
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.
1
vote
3
answers
109
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
196
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 ...
1
vote
1
answer
473
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
1k
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
351
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
445
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:
...
0
votes
0
answers
778
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
94
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 ...
0
votes
2
answers
3k
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
1k
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 :
...
1
vote
1
answer
1k
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
383
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 ...
0
votes
1
answer
1k
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 ...
1
vote
2
answers
4k
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
1
answer
322
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'...
1
vote
1
answer
2k
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
4k
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:
...
1
vote
0
answers
171
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-...
1
vote
2
answers
6k
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.
1
vote
1
answer
197
views
3
votes
1
answer
629
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 ...
2
votes
1
answer
4k
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 :
...
1
vote
0
answers
32
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
.
1
vote
1
answer
836
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
2k
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 ...
1
vote
1
answer
607
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
52
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, ...
1
vote
0
answers
79
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 ...
2
votes
1
answer
498
views
An explanation of a for loop in a DBSCAN algorithm demo
In the following code of the DBSCAN algorithm, what is happening to the data in the bottom for-loop and why?
...
0
votes
1
answer
37
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 ...