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

Location of the dashed box to move the subplot is shifted from the original subplots #66

Open
shizkaz opened this issue Jan 31, 2024 · 2 comments

Comments

@shizkaz
Copy link

shizkaz commented Jan 31, 2024

Dear rgerum,

First of all, I really appreciate your code, pylustrator, which is really helpful to make figures, especially for academic quality publication.
Although the module is really nice, but I found small bug as attached,
where location of the dashed box to move the subplot is shifted from the original subplots.
In this case, I clicked the left figure but the box is shifted and its size is also different from the original size.
My environment is
OS: Mac OSX 14.3 (Sonoma)
Python 3.11.7 (with matplotlib==3.6.2), which is installed by pip
or
Python 3.11.5 (with matplotlib==3.8.0), which is installed by conda
Both cases were failed.

Again thank you for your nice app,
shiz
スクリーンショット 2024-01-31 13 49 44

@rgerum
Copy link
Owner

rgerum commented Feb 1, 2024

could you give me a minimal example of how to reproduce the bug? E.g. some code that opens the figure with this problem.
Sometimes something like this occurs when you have something selected and resize the window but it should disappear when you change the selection. But maybe something with your figure transformations is off and then it might depend on particularities of your figure, hence the minimal example might help me find the problem.

@shizkaz
Copy link
Author

shizkaz commented Feb 7, 2024

Thank you for your response.
The above bug can be reproduced with your example code, i.e. as follows.
The attached is the screen shot with this code.
スクリーンショット 2024-02-07 11 45 53


# import matplotlib and numpy as usual
import matplotlib.pyplot as plt
import numpy as np

# now import pylustrator
import pylustrator

# activate pylustrator
pylustrator.start()

# build plots as you normally would
np.random.seed(1)
t = np.arange(0.0, 2, 0.001)
y = 2 * np.sin(np.pi * t)
a, b = np.random.normal(loc=(5., 3.), scale=(2., 4.), size=(100,2)).T
b += a

plt.figure(1)
plt.subplot(131)
plt.plot(t, y)

plt.subplot(132)
plt.plot(a, b, "o")

plt.subplot(133)
plt.bar(0, np.mean(a))
plt.bar(1, np.mean(b))
plt.show()

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

No branches or pull requests

2 participants