Skip to content
Advertisement

Tag: matplotlib

Seaborn scatter plot from pandas dataframe colours based on third column

I have a pandas dataframe, with columns ‘groupname’, ‘result’, and ‘temperature’. I’ve plotted a Seaborn swarmplot, where x=’groupname’ and y=’result’, which shows the results data separated into the groups. What I also want to do is to colour the markers according to their temperature, using a colormap, so that for example the coldest are blue and hottest red. Plotting the

Avoid annotations and tick y_tick labels overlapping

I went through several questions but none seem to address the problem of annotations overlapping with y tick labels. I found a nice code that prevents annotations overlapping among themselves, but nothing with tick labels. My problem is quite simple actually. I use the following lines to create the graph I paste just below them. I use annotate to show

Is there a way to visualise time series data in such a way that on x-axis i get ticks in year-month format in python?

I am trying to plot a data of stock close price for each day but on the x-axis, i get no labels on xtick instead of year-month format I tried to take the “Date” and “Close Price” column in a separate dataframe and then tried plotting them. I have dataframe similar to this Answer Just covert it with pandas to_datetime()

Matplotlib throws warning message because of findfont – python

I want to plot a basic graph, basically consisting of two lists of the form x = [1,2,3,…,d], y = [y1,y2,…,yd]. after using_ pyplot.plot(x,y) I get a huge amount of warning messages referring to findfont errors (see below..) I just installed matplotlib. All the threads I could find refer to changing fonts manually and having warning messages popping up. I

Mute DEBUG alerts from ‘import pandas’ statement

I’m importing pandas and it continues to throw 7 DEBUG messages. It’s happening in JupyterLab and pythonanywhere. It does not appear when I comment out the pandas import I tried to mute them using: warnings.filterwarnings(“ignore”), to no avail. Tried “from pandas import pandas as pd” to try and avoid any further import, etc. … goes on for 100+ lines further

Why error bars in log-scale matplotlib bar plot are lopsided?

I’m trying to plot some bar plots, where each y-value is averaged over some series. Consequently, I’m also trying to add the error bars (standard deviations) for each bar. The magnitudes generally seem right, even in log scale, but for several of the bars, the error bar drops down (- direction) almost indefinitely, while the + direction error is the

How to combine 2 dataframe histograms in 1 plot?

I would like to use a code that shows all histograms in a dataframe. That will be df.hist(bins=10). However, I would like to add another histograms which shows CDF df_hist=df.hist(cumulative=True,bins=100,density=1,histtype=”step”) I tried separating their matplotlib axes by using fig=plt.figure() and plt.subplot(211). But this df.hist is actually part of pandas function, not matplotlib function. I also tried setting axes and adding

Advertisement