Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 11571

Linear line with matplotlib - line graph

$
0
0

Power BI has Python visual where I can use Python code to create the visual. I am using the matplotlib and trying to create the visuals in power bi. It works fine but it is not connecting the lines as needed. Here is the code.

dataset = pandas.DataFrame(R_Length, ScatterPlot, ClusterLine, TargetLine)dataset = dataset.drop_duplicates()import matplotlib.pyplot as plt ax = plt.gca()dataset.plot(kind='scatter', x='R_Length', y='ScatterPlot', color='blue',ax=ax)dataset.plot(kind='line', x='R_Length', y='ClusterLine', color='black', linestyle='solid', fillstyle='full' ,ax=ax)dataset.plot(kind='line', x='R_Length', y='TargetLine', color='red', linestyle='-' ,ax=ax)plt.show()

The visual it created looks like this (below). Black and Red line is not connected.enter image description here

Its should look like this. Black and Red lines are connected.enter image description here

Any help is appreciated.Thanks.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>