Looks like your very close.
I needed to change the months to short English form, change the line
ax3.grid('True') to ax3.grid(True)
and add the line
ax3.axvspan(*mdates.datestr2num(['05/18/2012', '06/30/2012']),
facecolor='g', alpha=0.5)
To get the box on the lower plot.
Hope that helps,
On 23 July 2012 20:42, Luciano Fleischfresser <[email protected]> wrote:
> I want to place a colored vertical range on my plot and came across the
> following example:
>
> http://stackoverflow.com/questions/8270981/in-a-matplotlib-plot-can-i-highlight-specific-x-value-ranges/8271438#8271438
>
> It shows what I am trying to do using axvspan.
> However, I was not able to reproduce the second plot with dates.
> Errors like 'invalid syntax' for color='red' and others prevented me from
> reproducing the plot.
> The demo from Matplotlib gallery worked fine for me. My plot also has dates
> on the x-axis.
>
> I am attaching code and data file. Hope someone can point me in the right
> direction.
>
> L Fleischfresser
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users