Skip to content

x axis ticks: wrong value and collision #42

@agilly

Description

@agilly

For some inputs, the forest function adds erroneous/duplicate values. See the MRE below:

in2=data.frame(effect=-0.08, lci_effect=-0.15, uci_effect=-0.03)
input=data.frame(Exposure="analysis name", Outcome="outcome name", `Beta (95% CI), Clinical Units`="confidence interval", `custom field`="custom field", prop="prop", ` `="                                                               ", P=0.3455)
forestploter::forest(input, est = in2$effect, lower = in2$lci_effect, upper = in2$uci_effect, sizes = 1, ci_column = 6, ref_line = 0, xlab = "x axis title, quite long")

image

This produces an x axis with a duplicated -0.1 value. This becomes obvious if you uncomment the check.overlap=TRUE, line in make_xaxis, you just seee two -0.1 ticks. I think what is plotted above it is the correct "0" x coordinate of the ref_line.

This may be an entirely separate issue but I am also posting here for completeness: In some other cases (no MRE for this as I saw it only in passing), it seems the x axis is plotted twice, you can clearly see the characteristic thickened effect and slight offset of the two lines being drawn over each other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions