-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: map multiple numerical and categorical data to plots #766
Comments
I might be able to help, but it would be much easier if you supplied your data. Can you copy it into into a github gist? |
So I took a stab at this using Plots.jl (honestly, I don't plan on attempting this in pure Gadfly, I think it will be too annoying) Feel free to open issues at https://github.com/tbreloff/Plots.jl/issues with questions/requests. |
Hi Tom. Thanks for taking care of my request. I will look at Plots over the next few days. Just in case you want to go on, please find attached our data. laurent |
it looks like the Gadfly backend used by Plots has an intrinsic problem with variable marker size. Here is my script: and here is the message I got 4 times (one for each Category): The plot is working with a fixed marker size. |
This is an update. I've reproduced the above plot using Gadfly master: except for the size and shape scales - which hopefully will be a future development! Note I'm not sure if size was linked to area or radius in the plot above. using DataFrames, Gadfly
# There is a link to Data.txt in the issue above
D = readtable("Data.txt", header=true)
D[D[:Weight_Fischer].>0.01, :Weight_Fischer] = 0.01
theme1 = Theme(point_size_min=2pt, point_size_max=9pt,
point_shapes=[square, circle, utriangle, diamond])
shapesc = Scale.shape_discrete(levels=["BP","CC","KEGG_PATHWAY","MF"])
colsc = Scale.color_continuous(colormap = Scale.lab_gradient(colorant"red",
colorant"orange", colorant"yellow"))
p = plot(D[end:-1:1,:], x=:Fold_Enrichment, y=:Term, size=:Gene_Count, shape=:Category,
color=:Weight_Fischer, Geom.point, theme1, shapesc, colsc,
Coord.cartesian(xmin=0, xmax=22),
Guide.colorkey("P-value")
) |
I am 1) a newbie to Julia (and to programming) 2) a biologist 3) French. It's tough but c'est la vie !
In biology we often want to map several kind of numerical (e.g. fold enrichment, gene counts, p-value) and categorical (e.g. gene ontology category) data in a single plot. Some colleagues of mine produced the attached plot using R and ggplot2. I failed to produce a similar plot using Gadfly. I could map the p-value to the point color (Scale.ContinuousColorScale(Scale.lab_gradient(colorant"white",colorant"orange",colorant"red"))), but could not change their shape and size to map GO category and gene count, respectively. I suspect a solution might be something like change the Theme for each point, but it sounds quite complicated and I still don't find out how to change the shape depending on categorical values. Any idea ?
Thanks a lot for your help.
laurent
The text was updated successfully, but these errors were encountered: