Python Programmer || Data Scientist || Bayesian Astronomer
A Possibility to Find a Planet around the Gargantua Black Hole. Scientific explanation of a planet orbiting a black hole/
A Possibility to Find a Planet around the Gargantua Black Hole. Scientific explanation of a planet orbiting a black hole/
Photo by Alazar Kassahun on Unsplash


In the last decade, the black hole became a hot topic to be discussed. After astronomers worldwide announced their first-ever picture of a black hole in 2019, The Royal Swedish Academy of Sciences awarded astronomers for their discovery about the black hole a year later. Roger Penrose builds the theory, while Reinhard Genzel and Andrea Ghez work in the observational.

People can understand a black hole in a simple by watching a science fiction film, Interstellar. Christopher Nolan produces it. He collaborates with a senior cosmologist, Kip Thorne as a scientific consultant. …

Image for post
Image for post
Photo by Clay Banks on Unsplash

Getting Started

Data visualization is used to shows the data in a more straightforward representation and more comfortable to be understood. It can be formed in histograms, scatter plots, line plots, pie chart, etc. Many people are still using Matplotlib as their back-end module to visualize their plots. In this story, I will give you some tricks, 5 powerful tricks in using Matplotlib to create an excellent plot.

  1. Using LaTeX font

In default, we can use some nice fonts that are provided by Matplotlib. But, some symbols are not good enough to be created by Matplotlib. …

python plotting with Matplotlib
python plotting with Matplotlib

Hands-on Tutorials, Introduction to Matplotlib

This story is the next part of Python Data Visualization with Matplotlib — Part 1. In part 1, we have learned how to generate and customize the scatter plot, line plot, histogram, and bar chart. This story will continue the study in Python plotting with Matplotlib concerning generating and customizing box plot, violin plot, pie chart, polar chart, geographic projection, 3D plot, and contour plot.

As in the part 1, I tell you that I have customized the default parameters in Matplotlib. Here is my plotting style

import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
plt.rcParams['font.size'] = 15
plt.rcParams[''] …

introduction to python plotting with matplotlib
introduction to python plotting with matplotlib
Photo by Jukan Tateisi on Unsplash

Introduction to Matplotlib

Data visualization aims to present the data into a more straightforward representation, such as scatter plot, density plot, bar chart, etc. It is also useful to give readers or analysts a global picture of their data. By visualizing your data, you can detect potential outliers. In Python, you can use various modules or libraries to visualize data. One of the mainstream modules is Matplotlib. You can visualize data using Matplotlib in various plotting styles. But, Matplotlib can not show you a dynamics plot. …

Why we should migrate from WhatsApp to Telegram or Signal messenger because of new privacy policy
Why we should migrate from WhatsApp to Telegram or Signal messenger because of new privacy policy
Photo by Christian Wiediger on Unsplash


A response to WhatsApp new privacy policy

Nowadays, people around the world are surprised by one of the largest messaging app, WhatsApp. WhatsApp updated its terms privacy policy that asking users to share their data with Facebook. It is a big contrast with what WhatsApp promised in 2014 when acquiesced by Facebook.

Even though WhatsApp had clarified some rumors, but the privacy policy seems to contradict it. I only examine one of the claims, “WhatsApp cannot see our shared location, neither can Facebook.”

WhatsApp clarification

WhatsApp will automatically collect and use precise location information of our device with our permission. Even we do not use location-related features, WhatsApp uses our IP address to estimate the general location (city and country). …

Python Visualization

Image for post
Image for post
Photo by Hans Eiskonen on Unsplash

A picture is worth a thousand words means that graphics can more effectively convey ideas than many words. How about animation or video? Animation or video is composed of many pictures. Of course, animation can be more effective in delivering ideas. The next level is the simulation. The difference between animation and simulation is that regardless of whether we play and replay an animation, we will get the same results (like watching a film), but it differs from a simulation. Simulation can produce a different result when we change the parameter. …

python will be dead in 2021
python will be dead in 2021
Photo by Shahadat Rahman on Unsplash

Python is one of the most popular and progressing programming languages. Based on TIOBE, a software quality company stated that Python is an aggressive programming language. In 2020, Python is on top 2, replacing Java. But, number one is still C. It was an impressive achievement for Python in the last 20 years.

Why is Python unstoppable? First, Python is working well for machine learning and deep learning. We can realize it from Google developing simple machine learning or deep learning for people via Google Colaboratory (hereafter: Google Colab). People can run their machine learning or deep learning code in the machine provided by Google Colab. Google Colab holds Jupyter Project to build the Jupyter Notebook environment in Google Colab. …

personalize and customize jupyter notebook using CSS
personalize and customize jupyter notebook using CSS
Image by Author


Are you a python programmer who is using Jupyter Notebook as your compiler? If you want to try a new taste in running your python code in Jupyter Notebook (hereafter; Jupyter), you can change and personalize it by your favorite color, font family. You can apply 11 practical tips I recommend to build your Jupyter user interface.

The default Jupyter you might see when you open it is shown in Figure 1.

motivations lessons and sharing in writing a hands-on Matplotlib
motivations lessons and sharing in writing a hands-on Matplotlib


Did you realize that we will face the end of 2020? For me, 2020 is very bad. I could not remember what I have done this year because almost all of my activity stays home. There are only three moments that are impressed me: (1) I joined a summer school-internship at the National Astronomical Observatory of Japan (NAOJ) in January before lock-down, (2) I graduated in July, and (3)I got 11 hours of reading time in a day at the beginning of November, as shown in the header figure.

This story will share my learning concept in programming and tell the story before I got 11 hours of reading time. In the middle of October, I started to compose a ‘big project.’ I call it a ‘big project’ because I want to write a hands-on understanding and generate various plots using Matplotlib as complete as possible. As I mentioned in the hands-on, maybe what I have composed is not complete for you, but I have tried to complete it for people’s data visualization needs. The purpose is simple, to help many people visualizing their data into enormous styles. I planed to write the hands-on only in one story, but the expectation is not in-line with the reality :D I divided it into two parts. …

python plotting matplotlib scientific plots
python plotting matplotlib scientific plots
Photo by Leslie Cross on Unsplash


There are at least two inspirations in writing this story. The first inspiration is coming from my participation in Summer School on Galaxies and Cosmology (SSGC 2020). It has three parts: Public Lecture, Lectures, and Workshops. One of the Workshops analyzed the weak gravitational lensing using Oguri et al. (2012) as the primary reference. Oguri-san gave the participants his code to analyze the lensing, including the Maptlotlib parameter settings. I won’t talk about the gravitational lensing, but how to generate a professional plot using Matplotlib, as shown in Oguri-san paper.

The other one comes from when I was reading the General Instructions to submit an article in Monthly Notices of the Royal Astronomical Society (MNRAS), one of the world’s leading primary research journals in astronomy and astrophysics. One of the parts in the instructions is how to embed figures in MNRAS. The authors are advised to ensure the color used in their figures are color-blind friendly. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store