| 1115 | //----------------------------------------------------------------------------- |
| 1116 | |
| 1117 | void Demo_NaNValues() { |
| 1118 | IMGUI_DEMO_MARKER("Plots/NaN Values"); |
| 1119 | |
| 1120 | static bool include_nan = true; |
| 1121 | static ImPlotLineFlags flags = 0; |
| 1122 | |
| 1123 | float data1[5] = {0.0f,0.25f,0.5f,0.75f,1.0f}; |
| 1124 | float data2[5] = {0.0f,0.25f,0.5f,0.75f,1.0f}; |
| 1125 | |
| 1126 | if (include_nan) |
| 1127 | data1[2] = NAN; |
| 1128 | |
| 1129 | ImGui::Checkbox("Include NaN",&include_nan); |
| 1130 | ImGui::SameLine(); |
| 1131 | ImGui::CheckboxFlags("Skip NaN", (unsigned int*)&flags, ImPlotLineFlags_SkipNaN); |
| 1132 | |
| 1133 | if (ImPlot::BeginPlot("##NaNValues")) { |
| 1134 | ImPlot::PlotLine("line", data1, data2, 5, { |
| 1135 | ImPlotProp_Flags, flags, |
| 1136 | ImPlotProp_Marker, ImPlotMarker_Square |
| 1137 | }); |
| 1138 | ImPlot::PlotBars("bars", data1, 5); |
| 1139 | ImPlot::EndPlot(); |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | //----------------------------------------------------------------------------- |
| 1144 | |