Monthly Archive: February 2018

Matplotlib Legend Labels With Plots 0

Matplotlib Legend Labels With Plots

Defining legend labels with plots. import numpy as np import matplotlib.pyplot as plt #Make some fake data. a = b = np.arange(0, 3, .02) c = np.exp(a) d = c[::-1] # Create plots with...

Matplotlib Object-Oriented Interface 0

Matplotlib Object-Oriented Interface

A pure OO (look Ma, no pyplot!) example using the agg backend. from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure fig = Figure() # A canvas must be manually attached to the...

Matplotlib Bezier polycurve path patch 0

Matplotlib Bezier polycurve path patch

This example showcases the PathPatch object to create a Bezier polycurve path patch. import matplotlib.path as mpath import matplotlib.patches as mpatches import matplotlib.pyplot as plt Path = mpath.Path fig, ax = plt.subplots() pp1 =...

Matplotlib Text Watermark 0

Matplotlib Text Watermark

import numpy as np #import matplotlib #matplotlib.use(‘Agg’) import matplotlib.pyplot as plt # Fixing random state for reproducibility np.random.seed(19680801) fig, ax = plt.subplots() ax.plot(np.random.rand(20), ‘-o’, ms=20, lw=2, alpha=0.7, mfc=’orange’) ax.grid() # position bottom right fig.text(0.95,...

Matplotlib Using a ttf font file 0

Matplotlib Using a ttf font file

Although it is usually not a good idea to explicitly point to a single ttf file for a font instance, you can do so using the font_manager.FontProperties fname argument. Here, we use the Computer Modern roman font...

Matplotlib Unicode Minus 0

Matplotlib Unicode Minus

You can use the proper typesetting Unicode minus (see https://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hyphen for minus, which some people prefer. The matplotlibrc param axes.unicode_minus controls the default behavior. The default is to use the Unicode...

Data Analysis Time Series problem With a Naive Approach 0

Data Analysis Time Series problem With a Naive Approach

Most of us would have heard about the new buzz in the market i.e. Cryptocurrency. Many of us would have invested in their coins too. But, is investing money in such a volatile currency...

Python Data Analysis with Panda 0

Python Data Analysis with Panda

In order to explore our data further, let me introduce you to another animal (as if Python was not enough!) – Pandas Pandas is one of the most useful data analysis library in Python (I...

How Install Matplotlib on Linux, Mac Os and Windows 0

How Install Matplotlib on Linux, Mac Os and Windows

Installing an official release Matplotlib and most of its dependencies are all available as wheel packages for macOS, Windows and Linux distributions: python -mpip install -U pip python -mpip install -U matplotlib Note The...

How To Learn and Expert in Python 0

How To Learn and Expert in Python

So, you want to become a data scientist or may be you are already one and want to expand your tool repository. You have landed at the right place. The aim of this page...