Skip to content

Commit

Permalink
fix (plots): set_axis_ticks can be used on secondary Y axes #2253
Browse files Browse the repository at this point in the history
  • Loading branch information
v-ein authored and hoffstadt committed Jan 19, 2024
1 parent c9d6a91 commit 8fcf0cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/mvPlotting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,15 @@ DearPyGui::draw_plot(ImDrawList* drawlist, mvAppItem& item, mvPlotConfig& config
if (axis->info.location == 0)
ImPlot::SetNextPlotTicksX(axis->configData.labelLocations.data(), (int)axis->configData.labels.size(), axis->configData.clabels.data());
else
ImPlot::SetNextPlotTicksY(axis->configData.labelLocations.data(), (int)axis->configData.labels.size(), axis->configData.clabels.data());
{
ImPlotYAxis axis_id = ImPlotYAxis_1;
switch (axis->info.location)
{
case(2): axis_id = ImPlotYAxis_2; break;
case(3): axis_id = ImPlotYAxis_3; break;
}
ImPlot::SetNextPlotTicksY(axis->configData.labelLocations.data(), (int)axis->configData.labels.size(), axis->configData.clabels.data(), false, axis_id);
}
}
}
else
Expand Down

0 comments on commit 8fcf0cd

Please sign in to comment.