hoffstadt / hoffstadt/DearPyGui

The plot line is not visible at the maximum and minimum y-values

Open
#2,506 2 comments 0 reactions 0 assignees View on GitHub
state: pending type: bug
Dominant language
C++
Stars
15.6k
Forks
783
PR merge metrics
No merged PRs in 30d

Description

## Version of Dear PyGui

Version: 2.0.0
Python: 3.12.9
Operating System: Windows 11

## Issue

The plot line is not visible at the maximum and minimum y-values

![Image](https://github.com/user-attachments/assets/e5a6682e-1b0c-4325-88f8-cae87d802bf7)

```python
import dearpygui.dearpygui as dpg

dpg.create_context()
dpg.create_viewport(title="Simple DearPyGUI Plot", width=600, height=400)

x_data = [0, 1, 2, 3, 4, 5]
y_data = [0, 0, 0, 1, 1, 1]

with dpg.window(label="Plot Example", width=580, height=380):
with dpg.plot(label="Line Plot", height=-1, width=-1):
dpg.add_plot_axis(dpg.mvXAxis, label="X Axis")
y_axis = dpg.add_plot_axis(dpg.mvYAxis, label="Y Axis", tag='yax')
dpg.add_line_series(x_data, y_data, label="Line Series", parent=y_axis)

dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
```

## Expected behavior

![Image](https://github.com/user-attachments/assets/cc784d78-f2fe-437e-a442-3eb068ba03f1)

using workaround
```python
if rng := max(y_data)-min(y_data) > 0:
dpg.set_axis_limits('yax', min(y_data)-0.1*rng, max(y_data)+0.1*rng)
```

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.