has2k1 / has2k1/plotnine

strange things happen when using .draw()

Open
#1,009 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
4.8k
Forks
254
Avg merge
10h 35m
Merged PRs (30d)
9

Description

I am not sure what is going on and if it is even a bug or side effekt, but .draw() does strange things:

import pandas as pd
import numpy as np
import plotnine as p9

dates = pd.date_range(start='2023-01-01', periods=10)
values = np.random.rand(10)
df = pd.DataFrame({'date': dates, 'value': values})

p=(p9.ggplot(df)
 +p9.geom_line(p9.aes(x='date',y='value'))
 
 )
p.show()

so far so good:

Image

now using:

fig=p.draw(show=False)
p.show()

Image

the behaviour is different, sometimes it hides the whole x and y axis sometimes just parts

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided pandas, NumPy, and plotnine example, comparing p.show() with p.draw(show=False) followed by p.show(). Inspect the drawing and display path that handles these two calls; done means the axes render consistently instead of hiding the whole or partial x and y axes.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, pandas, python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.