Skip to content
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

I want to know how to use the plot drawing series. #2480

Open
nehonpa opened this issue Mar 3, 2025 · 1 comment
Open

I want to know how to use the plot drawing series. #2480

nehonpa opened this issue Mar 3, 2025 · 1 comment
Labels
state: pending not addressed yet type: bug bug

Comments

@nehonpa
Copy link

nehonpa commented Mar 3, 2025

Version of Dear PyGui

Version:11.1
Operating Windows 11

My Issue/Question

I want to know how to use the plot drawing series.
The document only mentions ordinary coordinate graphs, and I have no idea how to use the other legend styles.

add_plot_legend
add_bar_series
add_bar_series,
add_2d_histogram_series,
add_area_series,
add_bar_series,
add_bar_series,
add_candle_series,
add_custom_series,
add_error_series,
add_heat_series,
add_histogram_series,
add_hline_series,
add_image_series,
add_line_series,
add_pie_series,
add_scatter_series,
add_series_value,
add_shade_series,
add_stair_series,
add_stem_series,
add_vline_series,
custom_series,
These methods are completely unused. Can you tell me?

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots/Video

XXX (you can drag files here)

Standalone, minimal, complete and verifiable example

# Here's some code anyone can copy and paste to reproduce your issue
import dearpygui.dearpygui as dpg
from math import sin

dpg.create_context()

# creating data
sindatax = []
sindatay = []
for i in range(0, 500):
    sindatax.append(i / 1000)
    sindatay.append(0.5 + 0.5 * sin(50 * i / 1000))

with dpg.window(label="Tutorial"):
    # create plot
    with dpg.plot(label="Line Series", height=400, width=400):
        # optionally create legend
        dpg.add_bar_series(dpg.mvXAxis,dpg.mvYAxis)
        
        # REQUIRED: create x and y axes
        dpg.add_plot_axis(dpg.mvXAxis, label="x")
        dpg.add_plot_axis(dpg.mvYAxis, label="y", tag="y_axis")

        # series belong to a y axis
        dpg.add_line_series(sindatax, sindatay, label="0.5 + 0.5 * sin(x)", parent="y_axis")

dpg.create_viewport(title='Custom Title', width=800, height=600)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
@nehonpa nehonpa added state: pending not addressed yet type: bug bug labels Mar 3, 2025
@v-ein
Copy link
Contributor

v-ein commented Mar 3, 2025

Take a look at demo.py, I believe it shows how to use all of them. And here's how to run it (it's mentioned in the Readme at the project home page):

https://github.com/hoffstadt/DearPyGui/tree/master?tab=readme-ov-file#demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet type: bug bug
Projects
None yet
Development

No branches or pull requests

2 participants