scatterplot matrix with matplotlib

i couldn’t find a method that draws a scatterplot matrix with matplotlib.pyplot. so i made it. i’m not an expert, so, any advice/criticism is welcome ;)

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import matplotlib.pyplot as plt

def scatterplot(data, data_name):
    """Makes a scatterplot matrix:
    Inputs:
      data - a list of data [dataX, dataY,dataZ,...];
             all elements must have same length

      data_name - a list of descriptions of the data;
                  len(data) should be equal to len(data_name)

    Output:
      fig - matplotlib.figure.Figure Object

    """

    N = len(data)
    fig = plt.figure()

    for i in range(N):
        for j in range(N):
            ax = fig.add_subplot(N,N,i*N+j+1)

            if j == 0: ax.set_ylabel(data_name[i],size='12')
            if i == 0: ax.set_title(data_name[j],size='12')
            if i == j:
                ax.hist(data[i], 10)
            else:
                ax.scatter(data[j], data[i])

    return fig

# Example
if __name__ == "__main__":
    import numpy as np
    import numpy.random as npr

    X = npr.randn(100)
    Y = 1.2 * X + npr.normal(0.0, 0.1, 100)
    Z = - Y ** 2 + X + 0.05 * npr.random(100)
    W = X + Y - Z + npr.normal(0.0, 2.0, 100)

    data = [X, Y, Z, W]
    data_name = ['Data X', 'Data Y', 'Data Z', 'Data W']

    fig = scatterplot(data, data_name)

    fig.savefig('scatterplot.png', dpi=120)
    plt.show()

the output of the example looks like the figure below…

The Global Competitiveness Report 2010-2011

Today, the World Economic Forum updated the Global Competitiveness Report. Japan has received better assessment of the 6th best competitive economy; the previous report gave the country the 8th rank.

The figures in the report indicate that the state of the Japanese business and innovation is brilliant but the economic sophistication is overshadowed by the government inefficiency. The too heavy burden hampers the Japanese market to grow faster. We all agree that social security is important, but the engine of the economy, which is the source of the social security, should be market trading. Why doesn’t it look at its efficiency?

The statistics of Japanese economy is usually gloomy these days. We should try harder to regain the central position of Asian economy. I hope the government stay stable against the political turbulence. The government and the citizens have no time to keep looking inward. The global economy is incessantly moving.

Supernetworking Meeting Held on September 6th

On 6th of September, Johogaku.net held a medium-sized conference in collaboration with IPA (Information technology Promotion Agency). IT engineers and their potential competitors gathered in Kyoto and frankly discussed the future of the IT industry and what the role of the government should be. It was an exciting event as a whole. We’ll upload some of the videos of the sessions on the website. One who missed the conference can feel the atmosphere of it there.

After hosting three major meetings, we are having the feeling that our conferences were somewhat inward-looking; I mean the targets of the Johogaku.net conferences has been Japanese IT engineers, investors and students. We don’t have any English talks, English-speaking speakers, or English-speaking participants (actually we had one French participant). Although the Japanese engineers have the technology and people that can globally compete with and even improve the global standard, the market doesn’t recognize them as big deals.

This fact can be found with regrettable figures in the Global Information Technology Report‘s by WEF; the global (relative) competitiveness of the Japanese IT industry is getting worse. Globalization has been one of the top-rated issues for Japanese people and the government. But there’s been little fruit of the agenda.

Johogaku.net is gonna be holding next big conference in May, 2011. To fight against the closed nature of Japanese IT industry, we’ve set the slogan of it as the “global expansion.” Re-iterating the issue should convey important messages to the Japanese or international students who are going to create the better future. We’re gonna discuss how Japanese IT business can regain its appeal to the international market among other topics. We’re trying to contribute to make the situation better by offering a junction of energetic ideas of young creators and engineers and wisdom of all generations.

If you are interested, please feel free to contact me or the conference organizers. Join us as a participant, a sponsor, or an organizer. In any case, you’ll be most welcome.

Dropbox up to 8GB

This is a quite old story. Sorry for this untimely information.

I missed the important news that Dropbox started to offer 8GB disk space for free! I was sooo stupid… If you have no idea what Dropbox is, please just google it. You can find a lot of information on it. Roughly speaking, it’s real awesome combination of a nice software and a great online storage service.

