Posts

Showing posts with the label plot

Python matplotlib manipulating to use it in the plot title

Image
Python matplotlib manipulating to use it in the plot title assume I've the following variable roundi = theta_result_lasso.round(2) [ 0. -2.36] where theta_result_lasso.round are just two values. The line for my plot title is ax.set_title(r'Globales Minimum $hat beta$ = {}'.format(roundi), fontsize=20) producing this: is there a way to replace the "." after the zero by a "," and descreasing the disance between the two values as it should look like a "vector" ? It should look like this: [0, -2.36] If you Need further informations, I'll provide an example what is type(roundi) ? – jedwards Jul 1 at 22:16 type(roundi) class 'numpy.ndarray' – Leo96 Jul 1 at 22:18 ...

Change edge color, font color and tick color on Haplotype Network Plot in R

Image
Change edge color, font color and tick color on Haplotype Network Plot in R Using the guide on: How to plot Pie charts in haploNet Haplotype Networks {pegas} I was able to make a haplotype plot for my data. Here is my code: library(ape) library(plyr) library(pegas) ## example.DNAbin is the DNAbin class object with the alignments d <- example.DNAbin e <- dist.dna(d) h <- pegas::haplotype(d) h <- sort(h, what = "label") (net <- pegas::haploNet(h)) ind.hap<-with( stack(setNames(attr(h, "index"), rownames(h))), table(hap=ind, pop=rownames(d)[values]) ) col.vec <- adjustcolor(rainbow(ncol(ind.hap)), alpha=0.4) par(bg="white") par(mar=c(1,1,1,1)) plot(net, size=attr(net, "freq"), scale.ratio=3.00, pie=ind.hap, bg=col.vec, fg="white") title(main = "Haplotype Network Plotn of Project AGBOU", line = -2.5, col.main= "black", cex.main=2) This is the plot I obtained: I would like to make the fol...