Skip to content

Instantly share code, notes, and snippets.

View iros's full-sized avatar

Irene Ros iros

View GitHub Profile
@iros
iros / 01.approach-1.js
Last active August 29, 2015 14:04
d3 + canvas, approaches code snippets
var base = d3.select("#vis");
var chart = base.append("canvas")
.attr("width", 400)
.attr("height", 300);
var context = chart.node().getContext("2d");
var data = [1,2,13,20,23];
var scale = d3.scale.linear()
.range([10, 390])
@iros
iros / plot.py
Created July 17, 2014 19:50
plotting 3d surface from 3 columns in data frame
from mpl_toolkits.mplot3d import Axes3D
import statsmodels.api as sm
dpu = pu[pu.Reputation < 5000]
X = dpu[['Age', 'TimeOnSite']]
y = dpu['Reputation']
X = sm.add_constant(X)
est = sm.OLS(y, X).fit()
@iros
iros / css_pattern_use.html
Last active March 15, 2022 11:33
patternfill_gists
<div class="circles-1">
</div>
@iros
iros / nantests.txt
Created August 13, 2015 19:09
Python nan tests
isnan 1 if nan element-by-element
isinf 1 if inf element-by-element
isfinite 1 if not inf and not nan element-by-element
isposfin,isnegfin 1 for positive or negative inf element-by-element
isreal 1 if not complex valued element-by-element
iscomplex 1 if complex valued element-by-element
isreal 1 if real valued element-by-element
is_string_like 1 if argument is a string scalar
is_numlike 1 if is a numeric type scalar
isscalar 1 if scalar scalar
@iros
iros / 0.plt.txt
Last active August 29, 2015 14:27
matplotlib style attributes
alpha Alpha (transparency) of the plot – default is 1 (no transparency)
color Color description for the line.1
label Label for the line – used when creating legends
linestyle A line style symbol
linewidth A positive integer indicating the width of the line
marker A marker shape symbol or character
markeredgecolor Color of the edge (a line) around the marker
markeredgewidth Width of the edge (a line) around the marker
markerfacecolor Face color of the marker
markersize A positive integer indicating the size of the marker
@iros
iros / README.md
Created April 6, 2016 17:50
D3 Force Layout + Pixi.js Experiment
@iros
iros / force.reqanimframe.js
Created April 15, 2016 19:49
force layout with d3.timer instead of tick loop
var force = d3.layout.force()
.charge(-150)
.linkDistance(30)
.size([width, height]);
d3.json("assets/500nodes.json", function(error, graph) {
if (error) throw error;
// Task 2:
// Connect the force layout to the nodes and links in our dataset