textplots-rs icon indicating copy to clipboard operation
textplots-rs copied to clipboard

Top is missing in Bars

Open ahcm opened this issue 2 years ago • 6 comments

⡁                             ⡇                                                             3.0
⠄                             ⡇                                                            
⠂                             ⡇                                                            
⡁                             ⡇                                                            
⠄                             ⡇                                                            
⠂                             ⡇                                                            
⡁                             ⡇                                                            
⠄                             ⡇                                                            
⠂                             ⡇                                                            
⡁                             ⡇                                                            
⠄                             ⡏⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⡇                              
⠂                             ⡇                             ⡇                              
⡁                             ⡇                             ⡇                              
⠄                             ⡇                             ⡇                              
⠂                             ⡇                             ⡇                              
⡁                             ⡇                             ⡇                              
⠄                             ⡇                             ⡇                              
⠂                             ⡇                             ⡇                              
⡁                             ⡇                             ⡇                              
⠄                             ⡇                             ⡇                              
                              ⠁                             ⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁ 1.0
0.0                                                                                    3.0

The first bar is missing its roof.

ahcm avatar Jul 11 '21 16:07 ahcm

Thanks @ahcm! Could you provide the code you use to draw the bars?

loony-bean avatar Jul 11 '21 17:07 loony-bean

https://github.com/ahcm/hist-cli Test e.g. with:

$ echo 3 2 2 3 3 4 4 4 4 | tr ' ' '\n' | hist -t

ahcm avatar Jul 11 '21 19:07 ahcm

Also I would rather have y-axis start at 0. But I don't know how.

ahcm avatar Jul 11 '21 20:07 ahcm

@ahcm both seeing the top and having y start at 0 should now be possible with #33 merged

TDHolmes avatar Aug 28 '21 21:08 TDHolmes

With

Chart::new_with_y_range(width, height, xmin, xmax, 0.0, y_dim)

I get a fixed y-axis. How do I get a roof?

$  echo 3 2 2 3 3 4 4 4 4 | tr ' ' '\n'  | ./target/release/hist -t
⡁                                                                                 5.0
⠄
⠂
⡁
⠄                         ⢸
⠂                         ⢸
⡁                         ⢸
⠄                         ⢸
⠂                         ⢸⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⢹
⡁                         ⢸                          ⢸
⠄                         ⢸                          ⢸
⠂                         ⢸                          ⢸
⡁                         ⢸                          ⢸⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⡇
⠄                         ⢸                          ⢸                          ⡇
⠂                         ⢸                          ⢸                          ⡇
⡁                         ⢸                          ⢸                          ⡇
⠄                         ⢸                          ⢸                          ⡇
⠂                         ⢸                          ⢸                          ⡇
⡁                         ⢸                          ⢸                          ⡇
⠄                         ⢸                          ⢸                          ⡇
⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈⠈⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈⠈⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈ ⠁⠈⠁ 0.0
0.0                                                                          3.0

ahcm avatar Aug 29 '21 00:08 ahcm

See here https://github.com/loony-bean/textplots-rs/issues/43#issuecomment-1666939995

PraxTube avatar Aug 06 '23 18:08 PraxTube