Skip to content

# Fix: error bar colors now match curve colors#45

Open
bjreisman wants to merge 1 commit intoDoseResponse:masterfrom
bjreisman:fix-errbar-colors
Open

# Fix: error bar colors now match curve colors#45
bjreisman wants to merge 1 commit intoDoseResponse:masterfrom
bjreisman:fix-errbar-colors

Conversation

@bjreisman
Copy link
Copy Markdown
Contributor

Fix error bar colors to match curve colors in plot.drc

Problem
When using plot.drc() with type = "bars", error bars are always black regardless of the col argument.

Solution
Error bars now inherit curve colors by default. Added errbar.col parameter for manual control.

library(drc)
model <- drm(DryMatter ~ Dose, Herbicide, data = S.alba, fct = LL.4())

# New default - error bars match curves
plot(model, type = "bars", col = c("red", "blue"))
image
# Old behavior - black error bars  
plot(model, type = "bars", col = c("red", "blue"), errbar.col = "black")
image

- Error bars now inherit curve colors by default when using type = 'bars'
- Add errbar.col parameter for manual control of error bar colors
- Use errbar.col = 'black' to restore previous behavior
- Updated documentation and examples"
Claude AI added a commit to hreinwald/drc that referenced this pull request Apr 8, 2026
Integrated enhancement from DoseResponse#45:
- Added errbar.col parameter to plot.drc() function
- Error bars now match curve colors by default (when errbar.col=NULL)
- Maintains backward compatibility (errbar.col="black" for old behavior)
- Updated barFct functions to accept col parameter
- Updated documentation in R/plot.drc.R and man/plot.drc.Rd
- Updated NEWS.md with new feature description

Agent-Logs-Url: https://github.com/hreinwald/drc/sessions/9afb7ff7-fdbc-426a-b8bd-82ef3c756602

Co-authored-by: hreinwald <115988583+hreinwald@users.noreply.github.com>
@hreinwald
Copy link
Copy Markdown

Thanks for this great enhancement @bjreisman. I have incorporate these changes right into the new version of the refactored drc package version 3.3.1

hreinwald added a commit to hreinwald/drc that referenced this pull request Apr 13, 2026
…esponse

Updated drc.plot function with the the feature that the error bar colors now match curve colors. This fix was suggested here: DoseResponse#45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants