Rotate axis in plot
See original GitHub issueHi @marcomusy
I’ve a plot like the following
import networkx as nx
from collections import OrderedDict
from vedo.pyplot import DirectedGraph
from vedo import *
G = nx.gnm_random_graph(n=5, m=10)
nxpos = nx.spring_layout(G, dim=3, seed=1)
nxpts = [nxpos[pt] for pt in sorted(nxpos)]
nx_lines = [(nxpts[i], nxpts[j]) for i, j in G.edges()]
pts = Points(nxpts, r=10).lighting('off')
edg = Lines(nx_lines).lw(5)
weights = [1, .30, .10, .79, .70, .60, .75, .78, .65, .90]
color = colorMap(weights, name="viridis")
edge_w = OrderedDict(zip(G.edges, weights))
nx.set_edge_attributes(G, edge_w, 'weight')
edg.cellColors(weights, cmap='viridis') #Blues_r
edg.addScalarBar3D(
title='title',
titleFont='VictorMono',
labelFont='VictorMono',
c='k',
)
edg.scalarbar.addPos(0.1, 0, 0).useBounds()
show(pts,
edg,
axes=True,
sharecam=True,
bg2="white",
at=0,
zoom=1.2,
)
And I’d like to rotate the axes - shift the z-axis in place of the x-axis e.g.
I’d like to know how this can be done so that the axes grid looks like the first plot. I looked at mesh.py
in the repo that uses RotateWXYZ
. However, I am not sure how to use it for the example mentioned above.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (9 by maintainers)
Top Results From Across the Web
Rotate axis text in python matplotlib - Stack Overflow
pyplot figure class that automatically rotates dates appropriately for you figure. You can call it after you plot your data (i.e. ax.plot(dates,ydata) :...
Read more >Rotate Tick Labels in Matplotlib - Stack Abuse
Now, let's take a look at how we can rotate the X-Axis tick labels here. There are two ways to go about it...
Read more >How to rotate a simple matplotlib Axes? - Tutorialspoint
To rotate a simple matplotlib axes, we can take the following steps −. Import the required packages −. import matplotlib.pyplot as plt ...
Read more >How to Rotate X-Axis Tick Label Text in Matplotlib?
Rotate X-Axis Tick Label Text using ax.set_xticklabels(). In this example, we will rotate X-axis labels individually by using the built-in ax.
Read more >Rotate Axis Labels of Base R Plot (3 Examples)
In this article, I'll explain how to rotate axis labels of a Base R plot in the R programming language. The content of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
…depending on the meaning of the graph is looks technically reasonable to me! 😃
if you want to rotate everything why not rotating the camera?
show(nx_pts, nx_edg, nx_pts.labels('id'), axes=True, bg='w', title='plot', roll=90)
PS; change
.addScalarBar(title='$\mu$')
to.addScalarBar(title='\mu')