emilk / emilk/egui_plot

Horizontally adjacent plots separated by larger margin in v0.23.0

Open
#13 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
468
Forks
108
Avg merge
15m
Merged PRs (30d)
3

Description

**Describe the bug**
When switching from `egui::plot` (v0.22.0) to `egui_plot` (v0.23.0), horizontally adjacent plots are now separated by an awkwardly large margin.

**To Reproduce**

This is an attempt to produce a MRE from my own code, it might be further reducible. For v0.23.0, replace `egui::plot` with `egui_plot`

```rust
use eframe::egui::{self};
use egui::plot::{Line, Plot, PlotPoints};

fn main() {
let _ = eframe::run_native("", Default::default(), Box::new(|_cc| Box::new(Foo)));
}
struct Foo;

impl eframe::App for Foo {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| {
const SIZE: f32 = 200.0;

let v = vec![[0.0, 0.0], [1.0, 1.0]];

ui.horizontal(|ui| {
Plot::new(0).height(SIZE).width(SIZE).show(ui, |ui| {
ui.line(Line::new(PlotPoints::from(v.clone())));
});
Plot::new(1).height(SIZE).width(SIZE).show(ui, |ui| {
ui.line(Line::new(PlotPoints::from(v)));
});
});
});
}
}
```

**Expected behavior**

Probably the old behavior from v0.22.0?

**Screenshots**

v0.22.0

![Capture1](https://github.com/emilk/egui/assets/41444142/c2d77682-3992-4a14-91a1-d20ff9dec797)

v0.23.0

![Capture2](https://github.com/emilk/egui/assets/41444142/3be9225b-af45-4615-8553-7b78e277ecb3)

**Desktop (please complete the following information):**
- OS: Windows 10
- Browser: Chrome
- Version: v0.23.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.