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
-2
votes
0answers
15 views

Dimentions not aligned when trying to plot [closed]

Hi guys I would be very happy if you can help me with this issue. Thank you! ...
0
votes
1answer
10 views

Time series plot using netcdf data in python

I am trying to plot a time series for a 3d plot. I know that the variable must be made 1d inorder to make it viable for the time series plot. Actually I want the data within a box of latitude and ...
0
votes
1answer
25 views

How to create these two plots from two arrays with numbers?

I have two numpy arrays, one with the data for x axis and another one with the data for the y axis. The position i in each array matches the other array. Some values in the x axis array are repeated. ...
0
votes
0answers
8 views

How can I plot a bunch of images, given their centre coordinates?

The points here represents centre coordinates of images with unique names. I want to plot all the images on the same 2d space to get a final representation of all the images merged into sort of a ...
0
votes
1answer
22 views

How to add a filter/query/condition in Plotly [closed]

I want to add a condition to the column where attractionName.value_counts() >=165. How can I add a query/filter/condition to a DataFrame before I plot the data. <...
0
votes
1answer
40 views

Data visualization on three factors

I have three factors, Income(from source A),continuous variable Income(from source B), continuous variable Happiness index,continuous variable Suppose I have 500 samples. My goal is to show the ...
0
votes
1answer
19 views

Time Series Plot for floating values

I have a Dataframe which looks as shown below I am trying to make a line plot for looking at the peaks for both columns (a,b), I have gotten as far as ...
0
votes
1answer
24 views

Differences between pseudocolor plot and heatmap?

