Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Altair plot is cut off at top #2441

Closed
Make42 opened this issue Mar 31, 2021 · 2 comments
Closed

Altair plot is cut off at top #2441

Make42 opened this issue Mar 31, 2021 · 2 comments
Labels

Comments

@Make42
Copy link

Make42 commented Mar 31, 2021

I am using the code

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

alt.Chart(res_fake).mark_circle(size=50).encode(
    x='gwp',
    y='eval_val',
    fill='wF',
    row='eval_name',
    column='name'
).properties(
   height=150, width=500
).resolve_scale(
    x='independent',
    y='independent'
)

to produce an altair image, the top panels are cut off. I am not able to scroll up:

enter image description here

When I zoom out (by a lot) all my facet panels are displayed. However, they are not displayed if I scroll. Why not?

I am using this (fake) data - here in a CSV-format:

eval_val,eval_name,gwp,wF,name
0.8018070414818939,-8239627666060592049,0.47145738473041443,M,f
0.7367232615321743,-8239627666060592049,0.22562470294190218,M,R
0.3938556306116078,-8239627666060592049,0.6665142486455571,m,R
0.07517139370864345,-8239627666060592049,0.23541819961894073,K,R
0.7052544914470192,-8239627666060592049,0.07651898340607788,K,f
0.9719802737558002,-8239627666060592049,0.40057271724096677,m,f
0.026758387962984354,-8239627666060592049,0.25399750661742926,T,R
0.06337476779609952,-8239627666060592049,0.3317841738148253,T,f
0.015755734764964502,-559632761220026298,0.41690734221812065,M,f
0.3000005699109288,-559632761220026298,0.06548917115095132,M,R
0.06398444608204723,-559632761220026298,0.15647758223365626,m,R
0.7428717972324411,-559632761220026298,0.028970289817533024,K,R
0.3688361341046422,-559632761220026298,0.8429619832472521,K,f
0.22083517276744413,-559632761220026298,0.34493768436066663,m,f
0.7938672174156153,-559632761220026298,0.015461058999543753,T,R
0.3020704695833929,-559632761220026298,0.6271773890232436,T,f
0.28491021185991383,1700818862982138616,0.31948620826629126,M,f
0.9402258466900844,1700818862982138616,0.4255614556148788,M,R
0.34890903629758097,1700818862982138616,0.3033429891594078,m,R
0.7076907044980314,1700818862982138616,0.14286501716147415,K,R
0.241852357191505,1700818862982138616,0.9252612435609489,K,f
0.29074517745380646,1700818862982138616,0.8562189096306039,m,f
0.44515848147431714,1700818862982138616,0.008055175465267128,T,R
0.21210213567967906,1700818862982138616,0.9960407579598495,T,f
0.49388328568236384,-6477347714658111910,0.557857415711619,M,f
0.21408538713134517,-6477347714658111910,0.21550271622415207,M,R
0.8881240997258868,-6477347714658111910,0.2106168112428638,m,R
0.910525281992466,-6477347714658111910,0.5967880862034386,K,R
0.6449496538698186,-6477347714658111910,0.37574425178429716,K,f
0.6413581952325688,-6477347714658111910,0.6795782238874866,m,f
0.3149381707769431,-6477347714658111910,0.9357944968565332,T,R
0.5485012611360953,-6477347714658111910,0.5421851794738894,T,f
0.47859217539193566,4069926770395472028,0.5079279503567289,M,f
0.2897004075210511,4069926770395472028,0.22602691228798466,M,R
0.30208237096499535,4069926770395472028,0.5805765158273514,m,R
0.2070846191228325,4069926770395472028,0.4589858780270598,K,R
0.3003857228260971,4069926770395472028,0.8307841270779706,K,f
0.22050824333910168,4069926770395472028,0.5006045612261167,m,f
0.5280121592116018,4069926770395472028,0.7190011910843657,T,R
0.9647569114264541,4069926770395472028,0.17512431624018565,T,f
0.9710075545877016,-8628858432231373027,0.2233139382261855,M,f
0.9514213384780086,-8628858432231373027,0.22305028452966968,M,R
0.8667831273522613,-8628858432231373027,0.6593069490547764,m,R
0.9343584158854514,-8628858432231373027,0.8860114964632293,K,R
0.8373414354082518,-8628858432231373027,0.03898492382365992,K,f
0.6549234133804548,-8628858432231373027,0.09012854667334746,m,f
0.7676053537075722,-8628858432231373027,0.23339262930994742,T,R
0.5058549696584528,-8628858432231373027,0.8371824262071537,T,f
0.8087398291174301,5920082728593464157,0.30114579417613674,M,f
0.07763272301227009,5920082728593464157,0.19508928747610732,M,R
0.5305489020529206,5920082728593464157,0.20458772063848718,m,R
0.4751656195711609,5920082728593464157,0.34711759265923803,K,R
0.44456128686023577,5920082728593464157,0.26485024392828493,K,f
0.831568434105014,5920082728593464157,0.2105262112541222,m,f
0.8717662568962934,5920082728593464157,0.0449936613292683,T,R
0.9220374278291483,5920082728593464157,0.18158403908008025,T,f
0.5230959033443936,-3572783456420383499,0.23828093458210464,M,f
0.36627872677068996,-3572783456420383499,0.3920382355826758,M,R
0.3745126519858636,-3572783456420383499,0.14336290614885638,m,R
0.2527394576590427,-3572783456420383499,0.31908401653987173,K,R
0.7564817996870457,-3572783456420383499,0.07396980552198285,K,f
0.030404057812821517,-3572783456420383499,0.4524769464814984,m,f
0.13903400047072556,-3572783456420383499,0.6887373007309381,T,R
0.3170765378016275,-3572783456420383499,0.4279899949642382,T,f
0.6046566365281667,-8512446642115702610,0.23401551554028766,M,f
0.7755285766694002,-8512446642115702610,0.043637167376038954,M,R
0.6785706952141253,-8512446642115702610,0.3096961424214053,m,R
0.8540282092170921,-8512446642115702610,0.05353808738282939,K,R
0.0004338228275557743,-8512446642115702610,0.4080448648052145,K,f
0.00633265010576578,-8512446642115702610,0.04877479334726853,m,f
0.3510589264867636,-8512446642115702610,0.8003649055855244,T,R
0.5736996331993465,-8512446642115702610,0.3512180475740425,T,f
0.9575875831732106,-1521238857432044020,0.31980168808367804,M,f
0.08929009064366555,-1521238857432044020,0.425530625278403,M,R
0.722656499017316,-1521238857432044020,0.9423949995494046,m,R
0.03428888397144281,-1521238857432044020,0.7937694940226406,K,R
0.006182912262933327,-1521238857432044020,0.4630168353584919,K,f
0.7939945164577773,-1521238857432044020,0.380462460715454,m,f
0.24880486658377232,-1521238857432044020,0.23101096635623852,T,R
0.8725519214887459,-1521238857432044020,0.908249282858777,T,f
0.728766743950487,9192879028953115584,0.22448711975102775,M,f
0.8481191714449537,9192879028953115584,0.5629447669001315,M,R
0.0728846461004814,9192879028953115584,0.5399270530508733,m,R
0.6362348602494637,9192879028953115584,0.33488156106569644,K,R
0.018939130583278785,9192879028953115584,0.20992375797835872,K,f
0.4123382282421949,9192879028953115584,0.7566235161660171,m,f
0.8341576814877727,9192879028953115584,0.5516962620282976,T,R
0.1679253108831914,9192879028953115584,0.14230366082337664,T,f
0.05922932153436444,9194802079104312354,0.8563940046489156,M,f
0.8579448379155671,9194802079104312354,0.4707432539936841,M,R
0.7636656525861916,9194802079104312354,0.7750913800759516,m,R
0.559101707195229,9194802079104312354,0.34631383996789034,K,R
0.9314119220000752,9194802079104312354,0.768584718991535,K,f
0.9322348897302901,9194802079104312354,0.17149145223322426,m,f
0.6501039108328825,9194802079104312354,0.1634841006522736,T,R
0.09134108855649348,9194802079104312354,0.24210144949747958,T,f
0.25151400150335435,2860116794196427213,0.13940373514661708,M,f
0.3788954010389003,2860116794196427213,0.13389085392350142,M,R
0.6474924625410227,2860116794196427213,0.47597753787292296,m,R
0.9724329250481943,2860116794196427213,0.6994051164660883,K,R
0.4839164736247935,2860116794196427213,0.4055799090375731,K,f
0.8854714569612795,2860116794196427213,0.06837375159324854,m,f
0.6319575154359726,2860116794196427213,0.028486400107122445,T,R
0.04524561222576484,2860116794196427213,0.7497791383427207,T,f
0.07033839157392696,-8708856447242747197,0.6354127844658325,M,f
0.6516636085600679,-8708856447242747197,0.015662374828279813,M,R
0.7227062667003826,-8708856447242747197,0.8219383751794241,m,R
0.4117873263220111,-8708856447242747197,0.18358635861961103,K,R
0.5229230424035316,-8708856447242747197,0.9790475194507113,K,f
0.07825288591332669,-8708856447242747197,0.4021323029657268,m,f
0.3928647588144507,-8708856447242747197,0.3186248197296737,T,R
0.8110572905331423,-8708856447242747197,0.9561175918421408,T,f

I am using the Brave browser here (which is based on Chrome) on Linux Kubuntu 20.04 - but I am not sure whether that is relevant. I tried also Chrome. In both cases I do not use addons.

I am using the altair viewer with alt.renderers.enable('altair_viewer') and then just press enter for the chart object. I guess this is basically show? I am not necessarily using Jupyter - mostly using PyCharm - that is why I am using the altair viewer.

The issue could be reproduced: https://stackoverflow.com/questions/66862238/altair-plot-is-cut-off-at-top?noredirect=1#comment118249240_66862238

@Make42 Make42 added the bug label Mar 31, 2021
@joelostblom
Copy link
Contributor

To add, I could reproduce this in Firefox and Chromium using .show() or .serve() from JupyterLab. Saving the chart to an HTML file and open the HTML file in the browser it works fine as does viewing the vegaspec in the vegaeditor or the chart in a jupyter notebook.

@joelostblom
Copy link
Contributor

This has been fixed in #3379

Since Altair 5.3, the functionality of Altair Viewer is now available in Altair via the vl-convert package instead. See the docs on how to use the browser renderer to display charts via .show(), and the PR #3379 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants