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
Several questions, and request (and offer) for documentation update #89
Comments
I'd definitely welcome additions to the documentation, or even pointing out what doesn't make sense. It's all in markdown files in the doc directory. The html is generated using a somewhat incomplete, half-baked documentation system. |
Hi, I'm really liking Gadfly so far! Could you maybe point me in the direction of how to make multiple layers each with a different theme, I couldn't find even the inconvenient way you mentioned anywhere in the manual? You seem to prefer to have everything in one dataframe, but I don't think that should be the only way because it can get pretty clunky in some cases (and sure, layers solve it partly, but not regarding themes). With separate themes for each layer one could potentially manually choose colors and eventually different line styles. I would expect something like this working
but right now it seems like you can only put |
Alternatively, I just noticed that |
Hi @msimberg. I've made an update that lets you pass theme objects to layers, so you should be able to use the syntax your were expecting now. One goal with Gadfly is to have a clear separation between defining the visualization in terms of the data and modifying low-level details of how it's drawn (like assigning specific colors to specific lines). I violated that a little in the name of convenience with the arguments to hline/vline and I want to try to avoid that sort of thing in general. I do understand that if the data you're plotting isn't in one data frame it can be awkward to use Gadfly as it was intended, and I want to try to improve that. What I'm thinking of is adding a syntax sort of like this: x1 = [1, 2, 3]
y1 = [2, 4, 8]
x2 = [1, 2, 3]
y2 = [3, 9, 27]
# draw two lines without manually building a data frame
plot(x=(x1, x2), y=(y1, y2), color=["squares", "cubes"], Geom.line) Anyway, changing colors by setting per-layer themes is fine, but there should eventually exist a nicer way of doing things. |
Thanks @dcjones! Design decisions are obviously up to you and I'm happy with this because it does what I need. Not necessarily an issue (and certainly not for me) but I noticed that |
+1 for being able to plot multiple lines from separate arrays/dfs. |
@dcjones So I was testing around a bit more, and while different themes in different layers works fine now, it's not now possible to get a legend for the different layers (unless I've missed some documentation on legends?) and I think that is really needed. In this regard dataframes are really nice, since you kind of get the right legend for free. If you end up implementing some kind of syntax like the one you proposed (or any syntax that explicitly specifies several lines) then it should also be possible to define a legend for them. I don't know what a reasonable way to do this would be though. Maybe I just need to accept having to use dataframes, but as you seem to agree they're not always the most convenient way to do things. |
It would be really nice if we could add legends for layers. It's either impossible or not documented, but using |
This is old but, for question of customized legends. You can use something like the following:
Related to vstack/hstack, I'd like to plot 3 plots in a grid where each plot is the same size.
Or maybe doing 8 plots with a hole in the middle.
Currently vstack/hstack will create a plot that expands into any unused space so that one of the plots will be larger than the others. I've been looking at trying to make a blank plot or context, but the render function chokes on it. Is there a way to do this at all? |
Hey @dcjones,
I've recently gotten into the world of graphics in Julia (I avoided them for quite a while so things could develop....), but I'm now up and running in IJulia and giving the various packages a spin. My initial taking has been with Gadfly, but I've also run into quite a few questions and hope you can help. I'd also be willing to help flesh out documentation as I continue to learn if that would help.
plot(data,layer(), layer()
correct?Geom.line
layer, can that be detected and different colors be used for the lines? It's just not that helpful to be able to have multiple lines, but a single colorThanks!
The text was updated successfully, but these errors were encountered: