I get: ValueError: 'c' argument must be a mpl color, a sequence of mpl colors or a sequence of numbers, not Index(.list of index species names. import pandas as pd import matplotlib.pylab as plt. Ideally I'd want something like what is shown here, line 69:īut when i tried: df.plot.scatter(x='BGC frequency - Count', y='Proportion of total BGCs both captured and not captured by antiSMASH - %', c=df.index, cmap="viridis", s=50) How to use the row indices of a data frame as the x-variable in a ggplot2 plot in. To add on to the discussion, I am going to demonstrate three plotting methods (from most straightforward to least) using the first five points of your data frame. Y= 'Proportion of total BGCs both captured and not captured by antiSMASH - %' ,īut I cant get a legend. ![]() First, create a new series by converting the pandas datetime64 index to a Python datetime.datetime class. , (), Group by index labels and take the means and standard deviations. import matplotlib.pyplot as pltĬolorlist = list(())Ĭaptured_df.plot.scatter(x='BGC frequency - Count', As a general solution, I have found the following method to be an easy way to bring a Pandas datetime64 index into a matplotlib axis label. I want to make a scatter plot of BGC frequency - Count vs Proportion of total BGCs both captured and not captured by antiSMASH - %, with points coloured according to the categorical Index, and a legend. Version Check Plotlys python package is updated frequently. I have a dataframe (nb - the data is dummy data and does not represent what is in the plots): Index BGC frequency - Count Proportion of total BGCs both captured and not captured by antiSMASH - % Use matplotlibs plot () method to create a horizontal bar plot with.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |