Home > Mobile >  Matplotlib - How to make line plots jump directly to data point
Matplotlib - How to make line plots jump directly to data point

Time:07-14

I have a set of data that I am using to make a line plot on matplotlib. Is it possible to make the data directly jump to the data points, instead of having a positive/negative slope?

Below is an example of the plot.

enter image description here

Blue is what is automatically generated with the set of data, and red is what I want it to look like. I plotted this manually with a for loop and with plt.plot with just two coordinates. Is there a quicker way that doesn't involve manually doing it, and a built-in function for this?

CodePudding user response:

You can use a enter image description here

  • Related