About the different Image format,pdf is dffetent

What operating system and what viewer are you using for the pdf file?
Some have problems with (vector) “anti-aliasing”, which you need to switch off / disable.

BTW. Looking at the png, I can see black dots in the middle of the red lines. I guess you would need something like this: red_histo->SetMarkerColor(kRed);