Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to adjust the spacing between two series of the same plot

To build this curve I do the following :

MyPlot.plot(MyMatrix[MyMatrix["Date"]<=today]['Date'],MyMatrix[MyMatrix["Date"]<=today]['Y'], color="red")
MyPlot.plot(MyMatrix[MyMatrix["Date"]>=today]['Date'],MyMatrix[MyMatrix["Date"]>=today]['Y'], color="blue")

Does a way exist to not have a blank space between it ?

What I do Have :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

What I Would Like to have :

enter image description here

>Solution :

This is my idea: adding to the blue line the last element of the red line:

#take the maximum x value for MyMatrix["Date"]<=todaythe red line
last_x =max(MyMatrix[MyMatrix["Date"]<=today]['Date'])

#plot starting from the last "red" sample
MyPlot.plot(MyMatrix[MyMatrix["Date"]>=last_x]['Date'], 
             MyMatrix[MyMatrix["Date"]>=last_x]['Y'], color="blue")

Edited

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading