Tutorial by Examples

This example illustrates how to create a simple sine curve using Matplotlib # Plotting tutorials in Python # Launching a simple plot import numpy as np import matplotlib.pyplot as plt # angle varying between 0 and 2*pi x = np.linspace(0, 2.0*np.pi, 101) y = np.sin(x) ...
In this example, we take a sine curve plot and add more features to it; namely the title, axis labels, title, axis ticks, grid and legend. # Plotting tutorials in Python # Enhancing a plot import numpy as np import matplotlib.pyplot as plt x = np.linspace(0, 2.0*np.pi, 101) y = np.sin(x) ...
In this example, a sine curve and a cosine curve are plotted in the same figure by superimposing the plots on top of each other. # Plotting tutorials in Python # Adding Multiple plots by superimposition # Good for plots sharing similar x, y limits # Using single plot command and legend import...
Similar to the previous example, here, a sine and a cosine curve are plotted on the same figure using separate plot commands. This is more Pythonic and can be used to get separate handles for each plot. # Plotting tutorials in Python # Adding Multiple plots by superimposition # Good for plots sha...
In this example, we will plot a sine curve and a hyperbolic sine curve in the same plot with a common x-axis having different y-axis. This is accomplished by the use of twinx() command. # Plotting tutorials in Python # Adding Multiple plots by twin x axis # Good for plots having different y axis ...
In this example, a plot with curves having common y-axis but different x-axis is demonstrated using twiny() method. Also, some additional features such as the title, legend, labels, grids, axis ticks and colours are added to the plot. # Plotting tutorials in Python # Adding Multiple plots by twin ...

Page 1 of 1