Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

matplotlib boxplot fill box with pattern

import numpy as np
import matplotlib.pyplot as plt

# fake up some data
spread= np.random.rand(50) * 100
center = np.ones(25) * 50
flier_high = np.random.rand(10) * 100 + 100
flier_low = np.random.rand(10) * -100
data = np.concatenate((spread, center, flier_high, flier_low), 0)

# basic plot
bp = plt.boxplot(data, patch_artist=True)

for box in bp['boxes']:
    # change outline color
    box.set(color='red', linewidth=2)
    # change fill color
    box.set(facecolor = 'green' )
    # change hatch
    box.set(hatch = '/')

plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: python concurrent.futures.ProcessPoolExecutor multiple arguments 
Python :: reemplazar un caracter de un string 
Python :: add all columns in django 
Python :: python import a filename given as string 
Python :: real numbers python 
Python :: scaling, cross validation and fitting a model through a pipline 
Python :: python check if variable is module 
Python :: lunarcalendar python 
Python :: Dataframe with defined shape filled with 0 
Python :: 1046 - Game Time 
Python :: how to read file from terminal in python inside code 
Python :: np.column_sytaxck 
Python :: custom_settings in scrpay 
Python :: cv2 pink color range 
Python :: def dict(d) 
Python :: run php websevrer with python 
Python :: iptc text classification example 
Python :: gui apps 
Python :: apply with sf 
Python :: java sript 
Python :: python print to string 
Python :: add a new categorical column to an existing table python 
Python :: You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P. 
Python :: if function error grepper 
Python :: pyfcm image 
Python :: make large 3d plot in python 
Python :: por que usar np.log 
Python :: Recursively find the factorial of a natural number. 
Python :: how to use put method in django 
Python :: Blender Python set center to center of mass 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =