PostHeaderIcon Python Visualizing Data

“I believe that visualization is one of the most powerful means of achieving personal goals.”
Harvey Mackay

A wide variety of tools exists for visualizing data
We will be using the matplotlib library

In particular, we will be using the matplotlib.pyplot module. In its simplest use, pyplot maintains an internal state in which you build up a visualization step by step, you can save it (with savefig()) or display it (with show()).
let us for one simple example:
Python Visualizing Data

# !/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Jerry'
from matplotlib import pyplot as cplt

years = [1950, 1960, 1970, 1980, 1990, 2000, 2010]
price = [300.2, 543.3, 1075.9, 2862.5, 5979.6, 10289.7, 14958.3]

cplt.plot(years, price, color='blue', marker='o', linestyle='solid')

cplt.title("years of company price")

cplt.ylabel("Millions of RMB")

Leave a Reply

Your email address will not be published. Required fields are marked *



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2010 - C++ Technology. All Rights Reserved.

Powered by Jerry | Free Space Provided by