-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
plot_title kwarg is ignored #2587
Comments
That depends on the backend used. Generally one can add an empty subplot that only has a title at the top of the layout. |
I actually started implementing it in #2363 (without the backend implementations though) |
Ahoy, what's the current status of this issue? We would be very interested in using the |
Could someone post a code example for a workaround, like the empty plot thing? The example provided here kind of works, but it's a bit ugly since you can still the see the plot in the background of the title... |
Hey @BeastyBlacksmith and Plots.jl team! Great work here! I was just wondering, what is the status on this issue? As @bgroenks96 pointed out, there was a bit of a hack that I am using as well. Here is an example of me working around this issue that looks something like this (the code is not too pretty!): using DataFrames
using Plots
df = rand(5, 5) * 10 |> DataFrame
function pairplot(df)
rows, cols = size(df)
y = ones(3)
title = Plots.scatter(
y,
marker = 0,
markeralpha = 0,
annotations = (2, y[2], Plots.text("Pair plot")),
axis = ([], false),
leg = false,
size = (200, 100),
)
plots = []
for row = 1:rows, col = 1:cols
if row == rows && col == 1
push!(
plots,
scatter(
df[row],
df[col],
xtickfont = font(4),
ytickfont = font(4),
legend = false,
xlabel = "foo",
xguidefontsize = font(4),
ylabel = "bar",
yguidefontsize = font(4),
),
)
elseif row == rows
push!(
plots,
scatter(
df[row],
df[col],
xtickfont = font(4),
ytickfont = font(4),
legend = false,
xlabel = "foo",
xguidefontsize = font(4),
),
)
elseif col == 1
push!(
plots,
scatter(
df[row],
df[col],
xtickfont = font(4),
ytickfont = font(4),
legend = false,
ylabel = "bar",
yguidefontsize = font(4),
),
)
else
push!(
plots,
scatter(
df[row],
df[col],
xtickfont = font(4),
ytickfont = font(4),
legend = false,
),
)
end
end
plot(
title,
plot(plots..., layout = (rows, cols)),
layout = grid(2, 1, heights = [0.05, 0.95]),
)
end
pairplot(df) Which produces this image: |
MWE:
EDIT:
oh, sorry, just found out that the attribute is
(Note: Not currently implemented)
.any workaround how to add a global title to grid of sub-plots?
The text was updated successfully, but these errors were encountered: