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

Control colormap of temporal graph nodes #72

Open
vanbanTruong opened this issue Jun 9, 2020 · 4 comments
Open

Control colormap of temporal graph nodes #72

vanbanTruong opened this issue Jun 9, 2020 · 4 comments
Projects

Comments

@vanbanTruong
Copy link

Is your feature request related to a problem? Please describe.
Would it be possible to control the color of the temporal graph nodes when using tnet.plot()? For example give an array [0, 10] then the nodes color will change from light to dark from left to light. Thanks.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@vanbanTruong
Copy link
Author

Other than the option of providing an array, current nodes' cmap transmits vertically within each time series, would it be possible to across the time dimension, i.e., horizontally, instead?

@wiheto
Copy link
Owner

wiheto commented Jun 9, 2020

As you note, the cmap value only is for vertical values.

The plotting code is due for updating (it was some of the first python code I ever wrote) and I will make sure this is added at the update.

A workaround to solve the problem at the moment: the matplotlib ax object is returned from the plotting function which you can still modify. Here is an example:

import teneto
import matplotlib.pyplot as plt
# Create network object
tnet = teneto.TemporalNetwork()  
# Generate some random data
tnet.generatenetwork('rand_binomial', prob=0.5, size=(3,4)) 
# Plot and return matplotlib axis
ax = tnet.plot('slice_plot') 
# For the 1st time point (x=0) replot all nodes as red 
ax.scatter([0,0,0], [0,1,2], s=100, color='red', zorder=100)  
plt.show()

Creates the following image for me:

slice_plot_fix

Let me know if something was unclear.

@vanbanTruong
Copy link
Author

Thanks for the prompt reply. Let me know when such additional feature has been added :)

@wiheto
Copy link
Owner

wiheto commented Jun 11, 2020 via email

@wiheto wiheto added this to To do in 0.6 Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
0.6
To do
Development

No branches or pull requests

2 participants