I managed to change the xscale by modifying genplot.py directly. It works
well, and produces images that look like this:

http://sinkingsensation.com/dropbox/daywinddir2.png

But the method is ugly. I modified genplot.py, adding these lines to the
top of the _renderXAxes() function. I have a feeling I've broken all non
daily reports with this, since I'm hard coding the xinc value of xscale
(the 3rd value) to 3600 seconds, or one hour.

        # manually set the xinc of the xscale to 1 hour. Argh!
        self.xscale = list(self.xscale)               # convert the xscale
to a list so we can modify it
        self.xscale[2] = 3600                          # change the 3rd
value (the xinc) to one hour
        self.xscale = tuple(self.xscale)            # convert it back to a
tuple

Is there some better way to modify the xinc value of the xscale?




On Sun, Feb 26, 2017 at 4:02 PM, Alec Bennett <[email protected]> wrote:

> I'm trying to customize the xaxis of some of the images generated by
> ImageGenerator. I'm making much larger images than stock (800 pixels
> across), and once enlarged the X axis resolution isn't very good. It would
> make much more sense to have hourly, or bi-hourly labels, without showing
> minutes (so "11" instead of "11:00" for example).
>
> For example, here's my current daywinddir:
>
> http://sinkingsensation.com/dropbox/daywinddir.png
>
> It's important for my purposes to know at what hour the wind is changing
> direction, but I can only get a vague idea from that graph in its current
> form because of the vague X axis.
>
> I found this thread and this note:
>
>
> On Sunday, October 26, 2014 at 7:37:30 AM UTC-7, Tom Keffer wrote:
>>
>> Hello, René
>>
>> Unfortunately, as Gary indicates, the present plotting engine is not very
>> flexible. The X-axis labels are hardwired in (you said "Y", but I think you
>> meant "X").
>>
>> It is on our development roadmap to rewrite the plotting engine, but it
>> is likely to be a long time before we get to it. Maybe next spring?
>>
>> -tk
>>
>
> I'm wondering if there's been progress on this?
>
> If not, has anyone made any hacks to increase the X axis resolution? I
> don't mind modifying the .py files directly, as opposed to through the
> .config files.
>
>
>
>
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "weewx-user" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/weewx-user/C4orYTVq7S4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to