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

TriSurface Plot Z-Axis Modifications #2964

Closed
jaredmoore opened this issue Aug 29, 2018 · 5 comments
Closed

TriSurface Plot Z-Axis Modifications #2964

jaredmoore opened this issue Aug 29, 2018 · 5 comments

Comments

@jaredmoore
Copy link

When working with the TriSurface plot, I cannot change the tick fontsize of the z-axis. In the code below, I can create a TriSurface plot and modify the size of the x and y labels. The ticks option changes the font size of the x and y axes, but not the z axis. It would be nice to have ticks apply to all three axes for the plot. It also appears there is currently not a way to change the ticksize of the z axis through an option similar to zticks as it doesn't currently exist.

surface = hv.TriSurface(zip(x.flat,y.flat,z.flat), label="Treatment 43")\
    .options(yticks=[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, 'Tiebreak')], \
             show_grid=False, shade=True, fontsize=dict(ticks=45, xlabel=35, ylabel=35),\
            fig_size=1000, azimuth=45, elevation=10)\
    .redim.label(x='Generation', y='Evaluation Depth', z='Number of Inds')
@ahuang11
Copy link
Collaborator

If you need this plot now, you could get a matplotlib figure object and adjust it natively.

import numpy as np
import holoviews as hv
hv.extension('matplotlib')
u = np.linspace(0, 2*np.pi, 24)
v = np.linspace(-1, 1, 8)
u, v = np.meshgrid(u, v)
u = u.flatten()
v = v.flatten()

# evaluate the parameterization at the flattened u and v
tp = 1+0.5*v*np.cos(u/2.)
x = tp*np.cos(u)
y = tp*np.sin(u)
z = 0.5*v*np.sin(u/2.)

surface = hv.TriSurface((x, y, z), label='Moebius band')
surface = surface.options(fontsize=dict(ticks=45, xlabel=35, ylabel=35),\
            fig_size=500, azimuth=45, elevation=10)
fig = hv.renderer('matplotlib').get_plot(surface).state
ax = fig.axes[0]
ax.tick_params(axis='z', labelsize=35)
fig

image

@jaredmoore
Copy link
Author

@ahuang11 Thanks for the suggestion! I will give that a try for now. Hopefully we can increase the support for future in Holoviews as well.

@ahuang11
Copy link
Collaborator

Merged

@philippjfr
Copy link
Member

We'll try to get a new 1.11 dev release out later today, so you can try it out.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants