ietoolkit icon indicating copy to clipboard operation
ietoolkit copied to clipboard

[iegraph] cannot adjust bar label text size

Open ybelyakova opened this issue 2 years ago • 2 comments

It appears that iegraph treatment, barlabel mlabsize(huge) and iegraph treatment, barlabel mlabsize(small) produce the same output. A fellow DIMER tested this on his computer with the same result as I, both of us are using Stata 16. Is there an issue with the way I am using the command, or an issue with the command?

ybelyakova avatar Apr 14 '22 20:04 ybelyakova

Thanks for submitting feedback. Happy to look into this!

I was able to replicate it with this code:

*Prepare data
sysuse auto, clear
set seed 961819
gen treat = runiform() < .5

*Huge labels
regress price treat
iegraph treat , barlabel mlabsize(huge)
graph rename huge, replace

*Small labels
regress price treat
iegraph treat , barlabel mlabsize(small)
graph rename small, replace

*Combine graphs
graph combine huge small

This generates this graph where the labels are indeed identical.

image

I will look into this and get back.

kbjarkefur avatar Apr 15 '22 09:04 kbjarkefur

This has now been fixed in f26962f34bfcadec9a8bad04a16b315a20571148.

We typically do not make a release immediately for a minor bug if we know we have a big release coming up (which we do not). We only classify bugs that do risk generating incorrect results as major. However, we can make a minor quick release if you intend to use this command extensively. Let us know.

If you do not need these commands extensively then you can temporarily load this version of the command in your code. See the code snippet below. Once the new version of the command is released this temporary loading of the command should be removed.

* Load the fixed version of the command directly from GitHub
local path "C:\Users\username\Downloads\iegraph" //this can be any folder on your computer
local url  "https://raw.githubusercontent.com/worldbank/ietoolkit/develop/src/ado_files/iegraph.ado"
copy       "`url'" "`path'/iegraph.ado", replace text
qui do     "`path'/iegraph.ado"

*Prepare data
sysuse auto, clear
set seed 961819
gen treat = runiform() < .5

*Huge labels
regress price treat
iegraph treat , barlabel mlabsize(huge)
graph rename huge, replace

*Small labels
regress price treat
iegraph treat , barlabel mlabsize(small)
graph rename small, replace

*Combine graphs
graph combine huge small

This code generates this graph: image

kbjarkefur avatar Apr 19 '22 09:04 kbjarkefur