If you don’t have an account, join through my referral link: https://www.dropbox.com/referrals/NTEwMjg2NDI5.
We’ll both get 250MB additional space. (The minimum storage is 2GB. You can get additional space if you invite other people to Dropbox, up to 8GB. The limit used to be 3GB.)

The new WordPress has come

http://www.downloadsquad.com/2010/06/18/wordpress-3-0-arrives-with-multi-blog-support-and-new-default-t/

The new version, 3.0, of WordPress, on which this website is running, has arrived lately. It has quite nice features. Among them, I’m pleased because you are finally able to manage multiple blogs on a single WordPress program. You know, my website has two identical WordPress core programs to manage Japanese and English versions. Editing small things can be a nuisance because I had to log out and in to move to the other site. So, this version-up can be an excitement to me.

But it is not so easy to upgrade all of my website immediately because I slightly modified several PHP files to somewhat optimize the appearance for each language and I’m not quite sure how things change after employing the multi-blog feature.

Now is the time to ponder.

Google Chrome + quix

Soon after reading this article, quix became one of my favorite scripts. This tool amazingly improves our searching experience. And you can enjoy it even more with Google Chrome. Although it’s basically created as a bookmarklet, it’s possible to integrate the powerful search tool with Chrome’s address bar.

Slight Modification of the Built-in Commands

To fully enjoy quix in the address bar, I strongly recommend to set a “default” search engine. Since this script requires, by default, a command, such as ‘g’, it causes a lot of troubles for someone who loves the simple behavior of the address bar. Let’s get rid of this by rebuilding “quix.txt” file. Download it and open it with your favorite text editor. Add a line at the bottom of it with the following statement:

* http://www.google.com/search?q=%s Untriggered search

By this line, the script interprets an input without any command as a to-be searched phrase. It works quite well. If you wish, you are allowed to add commands for your favorite search engines by editing quix.txt. Follow the instructions given in http://quixapp.com/help/syntax/

Because I’m Japanese, I thought it was necessary to add Japanese counterparts of Google and Amazon. You can’t forget Google Scholar. My custom commands are as follows:

@Custom
@Commands that I added
* http://www.google.com/search?q=%s Untriggered search
aj      http://www.amazon.co.jp/gp/search/?index=blended&keywords=%s&_encoding=utf-8 	Amazon.co.jp Search
gj      http://www.google.co.jp/search?q=%s          Google Japan Search
sc     http://scholar.google.com/scholar?q=%s        Google Scholar

Reflecting the Revision to the Script

Firstly, upload the quix.txt file to a web server. If you don’t have any account, you can’t use the Public folder of Dropbox, which I think is the most wonderful idea. It’s the easiest way to edit and upload. Quix offers a simple script to reflect the revision. Go to the following site. http://quixapp.com/extend/

Integration of Google Chrome and quix

Once you made your custom script, it’s time to integrate it with Chrome. See the following site.

1. Open the script you’ve got in the previous step with a text editor. Modify it as follows.

  • { –> %7B
  • window.prompt(‘Quix: Type `help` for a list of commands:’) –> “%s”

2. Install the script to Google Chrome. You can see a detailed instruction in the above mentioned website.

3. Enjoy quix!

Note. If you wish to revise commands after all those processes, you can do it just by modifying quix.txt on your server. After revising and uploading, execute the “debug” command on the “quixed” address bar. You can see that the new commands will be working.

Inside Pixar’s Leadership

http://www.scottberkun.com/blog/2010/inside-pixars-leadership/

Some transcription from the interview with Ed Catmull, the president of Pixar, held by The Economist.

The notion that you’re trying to control the process and prevent error screws things up. We all know the saying it’s better to ask for forgiveness than permission. And everyone knows that, but I Think there is a corollary: if everyone is trying to prevent error, it screws things up. It’s better to fix problems than to prevent them. And the natural tendency for managers is to try and prevent error and over plan things.

Attaching files by Drag’n'Drop

Drag and Drop Gmail Attachments

Recently added feature of Gmail provides us a really comfortable experiences in email composition. In the conventional web-based email services we couldn’t drag and drop attachments unlike off-line application of a lot more flexibility. Now, Gmail employs a new technique provided by HTML5 to overcome the cumbersome behavior of webmail. You frustration is gone.

Of course you have to be using a modern web browser such as Firefox 3.6+ or Chrome 4+.