Skip to content

Instantly share code, notes, and snippets.

View theengineear's full-sized avatar
👌

Andrew theengineear

👌
  • Netflix
  • Truckee, CA
View GitHub Profile
%matplotlib inline
import matplotlib.pyplot as plt
import io
fig, ax = plt.subplots()
ax.plot([1,2,3])
fig.savefig(io.BytesIO(), format='svg', dpi=fig.dpi)
data = [dict(type='box',
y=np.random.randn(40),
line=dict(color='green', width=5),
marker=dict(color='red',
symbol='square',
line=dict(width=4))) for iii in range(5)]
py.iplot(data, filename='messin')
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
# version: 0.5.13
import plotly
py = plotly.plotly('theengineear', 'o9zlr0hy6z')
data = [dict(x=[1,2,3], y=[3,2,3])]
annotation = dict(text="I'm claustrophobic!", bgcolor='red', pad=10)
layout = dict(annotations=[annotation])
py.iplot(data, layout=layout, filename='no annotation pad')
{
errorbar: {
type: "y",
visible: true,
line: {
width: 3,
color: "rgba(0,0,0,1)"
},
wiskerwidth: 3,
errorplus: [1],
{
showticklabels: true,
autotick: true,
ticks: {
type: "inside",
visible: true,
tick0: 0,
dtick: 1,
length: 5,
line: {
import os
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
if '.py' in f:
print "python file:", f
{
"metadata": {
"name": "",
"signature": "sha256:e887e6ca7fda0fe7f2781998ff822b9a90470ddd5e8cde57abf469809375cd26"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"metadata": {
"name": "",
"signature": "sha256:13367fc17f46585604ab49d22e782064ca30c2194de01cf51821e89156ad0fcf"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
size = 100
x = linspace(-2*np.pi, 2*np.pi, size)
y = linspace(-2*np.pi, 2*np.pi, size)
z = empty((size, size))
loop over length of x with (i):
loop over length of y with (j):
r2 = (x(i)^2 + y(j)^2)
z(i,j) = sin(x(i))*cos(y(j))*sin(r2)/log(r2+1)