Python code to create trees and its graphical model representation using pydot

In this post, I learned the post from the python heaven using pydot to create graphs. The following code creates a phylogenetic tree first and then creates its corresponding graphical model representation. The two figures are here:   Advertisements Continue reading Python code to create trees and its graphical model representation using pydot

Generating Graph Visualizations with pydot and Graphviz

Originally posted on The Python Haven:
Hi, for my latest college assignment I had to find a way to visualize data that is interrelated. For instance, my application generated the following data: A –> B B –> C B –> D And I needed a way to generate pretty graphs without too much headache! I am already using wxPython for the application’s UI (it saved me a lot of time, and I learned a lot in the process, even implemented my own clone of the Aero Wizard layout used in Windows Vista and 7), so I tried to look for… Continue reading Generating Graph Visualizations with pydot and Graphviz

How to draw the pairwise marginal distribution for each pair of parameters in a grid using ggplot2

Assuming I have the posterior samples for each of the four parameters. My question is how to plot the pairwise marginal distribution on a grid of 4*4=16 with ggplot2? The easiest solution I find is to use ggpairs() from GGally package in R. ┬áThe original post is at stackoverflow. I paste the toy sample dataset named “df” which is a data.frame with four variables x, y, z, w below: The code using ggpairs() is below: You can see the plot produced by ggpairs() by clicking the following link: samplePlot The upper triangle denotes the estimated joint kernel density estimation and … Continue reading How to draw the pairwise marginal distribution for each pair of parameters in a grid using ggplot2

Multiple line plots with different range of x-axis with ggplot2

In this post, I am going to explain how to plot two lines within a same plot with different range of x-axis in ggplot2. When we search online, there are many example codes that provide a solution to the dual line plots sharing same x-axis, but there is not much to refer to with different range of x-axis. We would like to plot y with respect to x for this two datasets within a same figure. We noticed that the range of x-axis in the two plots are different. The following code provides a remedy for that. Continue reading Multiple line plots with different range of x-axis with ggplot2