Wednesday, November 9, 2011

BibTeX converter

Something worth trying out:

http://www.bibtex.org/Convert/

The longer I wait to write a paper in LaTeX, the more tools I will have at my disposal.

hah.

This would be the more flexible tool (which the above is based on): http://www.xandi.eu/bib2x/


Tuesday, November 8, 2011

color-code your 2D matrix

a.k.a. look at a 3D bar graph color-coded by height in plan view

Say you have a reasonably-sized matrix and you want to look for patterns in it. Let's define reasonably-sized as something on the order of 15 by 15, you care about what each value is, but it would be tedious to scan the matrix of numeric values.

Say your matrix is Z, maybe it is a 14x24 matrix of different exponents from polynomial fits to different variables using different thresholds or statistical parameters.

surface(Z) won't do exactly what you want because the values in the matrix will be the vertices of the surface, you want each grid box to be color-coded with the matrix values.

One way to do this is to make a 3D bar plot, color the bars by their height (matrix value), and then look at it in plan view. It's sort of cool.


figure;
h = bar3(Z);


% http://www.mathworks.com/help/techdoc/creating_plots/f10-19972.html
% Tell handle graphics to use interpolated rather than flat shading
shading interp
% For each barseries, map its CData to its ZData
for i = 1:length(h)
    zdata = get(h(i),'ZData');
    set(h(i),'CData',zdata)
    % Add back edge color removed by interpolating shading
    set(h,'EdgeColor','k') 
end
colormap('default')
colorbar;
grid off;
view([0,90])


% you can manipulate the axes (xmin xmax ymin ymax zmin zmax colorbarmin colorbarmax)
axis([0 25 0 15 0 1 0.8 1])


Here's the original document I got the code from:
http://www.mathworks.com/help/techdoc/creating_plots/f10-19972.html

Here's an example of the output.
The rows, 1-14 are 14 different polynomial fits.
The columns, 1-24 are 24 different ways of calculating the x variable in the fit (different thresholds or filters).
The value is the Rsquare value, colorbar color codes it from 0.8 to 1.0.

The matrix shows that the 1st and 23rd-25th columns have the worst fits for all 14 relationships. Also, rows 4, 5, 11, 12, 14 do not produce well-behaved polynomial fits.

Really I just think it's a nice quilt pattern.

As an added plus you can use the rotate button to look at it from any angle you want.


Monday, November 7, 2011

encouragement

Encouragement to an early-career scientist (me) in an email:  (I had replied to his earlier email which questioned our recent publication and asked if he would like to contribute any datasets to a relevant database for bedload transport.)

Although I coauthored publications concerning datasets and data needs with respect to sediment and bedload and founded a relevant organization (attached), this topic is at the very best very complex and I advise to reconsider spending any of your time on a process which you have studied, upon your admittance, little.


Always great to have encouragement from the wise elders of the field.

It's sort of like when Ice-T (wise elder) told Soulja Boy (early career rapper) to "Eat a Dick" for "single-handedly killing hip hop." In his youtube reply, Soulja Boy was none too pleased, but I remember him saying something useful like "Why don't you give me some constructive advice instead of telling me to eat a dick." (paraphrasing)

Oh well, I just drew an analogy between myself and Soulja Boy. At least I have that.

Tuesday, November 1, 2011

example database

Here is an example of a database that is supposedly popular in its discipline. Wonder how.

Paleobiology Database

http://paleodb.org/cgi-bin/bridge.pl