-
Notifications
You must be signed in to change notification settings - Fork 44
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
show how to modify a AoG plot using Makie #268
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -119,3 +119,21 @@ fg #hide | |||||
When setting the `width` and `height` dimensions of each axis manually you | ||||||
will need to call `AlgebraOfGraphics.resizetocontent!(fg)` before | ||||||
displaying the figure such that each axis is sized correctly. | ||||||
|
||||||
This `.figure` field can also be used to adjust a plot using `Makie`. | ||||||
See the Makie [API reference](http://makie.juliaplots.org/stable/makielayout/reference.html) | ||||||
for more information. | ||||||
|
||||||
```@example combined-3 | ||||||
using AlgebraOfGraphics, CairoMakie #hide | ||||||
|
||||||
df = (x = exp.(rand(1000)),) #hide | ||||||
hist2 = data(df) * mapping(:x => log => "log(x)") * histogram() #hide | ||||||
fg = draw(hist2; figure = (resolution = (600, 400),)) #hide | ||||||
|
||||||
lines(fg.figure[1, 1], 0..2pi, cos) #hide | ||||||
fg.figure.content[1].xticklabelrotation = Float64(pi/6) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the example! I was thinking that it would be better IMO if here one was modifying the figure directly rather than the axes (the axes should ideally be accessed as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
is what the current Makie API prescribes I think. |
||||||
fg #hide | ||||||
``` | ||||||
|
||||||
See the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To build on top of the previous example, you should be able to just do
@example combined-2
, without having to copy and hide what comes before.