Saturday, July 23, 2011

GNU Octave Custom Colormap

Hello, Unlikely Reader - 
So I wanted to rescale color 3D plot with a more agreeable set of values.  Octave handles this, but I thought I'd write up how because it isn't an everyday task and I'm sure I'll forget how I did it.


Here's some data plotted with the default colormap:


The plot is fine but the wide range of color was subjectively implying more curvature in the data than I meant to.  Of course that's all subjective but the data was supposed to make a point and the colormap was working against it.  






Here's a 3D view that makes my point better, but 3D views on flat surfaces are harder to interpret; for example, the diagonal "valley" of low spots gets a little lost:



So I built my own lowest to highest Red-Yellow-Green colormap and applied it; here's how.
n_levels = (10-7)/0.1 + 1;  % numbers of interest range from 7 to 10


% build RGB channels from red to yellow:
red2yellow_chRed = linspace(1, 1, n_levels/2);
red2yellow_chGreen = linspace(0, 1, n_levels/2);
red2yellow_chBlue = linspace(0, 0, n_levels/2);


% build RGB channels from yellow to green:
yellow2green_chRed = linspace(1, 0, n_levels/2);
yellow2green_chGreen = linspace(1, 1, n_levels/2);
yellow2green_chBlue = linspace(0, 0, n_levels/2);


% create the colormap by stacking and concatenating the channel vectors::
RYG_colormap = [ ...
[red2yellow_chRed'; yellow2green_chRed'] ...
[red2yellow_chGreen'; yellow2green_chGreen'] ...
[red2yellow_chBlue'; yellow2green_chBlue'] ...
];

% set the colormap
colormap(RYG_colormap);


The plot automatically updates and helps support my point that there's not so much curvature in the data.















If you don't like it, you can easily switch back:
colormap("default");
Or if black and white is better for you, there's a predefined grayscale map:
colormap(gray);
















There you go.  Colormaps.   Happy (r)Octave-ing!

- nzvyyx

Tuesday, July 19, 2011

Shuttleworth Kicks Ballmer's ASS

Thanks to LiLi's Live USB Creator I've got a nice clean A:B comparison of M$ vs Linux.  Today's heavy lifting for the OS was to run a perl script (which worked fine under XP):

My shiny new Windows 7 FAILS:




...while Ubuntu running from a 4Gb LiLi Live USB works just fine, thank you:


Best of all, thanks to LiLi's VirtualBox install, I don't even have to choose between operating systems!  Here's Ubuntu running in a virtual machine hosted by my L7 OS.


Maybe I'll be able to get my job done after all.


- nzvyyx

Saturday, July 16, 2011

VNC... high quality & free remote access

Dear Blogspot/Blogger.Com:
Thank you for your wonderful service.  I noticed a sidebar ads pushing a for-pay remote PC access program - which will remain unnamed.  It appears to be a scam to continually charge hapless users for free software.


Dear Reader:
If you need to access computers remotely, look into VNC... you'll probably notice that web searches prioritize non-free programs... caveat emptor!  Those ripoff artists have a lot of time on their hands to bury the high quality, cross-platform free stuff with their own web pages and link overload.


- nzvyyx

Friday, July 15, 2011

... and L7 once again FAILS

Yesterday I had MySQL up and running on my overpriced WindoesNT laptop as provided by MegaCorp Inc.  I logged in/out/in/out both as root and a user.  I pulled in my ginormous database that I had saved from my old burn.  I entered data, set up queries and forms in LibreOffice Base.   All appeared to be working fine.  I was a happy user.


Last night I shut down.  Restart the machine in the morning.... login denied.  No MySQL access.  Denied.  Hopefully I can find a way to get my data back, but regardless that was the last straw and it's official:


I HATE WINDOWS 7.


This is probably due to UAC resetting on a reboot, but no matter what: data loss is unacceptable... and since I can't get to the data, it counts as lost.  No matter what, erratic behavior is frustrating as hell for a user.  This "feature" of resetting UAC on reboots is a built-in frustration.


Next plan is to bring in my cheap-O linux box and do all my real work on it.




- nzvyyx

Thursday, July 14, 2011

Connecting Base to MySQL

Notes on getting my Ubuntu machine to connect Base to MySQL:
sudo apt-get install libmyodbc


Then add a couple of config files (thanks, OpenOffice Wiki)
































 Let Base know what's up:






Connect!






- nzvyyx

Wednesday, July 13, 2011

bash to dos to bash (thanks, Git!)

When I installed Git, it gave me several context menus to get the bash prompt.  On my new Win7 machine this makes reaching the bash prompt much easier & faster than finding a windows command line... but wait I can easily get a dos prompt FROM the bash prompt.  Woops, I'm never learning any more Powershell or whatever.  C Ya, Ballmer!


As an entertaining aside it appears that the "7" in Windows 7 is a minor release level.  Ya like I didn't already know it was Vista.




- nzvyyx

Tuesday, July 12, 2011

Plot Digitizer

If you need to pull data from a graphic, Plot digitizer is for you.  Fairly small memory footprint & intuitive controls, and it's cross-platform (which is a big deal for me these days...)
This might help you get it set up:



sudo mkdir PlotDigitizer
cd PlotDigitizer
wget http://downloads.sourceforge.net/project/plotdigitizer/plotdigitizer/2.5.1/PlotDigitizer_2.5.1_Linux_and_Others.tgz
tar -xvzf PlotDigitizer_2.5.1_Linux_and_Others.tgz


- nzvyyx