python - Displaying colors of very narrow rectangles in matplotlib's bar plot -


i'm trying plot data in matplotlib has wide x axis range. have 2 sets of data, distinguishable via 2 colors. however, rectangles used in standard bar plot narrowed colors don't display. here's code i'm using:

import matplotlib.pyplot plt fig=plt.figure() ax1=fig.add_subplot(111) ax1.bar(plotreal,plotabundance,color='#330000') #first data (x,y,color) ax1.bar(xlist,ylist,color='#9999ff') #second set of data (x,y,color) ax1.set_xlabel() #some axis labeling ax1.set_ylabel() #some axis labeling ax1.set_title() #some title labeling plt.savefig('chart of '+str(counter)+'.png') #some more parameters 

the data in second set may overlap of first (having same points), , color show whenever case. interested in keeping display format each point displayed line/rectangle, add colors lines/rectangles.

even though tried making contrasting colors of 2 data sets it's still impossible distinguish second set in example contained 4 coordinates , first set contained rest.

sample data

(if anyone's curios, output data mass spectrometer)

is there graph type or parameters i'm missing can use remedy color problem? in advance.

the edge colour set different parameter (default=black). bars small see fill colour looks black since edge stays same size!

to fix, add edgecolor=...:

import matplotlib.pyplot plt fig=plt.figure() ax1=fig.add_subplot(111) ax1.bar(plotreal,plotabundance,color='#330000',edgecolor='#330000') #first data (x,y,color,edgecolor)  ax1.bar(xlist,ylist,color='#9999ff',edgecolor='#9999ff') #second set of data (x,y,color,edgecolor) ax1.set_xlabel() #some axis labeling ax1.set_ylabel() #some axis labeling ax1.set_title() #some title labeling plt.savefig('chart of '+str(counter)+'.png') #some more parameters 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -