Thanks everyone for sharing your thoughts. I agree that this cannot be
simply done by controlling data - it seems that by default axis data is
assumed to be continuous, which will produce visual gaps on the chart if
actual data is not continuous. Creating separate plots and placing them
side by side with no margin would be ok for a static plot, however I am
using these dynamically, so that won't work unfortunately. Unless I am
missing something of course. By "using dynamically" I mean that I am
panning/zoomng/scrolling the data a lot, adding new data sets on the same
plot etc.

After an initial look it seems to me that it's not an Axis but the Viewbox
that controls value ranges. If I understand correctly, the AxisItem
controls presentation, not the underlying axis data. I can't say I am too
familiar with how Viewbox works yet, but it seems to be built around an
assumption that values are continuous in either linear or log fashion.
There are numerous places in Viewbox code where xrange/xlimit is used,
which suggests to me that whatever is within range/limits must be
continuous (or is assumed to be).

I will continue to look into this, any tips are welcome.

Thank you,
mks

On Tue, Aug 18, 2020 at 1:28 PM [email protected] <[email protected]>
wrote:

> Hi,
> i think the easiest is to treat them as multiple plots. You can look at
> the examples- the one called basic plotting. The multiple curves would work
> for your case.
> On Tuesday, August 18, 2020 at 9:10:53 AM UTC+2 [email protected] wrote:
>
>> I don't see how this can be accomplished solely by controlling the data.
>> I think that it would require at least some hacking with the AxisItem
>> class... and I myself would not know how...
>>
>> In any case, certainly linking the flattening workaround might be the
>> easiest.
>>
>>
>> On 8/18/20 2:45 AM, Dennis Jensen wrote:
>>
>> Yes you have full control of the data you supply to a graph of course the
>> settings to do that might be rather tricky --- as such it might just be
>> easiest to flat line it during those periods rather than try to exclude
>> them
>>
>>
>>
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
>>  Virus-free.
>> www.avast.com
>> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
>>
>> On Mon, Aug 17, 2020 at 6:50 PM mks <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> I've been wondering if it is possible to exclude subranges of datetimes,
>>> where there is no data? For example, when plotting financial data, markets
>>> are closed on weekends, so a continuous datetime axis will have gaps on
>>> Sundays and Saturdays (among other periods when there is no trading):
>>> [image: Screenshot_20200818_014602.png]
>>>
>>> Is it possible to exclude these gaps?
>>>
>>> Thanks,
>>> mks
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "pyqtgraph" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/pyqtgraph/e32a4a25-22c1-44e8-af2f-992abab6acban%40googlegroups.com
>>> <https://groups.google.com/d/msgid/pyqtgraph/e32a4a25-22c1-44e8-af2f-992abab6acban%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "pyqtgraph" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>>
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/pyqtgraph/CAJnEJx0mwN41n4nLXC9xpeP5dW_7fbmNtna0XKWxfNx8qE1ShA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/pyqtgraph/CAJnEJx0mwN41n4nLXC9xpeP5dW_7fbmNtna0XKWxfNx8qE1ShA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> --
>> +----------------------------------------------------+
>>  Carlos Pascual Izarra
>>  Scientific Software Coordinator
>>  Computing Division
>>  ALBA Synchrotron  [http://www.albasynchrotron.es]
>>  Carrer de la Llum 2-26
>>  E-08290 Cerdanyola del Valles (Barcelona), Spain
>>  E-mail: [email protected]
>>  Phone: +34 93 592 4428 <+34%20935%2092%2044%2028>
>> +----------------------------------------------------+
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "pyqtgraph" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/pyqtgraph/z2FXYJw5hck/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pyqtgraph/9c10f86e-28cf-4622-9f45-41f4ec469037n%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/9c10f86e-28cf-4622-9f45-41f4ec469037n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/CA%2B0NKEEWPEanVhUc_22oLhK%2BBNcvaY2UzRSqSQ8RnqBGqap%2B%3DA%40mail.gmail.com.

Reply via email to