1

I use jupyter notebook/lab. Ubuntu 16.04, I used to be on Windows 10 as of yesterday. I checked out my git as per usual and plot a graph. I get different graphs from when I ran on windows 10.

I load a csv:

data = pd.read_csv(DATA_FILE, engine='python')

and I plot the columns I want:

for group in groups:
    pyplot.subplot(len(groups), 1, i )
    pyplot.plot(date, values[:, group])
    pyplot.title(dataset.columns[group], y=0.5, loc='right')

pyplot.tight_layout()
i += 1

pyplot.show()

And the graphs differ!

Windows 10:

enter image description here

Ubuntu Linux 16.04:

enter image description here

Its exactly the same information. What am I missing? is this matplotlib or pandas read_csv?

Please be gentle, I am happy to edit the post if its not formatted correctly.

ashley
  • 1,535
  • 1
  • 14
  • 19
  • 2
    First of all, matplotlib is platform independent. So if you see something differing between operating systems, it's sure not the OS itself that is responsible. Instead, you may have different versions of python or of the involved libraries installed. My suspicion is that on your windows system you run matplotlib 2.1 and on your linux you run matplotlib 2.2. In any case, both plots in principle show the same unexpected behaviour, namely that the axis is completely strangely labeled. Once you solve this issue, the difference between the plots should be gone. – ImportanceOfBeingErnest Jul 16 '18 at 18:48
  • @ImportanceOfBeingErnest not worried about the label - that's a scaling issue. they are dates that are at flipped 90deg - I zoom in they are fine. Either way I care only about sorting it out for linux. I will look at the version thing thanks. – ashley Jul 16 '18 at 18:50
  • No, it's not a scaling issue. It's that you are plotting strings, which you shouln't. See duplicate. – ImportanceOfBeingErnest Jul 16 '18 at 18:52
  • aaah I got it.. Its because I reindexed by date. So yes you are spot on. And this is because of the versions between windows and linux. Interesting. – ashley Jul 16 '18 at 18:57

0 Answers0