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

Forcing matplotlib to prioritize plot limits over plot ticks #693

Closed
RafalSkolasinski opened this issue May 26, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@RafalSkolasinski
Copy link

In current situation when setting extents and ticks for Image the ticks position got prioritize and therefore value given to extents are ignored. For example see (image from Options tutorial).

%%opts Image (clims=(0,0.072)) [situate_axes=True colorbar=True] 

img = image.clone(extents=(-.2, -.2, .2, .2))
img(style={'cmap': 'Greens'}, plot={'xticks': [-1,0,1]})

I checked that it is indeed the matplotlib behaviour when ticks are set after limits. Please see following two examples for comparision

from matplotlib import pyplot as plt
import numpy as np
%matplotlib inline

data = np.random.rand(100, 100)
plt.imshow(data)

plt.xticks([10, 30, 50]);
plt.xlim(20, 40);

and

from matplotlib import pyplot as plt
import numpy as np
%matplotlib inline

data = np.random.rand(100, 100)
plt.imshow(data)

plt.xlim(20, 40);
plt.xticks([10, 30, 50]);

In second examples ticks are prioritized, in first one not.

I would propose to change holoviews default behaviour to process first xticks and then xlim.

@philippjfr philippjfr added this to the v1.6.2 milestone Jul 29, 2016
@jlstevens jlstevens modified the milestones: v1.7.0, v1.6.2 Aug 25, 2016
@philippjfr philippjfr self-assigned this Mar 4, 2017
@philippjfr
Copy link
Member

Fixed in #1209.

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

No branches or pull requests

3 participants