I found some materials using the word `pseudocolor plot' and I think that it's just a heatmap. Is there any difference between them?
2
votes
1answer
31 views

What is the most straightforward way to visualize color-coded clusters along with the cluster centers?

I have applied the kMeans Clustering algorithm to a dataframe and have gained cluster labels for each row. I had selected only two features. There are 4 clusters. I want to visualize the datapoints in ...
1
vote
1answer
21 views

3d plot for clustering

I'm working on a cluster analysis project and was trying out different ways to plot clusters to explain the differences between the clusters. I did plot the different clusters in 2D. Can you please ...
1
vote
1answer
25 views

Decision boundary for KMeans clustering algorithm

Below code is used for plotting decision boundary for KMeans clustering. I understand contour in general, my question is, how does plot (contour method) know where to draw decision boundary based on ...
2
votes
1answer
22 views

How to visualize categorical data with numeric columns

I have data like as shown below I would like to represent the above tabular data in a visual form. However, the below graph may not work because my real data as 50K unique drug names. So, is there ...
0
votes
1answer
36 views

How to infer from logarithmic scale scatter plot and line plot in Seaborn

I have generated the following 4 plots, plot 1 and plot 2 are on linear scale and plot 3 and plot 4 are on logarithmic scale. Can someone tell me what inferences can I draw from the plots? NOTE: All ...
0
votes
0answers
26 views

how can i plot probability distribution of my classes in the way below?

All, I would like to plot the following: I have a binary classification problem where I am using xgboost as my 'model' below: ...
1
vote
1answer
21 views

Plot three series on the same plot grouping data by day and month

I've a three years data set which I want to plot so to compare the data by data and month, but I'm having an hard time with the final result. I'm nearly there, I guess, but for some strange reason, ...
0
votes
0answers
19 views

How may I may fit the cluster number while it is going to the outside of the X-axis and when visualizing clusters in two dimensions?

I am writing code for DBSCAN clustering. I find the eps value which is 0.12 with the help of ...
0
votes
0answers
19 views

Bar-chart naming issue in Python code

I have a problem with labelling this bar graph. The 'blue' bar that indicates ML has 5 ml models and I'm trying to rename each of the 5 blue bars given into 5 ml model names obtained from the 'index' ...
0
votes
0answers
15 views

Visualize multiple causes

Goal: Visualize why loans are rejected which can be due to multiple reasons. A loan is either rejected or accepted. Any rejection is caused by one or more rejection reasons. There is a list of ...
4
votes
2answers
41 views

Seaborn Scatter plot

I have a dataset containing of only one column, using matplotlib I was able to do the scatter plot the following way ...
0
votes
0answers
16 views

how to make contour plot centered using netcdf data

hello everyone, I am trying to produce a contour plot using contourf function in python for showing interannual monthly climatology. I do have got my plot but my concern is when I am ...
0
votes
1answer
21 views

how to limit datetime in x axis

Hello folks, I am trying to plot three variables in a single XY plot. I am having a problem setting the x-axis limit which is for time. I tried setting limits using x_limit but getting ...
1
vote
1answer
142 views

Plot Decision boundary in 3D plot [duplicate]

I am running logistic regression on iris dataset. I computed thetas and this is how I draw a decision boundary line. ...
1
vote
1answer
70 views

Plot hurricane track

Hello folks, Recently while going through a research paper I happened to come across a plot showing the hurricane track(figure attached). Can anyone say how it is plotted or anyone has ...
3
votes
1answer
21 views

F1 score graph skewed

The following code ...
0
votes
1answer
30 views

Plotting clustered sentences in Python

I have the following three sentences, extracted from a dataframe. I would like to check the similarity and create clusters based on their level of similarity. ...
0
votes
1answer
19 views

Bar plot with varying length

Hello folks, I am trying to plot a grouped bar plot of two variables with varying lengths, which means the x and y length of both the variables are different. The format of the data is ...
0
votes
1answer
32 views

Vertical lines of overlapping points in Seaborn Swarmplot

When I plot my data to see its distribution via Swarmplot, these two vertical lines that seems to even overlap occur in the figure. It seems to occur even around values that are not that dense, such ...
0
votes
0answers
16 views

Color overlapping in matplotlib, using PCA

I'm plotting 2d data from PCA, and I tried 2 libraries, matplotlib and seaborn, with seaborn I'm having nice overlapping colors, but in matplotlib it's just random, how would I achieve the color ...
0
votes
0answers
8 views

How to make a radar with labels around

I am learning python and I need to make a radar that has the labels around the graph, such is the image, can someone help me please? Thank you.
-1
votes
1answer
248 views

Matplotlib Bar graph -ValueError: shape mismatch:(x,y)

While plotting the bar graph for number of attempt on x-aixs and time-taken on y-axis as per below code, getting Value error.Trace of error is included below. ...
0
votes
1answer
34 views

Changing the default scale of a plot to a “custom scale”

I am trying to change the scale of the x_axis for a plot. The default is generating divisions of 20 units (0-20-40-60-80-100-120). I tried changing to log, but then I get 0-10-100, which helps ...
0
votes
0answers
47 views

Why seaborn is showing different time-series plot than matplotlib on the same data?

I have a time-series variable. Below is given some statistical information about the variable. ...
0
votes
1answer
21 views

Having and issue plotting horizontal chart

So for some weird reason I can't manage to fix the plotting issue Any suggestions? ...
0
votes
0answers
18 views

Plotting List of percentages [duplicate]

I'm having a hard time plotting a List of percentages. Basically, I want to plot it as Horizontal bars with names on the left side and each one with different colors. Is there any chance to get help?...
0
votes
0answers
63 views

Finding multiple histogram graphs with Seaborn

When graphing with matplotlib I get this 4 histograms model: 4 Histograms Using Seaborn I am getting the exact graph I need but I cannot replicate it to get 4 at a time: I want to get 4 of the ...
0
votes
0answers
60 views

Images matching using bf.match and drawing using cv2.drawMatches Python

I have successfully matched 2 images using bf.Match and drawn matches as well. Now, I am trying to match multiple images from 2 different directories. For this, I am using 2 different array to store ...
0
votes
1answer
262 views

Size Issue when Plotting the Predicted Vaue

I wrote a simple Stock Prediction Algorithm and got the predicted value. Then, I wanted to plot the relation between Adjusted close price and predicted value, but got the ...
0
votes
1answer
80 views

What does the term 'Facet' in Seaborn FacetGrid imply?

I am a newbie to data science. I have a very basic understanding of Seaborn. My understanding is that it is used to plot grids. That said, I intend to have a better understanding of 'FacetGrid' and ...
0
votes
1answer
15 views

Smoothing or averaging plots to better represent trends and their variations

My picture looks like this. It shows some percent variation but, due to fluctuations, curves are not very smooth at all. I would like to draw a smoother image, without altering too much the data (it ...
11
votes
3answers
2k views

What do Python's pandas/matplotlib/seaborn bring to the table that Tableau does not?

I spent the past year learning Python. As a person who thought coding was impossible to learn for those outside of the CS/IT sphere, I was obviously gobsmacked by the power of a few lines of Python ...
0
votes
0answers
23 views

logarithmic exponential function python

The code below (I found from googling) does the trick in terms of outcome. What I need to work out is the formula for this, so for any Y point we can get corresponding X. This is part of a larger ...
0
votes
0answers
205 views

Sns Heatmap save as png jpeg image with full labels visible via python

I am trying to save my heat map in png format using the below code, but the labels are getting trimmed when I am saving the heatmap. Please help to keep the labels inside the figure. ...
0
votes
0answers
6 views

How to parallel plot the following table showing improvement of classifier for every subject

parallel_coordinates(data,'Subject', colormap='Dark2', linewidth=5, alpha=.8) plt.ylabel('Direction of Preference $\\rightarrow$', fontsize=12) This is giving me ...
1
vote
0answers
162 views

Different scales for 2D plots grouped in 3D perspective in python

I'm trying to realize a plot similar to the one in the following figure: I started from the code contained in the answer here: https://stackoverflow.com/questions/34099518/plotting-a-series-of-2d-...
0
votes
0answers
32 views

How does scatter plot with multiple features work?

Plotting one independent(100 rows) and one dependent(100 rows) feature is straightforward. But how plotting multiple independent(100 rows, 10 columns) with one dependent(100 rows, 1 column) feature ...
3
votes
0answers
121 views

Plotting Gradient Descent in 3d - Contour Plots

I have generated 3 parameters along with the cost function. I have the $\theta$ lists and the cost list of 100 values from the 100 iterations. I would like to plot the last 2 parameters against cost ...
0
votes
1answer
571 views

Plot dataframe with two columns on the x axis

how would I plot the data below with the x axis as Year & Month? Each Year-month combination has a unique monthly count (Y). I am unsure how to proceed, given than they are in different columns, ...
-1
votes
1answer
55 views

Meaning of 'hue" in seaborn [closed]

I know what "hue" does a little I'm studying kaggle and the image is about bike sharing demand analysis What I want to know is shouldn't the second images's sum of each point's y axis be the first ...
0
votes
1answer
316 views

plotting histogram together with variance

I have a small piece of code that print values gotten from a csv file into a histogram. This is all done using matplotlib library ...
0
votes
0answers
5 views

Having a single y-axis values while plotting two variables on secondary axis

I am trying to plot three variables, in a graph using primary and secondary axis with one variable on primary axis and two on secondary axis. My code ...