question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Limitation of ticks

See original GitHub issue

Hello,

I have an issue of the ticks on the x-axis, which contains 365 (366) ticks. If I download the bar chart in SVG and open in Google Chrome - There is no issue with visualisation and there are only a few ticks. However, If I open it in Affinity Designer, the ticks on x-axis are one big mess… Is there some solution about how to limit the number of ticks on axis? Thank you!

image

My (minimal) dataset is:

# Packages
import datetime
import os, sys
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.ticker as plticker
import altair as alt
from vega_datasets import data

data = {'DAY' : ['2019-05-01', '2019-05-02', '2019-05-03', '2019-05-04', '2019-05-05'],
        'RAIN' : [0.9, 0.9, 0.9, 0.9, 0.9],
        'RR_MIDDLE' : [2.80, 2.80, 2.80, 2.80, 2.80],
        'CONDITION_RR' : ['wet', 'wet', 'wet', 'wet', 'wet'],
        'CONDITION_PR' : ['dry', 'dry', 'dry', 'dry', 'dry'],
        'SEASON' : ['Intermittent_Season', 'Dry_Season', 'Intermittent_Season', 'Wet_Season', 'Intermittent_Season'],
        'MONTH' : ['Apr 2019', 'Apr 2019', 'Apr 2019', 'Apr 2019', 'Apr 2019'],
        'SEASON_NUM' : [1.0, 1.0, 1.0, 1.0, 1.0],
        'YEAR' : [2019, 2019, 2019, 2019, 2019],
        'DOY' : [121, 122, 123, 124, 125],
       }
RSDF9 = pd.DataFrame(data)
RSDF9['DAY'] =  pd.to_datetime(RSDF9['DAY'], errors='ignore')
pd.to_numeric(RSDF9['DOY'])
pd.to_numeric(RSDF9['YEAR'])

alt.renderers.enable('notebook')
alt.data_transformers.disable_max_rows()

bar2 = alt.Chart(RSDF9).mark_bar().encode(
    alt.X('DOY:O', title='day', axis=alt.Axis(tickCount=2)),
    alt.Y('year(DAY):O', title='year'),
    color='SEASON:N',
    order=alt.Order("SEASON", sort="ascending")
)
(bar2).properties(width=600).configure_axisX(labelAlign="right", labelAngle=-45, labelPadding=8)

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jakevdpcommented, Nov 24, 2019

I’m closing, because it’s been a few months without response. Let me know if you have further questions.

0reactions
jakevdpcommented, Aug 20, 2019

OK - if you can create a reproducible example that reflects the problem you’re seeing, I"m happy to try and help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Current Limitations in the Control and Spread of Ticks ... - MDPI
This paper reviews the current knowledge regarding the spread of ticks with their impact in animal health and the limitations to achieve effective...
Read more >
Review: Importance of ticks and their chemical and ... - NCBI
Feeding by large numbers of ticks causes reduction in live weight and anemia among domestic animals, while tick bites also reduce the quality...
Read more >
Current Limitations in the Control and Spread ... - ResearchGate
Ticks are well-known parasites that affect livestock productivity. This paper reviews the current knowledge regarding the spread of ticks ...
Read more >
Tick infestation on medium–large-sized mammalian hosts
Understanding how different species of hosts limit the tick population is crucial for management. In general, larger ectoparasites are ...
Read more >
The distribution limit of the common tick, Ixodes ricinus, and ...
ricinus. The present study suggests that the threshold GSL for tick establishment is about 170 days, because the median GSL from 1991 to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found