|
From: Phil E. <pel...@gm...> - 2012-07-26 08:02:46
|
Luciano got in touch offline and my suggestions worked for a certain
version of Python.
Luciano, were you trying it in python3? If not, what version of Python
was it that wasn't working for you?
Thanks,
On 24 July 2012 18:26, Luciano Fleischfresser <l_...@ya...> wrote:
> Still not working. The output looks like this:
>
> File "NotasFaltasdoisgraficos.py", line 58
> ax3.axvspan(*mdates.datestr2num(['05/18/2012', '06/30/2012']),
> facecolor='g', alpha=0.5)
>
> ^
> SyntaxError: invalid syntax
>
> When you say "...change the months to short English form" you mean in the
> data file?
> That is, Abr -> Apr, Mai -> May??? ...still did not work.
>
> ________________________________
> From: Phil Elson <pel...@gm...>
> To: Luciano Fleischfresser <lf...@ut...>
> Cc: "Mat...@li..."
> <Mat...@li...>
> Sent: Monday, July 23, 2012 5:45 PM
> Subject: Re: [Matplotlib-users] axvspan with dates on x-axis
>
> 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 <l_...@ya...> 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
>> Mat...@li...
>> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|