mirror of
https://github.com/gwm17/implot.git
synced 2024-11-23 02:38:53 -05:00
rename plotting functions, add PlotScatter
This commit is contained in:
parent
b783185acc
commit
c4e9d64600
|
@ -854,7 +854,9 @@ bool BeginPlot(const char* title, const char* x_label, const char* y_label, cons
|
|||
// BB AND HOVER -----------------------------------------------------------
|
||||
|
||||
// frame
|
||||
const ImVec2 frame_size = ImGui::CalcItemSize(size, 100, 100);
|
||||
const float default_w = ImGui::CalcItemWidth();
|
||||
const float default_h = default_w * 0.75f;
|
||||
const ImVec2 frame_size = ImGui::CalcItemSize(size, default_w, default_w);
|
||||
gp.BB_Frame = ImRect(Window->DC.CursorPos, Window->DC.CursorPos + frame_size);
|
||||
ImGui::ItemSize(gp.BB_Frame);
|
||||
if (!ImGui::ItemAdd(gp.BB_Frame, 0, &gp.BB_Frame)) {
|
||||
|
|
|
@ -152,7 +152,7 @@ void ShowDemoWindow(bool* p_open) {
|
|||
xs2[i] = i * 0.1f;
|
||||
ys2[i] = xs2[i] * xs2[i];
|
||||
}
|
||||
if (ImPlot::BeginPlot("Line Plot", "x", "f(x)", ImVec2(-1,300))) {
|
||||
if (ImPlot::BeginPlot("Line Plot", "x", "f(x)", ImVec2(0,0))) {
|
||||
ImPlot::PlotLine("sin(50*x)", xs1, ys1, 1001);
|
||||
ImPlot::PushStyleVar(ImPlotStyleVar_Marker, ImPlotMarker_Circle);
|
||||
ImPlot::PlotLine("x^2", xs2, ys2, 11);
|
||||
|
|
Loading…
Reference in New Issue
Block a user