question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

labelling while using Sphere/ Spheres

See original GitHub issue

Hi @marcomusy

This is a follow up to the question posted here

Could you please explain how the labels have to be set while using Sphere/ Spheres?

For points, I do

pts = Points(nx_pts)
labs = pts.labels(list(label.values()), scale=5, font='VictorMono', c='k').addPos(0.05, 0, 0.5)

but when I try the same for Spheres (sph = Spheres(nx_pts))the following error appears

txt_lab = str(arr[i])
IndexError: list index out of range

Also, I am not sure how to set the labels for Sphere sph = [Sphere(r=radius[n]).color(color[n]).pos(pos[n]).alpha(alpha[n]) for n in nodes]

plt.show(
            pts, # or sph
            edg,
            labs)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marcomusycommented, Dec 28, 2020

ylim only applies to the vedo.pyplot.plot() shortcut. The syntax is passing to show a dictionary of options for axes. E.g.:

show(spheres, labs, axes=dict(xrange=(-5,5),
                              yrange=(-5,5),
                              zrange=(-5,5),
                             ),
     )

check all possible options: https://vedo.embl.es/content/vedo/addons.html#axes or create a custom Axes() object, see example: examples/pyplot/customIndividualAxes.py and https://github.com/marcomusy/vedo/blob/master/examples/pyplot/customAxes.py

0reactions
DeepaMahmcommented, Dec 28, 2020

Hi @marcomusy Thanks so much!

Could you please help me with setting axis limits? While plotting with Text labels for spheres, sometimes the y-axis includes the y-values for which there is no data

image

So I tried specifying the ylimits

   plt.show(
            pts,
            edg,
            labs,
            ylim=[70, 200]
)

but this doesn’t seem to work, unfortunately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Label on a spherical surface - PTC Community
Hi all, Wonder if anyone can help. I have a common situation where I need a drawing of a label (so its flat),...
Read more >
Labeling a triangulated sphere - MathOverflow
The labeling gives a piecewise linear map from Sn to a simplex Δ with n+1 vertices, where label k means the point is...
Read more >
R and RGL: how to add labels to spheres? - Stack Overflow
I use RGL to create a set of spheres linked by segments. I would like to be able to add a label to...
Read more >
How to Draw a Sphere with Labeled Shadows
Learn how to draw a sphere in this video art lesson. Learn to locate values and create smooth gradations of tone.
Read more >
Round/Elliptical Objects - Sphere - Lighting Analysts
Partially circular spheres (i.e. hemispheres) may be open or closed as necessary. Open spherical objects may be reflective on the inside or outside,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found