Open regmibijay opened 3 years ago
I think it should be ylim=[0, 8e-6]
. Although I'm confused on the y-axis being labeled by 1e-6
in your second plot.
I'm not able to duplicate on master; with ylim=[0, 8] or ylim=[0, 8e-6]. For the former, I get a line indecipherable from y=0
; for the latter I get the expected output:
after comment from @rhshadrach, I was successful in debugging what was happening. I was processing command line parameters with argparse and this behaviour seems to occur when the supplied xlim
and ylim
data have string elements and not int or float type. We should maybe either raise ValueError or convert passed data to int or float.
Thanks for reporting back @regmibijay - I agree and think either are a workable solution, although I personally would lean toward raising if the values are not numeric. Would you be interested in submitting a PR to implement the patch?
I am working on this issue and will address with a PR soon!
[x] I have checked that this issue has not already been reported.
[x] I have confirmed this bug exists on the latest version of pandas.
[x] (optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
I am plotting a large dataset using
dataframe.plot()
in pandas. Dataset contains data in csv format. As per documentation, I specifyxlim
andylim
as arg in df.plot. Now the axes take the xlim and ylim values accordingly but the figure does not scale to these values and plot shows some part of of graph but not the area defined by 'xlim' and 'ylim'.without xlim :
with xlim set :
sample files here: samples project: project
Expected Output
I want to plot only the specified area. In my example image it would be the spike.
Output of
pd.show_versions()