Easy Learn Python - With Easy Blog

Long chain of connections using Sankey Matplotlib 0

Long chain of connections using Sankey Matplotlib

Long chain of connections using Sankey Demonstrate/test the Sankey class by producing a long chain of connections. from itertools import cycle import matplotlib.pyplot as plt from matplotlib.sankey import Sankey links_per_side = 6 def side(sankey,...

Mmh Donuts!!! Matplotlib 0

Mmh Donuts!!! Matplotlib

Mmh Donuts!!! Draw donuts (miam!) using Path and Patches. import numpy as np import matplotlib.path as mpath import matplotlib.patches as mpatches import matplotlib.pyplot as plt def wise(v): if v == 1: return “CCW” else:...

Barchart Matplotlib 0

Barchart Matplotlib

Barchart A bar plot with errorbars and height labels on individual bars. import numpy as np import matplotlib.pyplot as plt men_means, men_std = (20, 35, 30, 35, 27), (2, 3, 4, 1, 2) women_means,...

Circles, Wedges and Polygons Matplotlib 0

Circles, Wedges and Polygons Matplotlib

Circles, Wedges and Polygons This example demonstrates how to use patch collections. import numpy as np import matplotlib from matplotlib.patches import Circle, Wedge, Polygon from matplotlib.collections import PatchCollection import matplotlib.pyplot as plt # Fixing...

Custom tick formatter for time series Matplotlib 0

Custom tick formatter for time series Matplotlib

Custom tick formatter for time series When plotting time series, e.g., financial time series, one often wants to leave out days on which there is no data, i.e. weekends. The example below shows how...

Labeling ticks using engineering notation Matplotlib 0

Labeling ticks using engineering notation Matplotlib

Labeling ticks using engineering notation Use of the engineering Formatter. import matplotlib.pyplot as plt import numpy as np from matplotlib.ticker import EngFormatter # Fixing random state for reproducibility prng = np.random.RandomState(19680801) # Create artificial...

Date tick labels Matplotlib 0

Date tick labels Matplotlib

Date tick labels Show how to make date plots in matplotlib using date tick locators and formatters. See major_minor_demo1.py for more information on controlling major and minor ticks All matplotlib date plotting is done...

Affine transform of an image Matplotlib 0

Affine transform of an image Matplotlib

Affine transform of an image For the backends that support draw_image with optional affine transform (e.g., agg, ps backend), the image of the output should have its boundary match the dashed yellow rectangle. import...

Scatter plot with pie chart markers Matpoltlib 0

Scatter plot with pie chart markers Matpoltlib

Scatter plot with pie chart markers This example makes custom ‘pie charts’ as the markers for a scatter plot. Thanks to Manuel Metz for the example import numpy as np import matplotlib.pyplot as plt...

Building histograms using Rectangles and PolyCollections Matplotlib 0

Building histograms using Rectangles and PolyCollections Matplotlib

Building histograms using Rectangles and PolyCollections Using a path patch to draw rectangles. The technique of using lots of Rectangle instances, or the faster method of using PolyCollections, were implemented before we had proper...