On colormaps

Problems with the (old) standard colormap in Matlab are widely known. Even MathWorks addressed this issue after changing the default colormap in this blog post. But there are several other sources that discuss this issue or provide better colormaps. Most of them just a short Google search away (e.g. here, here or here).

The de facto standard source for good colormaps is ColorBrewer developed by Cynthia Brewerbased on the research of Dr. Cynthia Brewer. To use these maps in Matlab, you can use BrewerMap by DrosteEffect.

To summarize some of the different colormaps, I chose some typical numerical results that I often have to visualize. These are visualized with different ColorBrewer maps, as well as with jet for comparison.

The first example is the checkerboard test case. A source is placed in the middle of the domain and emits radiation in a heterogeneous environment. As for all further pictures: everything is the same but the colormap. The checkerboard results are shown below.

Continue reading “On colormaps”

Analyzing Telegram chats with R and Matlab

I am using Telegram a lot for chatting. Since it is possible to export the chat history with everyone you have been chatting with I wanted to create a word cloud featuring the most common words with my chat partners.

I use several tools for this. There is telegram-history-dump which itself uses telegram-cli for exporting the chat history. Then I use Matlab for some postprocessing (or preprocessing, depending on how you view it) to bring the dumped output in a (for me) manageable form. Lastly I use R to generate a word cloud like the one at the top of this post.

Continue reading “Analyzing Telegram chats with R and Matlab”

Running distance and pace distribution with R

Getting the data – again

Similar to this post, I again gathered my data. This time however, I bulk exported everything from Polar instead of Garmin (there is an app called SyncMyTracks that synchronizes different services).

Continue reading “Running distance and pace distribution with R”

Using JavaScript within HTML in a post

On in the subreddit r/dataisbeautiful I found this awesome post of u/MournerV. He visualized the orientation of streets for any city you are interested in. I want to work with the given code and learn how to build awesome stuff like this too. He furthermore wrote about the whole procedure on his blog and uploaded the code to Github. The license is quoted at the end of this post.

I have never worked with JavaScript and at first I wanted to figure out how to get the code working on WordPress. That is what this post is about.

Continue reading “Using JavaScript within HTML in a post”

Visualizing the the best male running performances with R

The data

With a bunch of data about the best performances in different running events, I wanted to learn how to produce meaningful plots and inside with R and ggplot. The data is originally taken from http://www.alltime-athletics.com/men.htm a website by Peter Larsson. I did a lot of postprocessing to be able to handle the data more easily. I also wanted to learn how to work with R and data frames. Most of the source code was taken from StackOverflow or other sides. Especially helpful was also the ggplot documentation. The data set, together with the source code that produces the figures below can be downloaded from Github.

I consider data for the male running events: 100m, 200m, 400m, 800m, 1.500m, 5.000m, 10.000m and the marathon. For each event, there are hundreds to thousands of results. These results are sorted by best performance. I.e., this might be the 1000 best marathon performances. For each of these performances, we have the associated rank that comes along with that performance. But also data like the name, date of birth and nationality of the athlete. Some typical lines in the original data file look like this:

1, 2:02:57 , Dennis Kimetto , KEN , 22.04.84 ,1, Berlin , 28.09.2014
2, 2:03:02 , Geoffrey Mutai , KEN , 07.10.81 ,1, Boston , 18.04.2011
3, 2:03:03 , Kenenisa Bekele , ETH , 13.06.82 ,1, Berlin , 25.09.2016

Meaning that Dennis Kimetto from Kenya ran the marathon world record in Berlin in 2014 with a time of 2:2:57h. The second best performance all-time was from Geoggrey Mutai and the third best performance from Kenenisa Bekele. The data was obtained in July 2018, so there might be some changes in the future.

Continue reading “Visualizing the the best male running performances with R”