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
2
votes
2
answers
2k
views
How to best visualize data when outliers lead to lack of contrasting colors for the rest of the plot?
I have plotted the following map of Philippines according to the population in its regions, using matplotlib.pyplot in Python 3:
As can be seen, there's one ...
3
votes
2
answers
39k
views
ValueError: not enough values to unpack (expected 4, got 2)
I have written this code
fig, (axis1, axis2,axis3, axis4)=plt.subplots(2,2,figsize=(10,4))
and I am getting this error
...
1
vote
1
answer
7k
views
How to create a historical timeline using Pandas Dataframe and matplotlib
So I've seen a few answers on here that helped a bit, but my dataset is larger than the ones that have been answered previously. To give a sense of what I'm working with, here's a link to the full ...
2
votes
1
answer
554
views
n days back average for each day
I have a dataset as below and I want to see 3 days high low average, back from for each day in the same plot.
...
2
votes
1
answer
2k
views
How to plot a 3-axis bar chart with matplotlib (and pandas + jupyter)
I'm a bit confused about how to go about plotting a 3-axis bar chart:
So my jupyter notebook reads in an excel/sheet and I have a table:
...
1
vote
1
answer
324
views
Data Visualisation for Dataframe having 3 columns
I have the below data, I am looking for a effective visualization or graphical method (in Python) to understand how the err is distributed with respect to min and max.
...
7
votes
3
answers
307
views
How to plot clusters in nice a way?
I have a large text dataset clusterized. Each cluster is represented by a centroid of the vectorized texts that belong to it, the number of texts, the created date, and other parameters. I can't plot ...
1
vote
0
answers
229
views
Pandas df - FacetGrid - Need help with plotting [closed]
Let's say I have a df with the below columns
...
0
votes
1
answer
108
views
Improve performance of SVM
I have written some code for an SVM and the final output isn’t brilliant. The data is linearly separable so I don’t understand why the data isn’t perfectly separated. Here is the code:
...
1
vote
1
answer
428
views
What plt.subplots() doing here?
Below is the code I am trying to execute.
x = np.random.normal(size=1000)
fig, ax = plt.subplots()
H = ax.hist(x, bins=50, alpha=0.5, histtype='stepfilled')
Can ...
2
votes
1
answer
4k
views
Exporting Correlation Matrix (from function)
I'm interested in exporting a correlation matrix to csv. I've tried using the to.csv functionality, but my matrix is obtained from a function and I get an "object has no attribute 'to_csv'" error. I ...
5
votes
2
answers
9k
views
How can I draw bar graph in python on aggregated data?
Normally when I draw bar plot its simple as
...
1
vote
1
answer
726
views
rectangular markers in bubble plot (Python)
I would like to make a 'bubble' plot, but with rectangular markers. Is it possible to do this in Python?
On x-axis should be the day of the week (Mon, Tue, Wed,...), on y-axis - counts, how many ...
3
votes
1
answer
10k
views
Plotting multivariate linear regression
For practicing linear regression, I am generating some synthetic data samples as follows.
First it generates 2000 samples with 3 features (represented by x_data). ...
2
votes
1
answer
2k
views
Validation curve unlike SKLearn sample
I'm trying to implement the validation curve based on this SKLearn tutorial. On the site, it shows how based on the parameters the model goes from under- to overfitted, finding the optimal parameter ...
6
votes
1
answer
3k
views
Correlation between specific columns of a data set
I have a CSV file which has 150 columns belonging to 7 categories but I want a correlation between 2 categories. The categories are movies and music, 12 and 19 columns respectively.
Is there a way ...