Skip to content

Using ylim() with subplots does not properly redraw #7

Description

@Modiug

Versions:
Runtime: 0.41.0
Python: 1.11.0

The following script illustrates the issue. You will see double drawings in the second subplot.

import gr
from gr.pygr import mlab

import numpy as np

x = np.linspace(-4, 4, 100)

mlab.figure()

mlab.subplot(2,1,1)
mlab.plot(x, np.sin(x))
mlab.ylim(-2, 2)

mlab.subplot(2,1,2)
mlab.plot(x, np.cos(x) + 1)
mlab.ylim(-4, 4)

The example is using the Python wrapper, but I guess this is more an issue of the underlying framework.

Well, by looking at the Python wrapper code I got aware that I could also pass ylim=(...) to the plot command directly. That solves my issue, so no high urgency on this one.

Regards
Guido

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions