Jupyter-notebook get started
In [73]:
%matplotlib inline
In [74]:
from pylab import *
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

In addition to the regular plot method, there are a number of other functions for generating different kind of plots. See the matplotlib plot gallery for a complete list of available plot types: http://matplotlib.org/gallery.html. Some of the more useful ones are show below:

In [75]:
n = np.array([0,1,2,3,4,5])
In [76]:
fig, axes = plt.subplots(1, 4, figsize=(12,3))

axes[0].scatter(xx, xx + 0.25*np.random.randn(len(xx)))

axes[1].step(n, n**2, lw=2)

axes[2].bar(n, n**2, align="center", width=0.5, alpha=0.5)

axes[3].fill_between(x, x**2, x**3, color="green", alpha=0.5);
In [77]:
from mpl_toolkits.mplot3d.axes3d import Axes3D
In [78]:
fig = plt.figure(figsize=(14,6))

# `ax` is a 3D-aware axis instance because of the projection='3d' keyword argument to add_subplot
ax = fig.add_subplot(1, 2, 1, projection='3d')

p = ax.plot_surface(X, Y, Z, rstride=4, cstride=4, linewidth=0)

# surface_plot with color grading and color bar
ax = fig.add_subplot(1, 2, 2, projection='3d')
p = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=matplotlib.cm.coolwarm, linewidth=0, antialiased=False)
cb = fig.colorbar(p, shrink=0.5)
Markdown Reference

Markdown For Typora


Markdown is created by Daring Fireball, the original guideline is here. Its syntax, however, varies between different parsers or editors. Typora is using GitHub Flavored Markdown.

Please note that HTML fragments in markdown source will be recognized but not parsed or rendered. Also, there may be small reformatting on the original markdown source code after saving.

Read more…

Pygal charts get started

If you are using reStructuredText and install pygal, Nikola has support for rather nice charts with little effort, and i's even semi-interactive (hover your pointer over the legend!):

.. chart:: StackedLine
   :title: 'Browser usage evolution (in %)'
   :fill: True
   :x_labels: ['2002','2003','2004','2005','2006','2007','2008','2009','2010','2011','2012']
   :width: 600
   :height: 400
   :explicit_size: True
   :style: DefaultStyle

   ('Others',  [14.2, 15.4, 15.3,  8.9,    9, 10.4,  8.9,  5.8,  6.7,  6.8,  7.5])
   ('IE',      [85.8, 84.6, 84.7, 74.5,   66, 58.6, 54.7, 44.8, 36.2, 26.6, 20.1])
   ('Firefox', [None, None, None, 16.6,   25,   31, 36.4, 45.5, 46.3, 42.8, 37.1])
   ('Chrome',  [None, None, None, None, None, None,    0,  3.9, 10.8, 23.8, 35.3])

Read more…

简洁纯粹的 Foxit MobilePDF 阅读器

最早接触 Foxit Reader(福昕阅读器) 还是在 Windows 平台上,相较于 Adobe Reader 动辄上百兆的臃肿体积,功能齐全、小巧好用(≤10MB)的 Foxit Reader 无疑给笔者留下了深刻印象。非要鸡蛋里挑骨头的话,唯一让人颇有微词的恐怕是:默认的图标感觉有点丑 …… 尽管如此,每当有人抱怨 Adobe Reader 时,笔者总是很嗨皮地推荐福昕阅读器(后来也开始推荐更小巧的 Sumatra PDF)。

笔者全面转战 OS X/ iOS 平台以后,想要在 iPhone 上阅读 PDF 文档,App Store 上搜寻半天不满意之时,突然想起来曾经用过的 Foxit Reader。也许也对应开发了移动版本呢?仔细一找果然有:Foxit MobilePDF !而且是免费的,果断下载安装之,一如既往的好用,哈哈。后来又陆续接触到一些 PDF 阅读器,但半年多以来 Foxit MobilePDF 始终占据在手机里,使用频率相当高。那么,接下来向大家推荐一下笔者眼中的这款国产精品软件吧~

Read more…

使用 Sublime Text 写作 Markdown

什么是 Markdown

Markdown 是一种轻量级标记语言,创始人为约翰·格鲁伯(John Gruber)。它允许人们“使用易读易写的纯文本格式编写文档,然后转换成有效的XHTML(或者HTML)文档”。 —— 来自维基百科 1

Markdown 创立的宗旨是实现「易读易写」。其语法简洁直观,你可以使用任何喜爱的文本编辑器来阅读和写作,更专注于书写的文字内容而不是排版样式。编辑完毕可轻松地导出成 HTML、PDF 等其它格式。

语法学习参考 : Markdown 语法说明(简体中文版)

Read more…

Contents © 2018 ashfinal - Powered by Nikola