Resolve #184 - #218
Conversation
|
I will review it this week. Sorry for the delay. |
|
It still needs to be finished. I made the PR to show my approach. I was thinking of creating some builders to avoid cumbersome code like writing the whole |
|
I found in fn many_subplots_with_titles() {
let trace1 = Scatter::new(vec![1, 2], vec![4, 5]);
let number_of_plots = 10;
let mut plot = Plot::new();
let mut layout = Layout::new()
.grid(
LayoutGrid::new()
.rows(number_of_plots / 2)
.columns(2)
.pattern(GridPattern::Independent),
)
.height(number_of_plots * 200);
for i in 1..number_of_plots + 1 {
plot.add_trace(
trace1
.clone()
.y_axis(format!("y{}", i))
.x_axis(format!("x{}", i)),
);
layout.add_annotation(
Annotation::new()
.y_ref(format!("y{} domain", i))
.y_anchor(Anchor::Bottom)
.y(1)
.text(format!("Title {}", i))
.x_ref(format!("x{} domain", i))
.x_anchor(Anchor::Center)
.x(0.5)
.show_arrow(false),
)
}
plot.set_layout(layout);
plot.set_configuration(Configuration::new().responsive(true));
plot.show();
}However, I still think the current changes can be useful since these new changes are handling another path. But I wanted to mention it |
|
@yasuomaidana . I didn't manage to properly review your PR and I won't be in the next 2 weeks either. Will be back on it at end of August. In general, it looks good. Indeed, I would prefer if we can abstract calls like these |
|
I agree with you; I considered adding |
|
Sorry, men, I was busy, but I back on this issue, I'll work on it this week |
# Conflicts: # plotly/src/layout/mod.rs
Sorry @yasuomaidana , I was also quite busy. I will have a look at your proposal in the next 2-3 weeks. |
# Conflicts: # plotly/src/layout/mod.rs
# Conflicts: # examples/subplots/src/main.rs # plotly/src/layout/mod.rs
Here, you can see the current changes related to plotting multiple axes. The test had passed, but I had to update the examples and check the functionality.