Home > Net >  matplotlib discrete bin plot
matplotlib discrete bin plot

Time:07-07

With discrete bin plot I refer to a type of plot which does not connect the points with a straight line, but uses a constant value for all the region which is closest to each point.

This is an example of this type of plot using PDL and PGPLOT.

pdl> use PDL::Graphics::PGPLOT;dev('/xs');$x=rint(grandom(20)*10);print $x;bin($x);hold;points($x,{color=>'red'})

[-19 -3 4 7 -8 -2 9 15 4 7 1 -14 -4 -4 11 6 -15 -13 2 1]Graphics on HOLD

enter image description here

This type of plot is sometimes useful.

I am interested in knowing a way to display this type of plot in matplotlib. I could not find a specific function.

Alternative ways to do it in matplotlib would also be useful as well as perhaps other packages for plotting in python. Thank you very much!

CodePudding user response:

This is called a enter image description here

  • Related