Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Resolve #184 #218

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

Closed
yasuomaidana wants to merge 22 commits into plotly:main from yasuomaidana:multiples-axis
Closed

Resolve #184 #218

yasuomaidana wants to merge 22 commits into plotly:main from yasuomaidana:multiples-axis

Conversation

Copy link

@yasuomaidana yasuomaidana commented Aug 2, 2024

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.

Copy link
Collaborator

I will review it this week. Sorry for the delay.

Copy link
Author

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 Vec[Some(Box....)]. We could generate a builder from one item and another to make the axis from a vector, but I don't know what you think.

Copy link
Author

I found in examples/subplots/src/main.rs that we can generate more than 9 axis plotting by using this example:

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

Copy link
Collaborator

@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 Vec[Some(Box....) behind a cleaner API. Or if we could avoid using Box altogether we will have shorter calling sequences.

Copy link
Author

I agree with you; I considered adding add_[AXIS]_axis to the append axis instead of using a building. I already did the builder, but after reading your feedback, I noticed that that solution is not contained in the API so that it will be more verbose.

Copy link
Author

Sorry, men, I was busy, but I back on this issue, I'll work on it this week

andrei-ng reacted with thumbs up emoji

Copy link
Collaborator

Sorry, men, I was busy, but I back on this issue, I'll work on it this week

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
@andrei-ng andrei-ng marked this pull request as draft August 25, 2025 20:06
# Conflicts:
#	examples/subplots/src/main.rs
#	plotly/src/layout/mod.rs
@yasuomaidana yasuomaidana closed this by deleting the head repository Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@andrei-ng andrei-ng Awaiting requested review from andrei-ng

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /