[Matplotlib-users] Totaly new to matplotlib
stm6386 at gmail.com
Thu Feb 4 13:18:14 EST 2016
Sorry for the delay, I had trouble getting the original post accepted .... I
replied on the 29th of Jan.
Since the previous post I have found some code that almost does what I
wanted but as always when you get a little more of something you lost it
what I have now is displaying -
the code to create the graph is -
def plot_durations(self,starts, stops, ax=None, **kwargs):
if ax is None:
ax = plt.gca()
# Make the default alignment center, unless specified otherwise
kwargs['align'] = kwargs.get('align', 'center')
# Convert things to matplotlib's internal date format...
starts, stops = mpl.dates.date2num(starts),
# Break things into start days and start times
start_times = starts % 1
start_days = starts - start_times
durations = stops - starts
start_times += int(starts) # So that we have a valid date...
# Plot the bars
artist = ax.bar(start_days, durations, bottom=start_times, **kwargs)
# Tell matplotlib to treat the axes as dates...
Issues or things id like to or am trying to change :-
The code is the same for both graphs but one shows times for the x axis and
not date (must be due to the data range) id like it to show only dates on
the x axis but also every date, not missing any .. as the previous version
I would like the y axis to display time am at the top pm at the bottom as
the previous version did.
there are a few other things but one step at a time I guess, I have tried to
copy lines from the older version to the new one but without success.
View this message in context: http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682p46712.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
More information about the Matplotlib-users