Is it possible to add labels to contour lines?

Hello everyone!

I’m trying to make a visualization of ocean and i’m stuck at labeling contour lines.
For one frame i can add them manually via Text source.

Is there any way to do it automatically?

Expectation:


Reality:

1 Like

@danlipsa @Scott_Wittenburg Is there anything available in ParaView 5.6 or upcoming in 5.7?

Excellent question!!! Here is the feature request, that has been pushed off for a few years. https://gitlab.kitware.com/paraview/paraview/issues/15810. It comes from uservoice, here: https://paraview.uservoice.com/forums/11350-general/suggestions/1350851-create-the-ability-to-automatically-label-contour.

I’m pretty sure this will slip. There just isn’t time to get it into the spring release, and the fall release will be a smaller release, trying to get back on schedule. After that, this feature is towards the top of the queue.

2 Likes

@igor @cory.quammen yes we do have support for contour labels as it can be seen here: https://vtk.org/Wiki/VTK/Examples/Cxx/Visualization/LabelContours but it is not exposed to Paraview. @danlipsa lets plan on adding support for this in Paraview sometime soon.

1 Like

Can it be done via Python shell?
I am new to Paraview and for now I don’t know what Python shell is for :sweat_smile:

1 Like

@Aashish Chaudhary Yes, that would be great.

Anyway we could try to label the contour, as a stopgap solution for now?

@gromaxe Did you find anything helpful for adding labels to contours, asking as a fellow user trying to do the same?

Only static ones via text source

As for now I just set colorbar marks to the same values as contour lines

1 Like

A possible solution according to the old mailing list:

  1. Cut all contour lines with the slice filter.
  2. Select the points on the slice that you want to label.
  3. Turn on Find Data and show “Point Labels” with the contour variable, and if you need, set the “Point Label Format” and modify the “Point Label Font” in the advanced settings (with gear icon).

4 Likes

Thank you, will try that!

Hate to say this, but I’m being slow. Mind giving more detailed directions, using disk_out_ref.exo, so I can replicate? Thanks! Alan

Alan, I’m sorry, but don’t understand what exactly you are going to replicate. And I have no .exo files(

I’m sorry could you elaborate please, I don’t seem to understand how to select the points I want to label on the contour lines.

Everyone has access to disk_out_ref.exo. It comes with ParaView by default. File/ Open then, in the upper left corner, is Examples.

OK, after staring at it long enough, I did figure out what Kyoshimi is saying. Here are the steps to replicate what is above: Not necessarily easy or intuitive. Further, you can’t turn off the selection - but you can change the color (say to black) in the Color Palette editor.

  • ParaView 5.6.0, Linux, builtin server (will work remote server)
  • File/ Open/ Examples/ disk_out_ref.exo. All variables on. Apply.
    Now, we want to acquire a 2d surface. We will “paint” the contours on here.
  • Slice. Z-Normal. Show Plane off. Apply.
    We are going to contour by Temp, so lets paint by the same. Reset to get the slice to be a good size.
  • Paint by Temp. Reset.
    Create the contours on Temp. Notice that we want more than one contour. These will be 1d lines.
  • Contour. Contour by: Temp. Delete the current value, add range. Use 8 Steps. Check the Compute Scalars checkbox. Apply.
  • Color by Solid Color (we want white lines). Turn visibility ON for the Slice.
    Notice the stitching on the lines.
  • Click on Contour in the pipeline browser. In the properties tab, Advanced tab, Transforming, change Translation Z to 0.001.
    Now, we want to find the cells along a line, through the contour lines. We will then label these. For fun, lets make the slice at 45 degrees. Although hard to see, we are going to extract about 12 to 16 points.
  • Slice. Change Normal to 0.707, 0.707, 0.0. Apply. Turn off show plane.
  • Select Cells On. Rubber band select the whole screen. Now, all points are selected.
  • Find Data. Point Labels. Temp.
  • Be sure that visibility is ON for Slice, Contour and the second Slice.
5 Likes

I’m sorry I didn’t make it clear enough.

@wascott
I am grateful that you compensated my lack of explanation to replicate.

No problem. Thanks for giving me the idea (and remembering it was in the old mailing list.). I had never seen it done before.

1 Like

Firstly, Thank you for the wonderful explanation but I 'm not sure where to do this,

"Select Cells On.

Rubber band select the whole screen. Now, all points are selected."

Little icon, top left’ish of the 3d view. Tutorial (found from Help/ Sandia National Labs Tutorials/ Data Analysis) is here: https://www.paraview.org/Wiki/Advanced_Data_Analysis#Cell.2C_Point_and_Block_Selections

1 Like

Found it! Was able to label contours! Kudos to the person who came up with this, but we definitely need an easier way.