Is it possible to add labels to contour lines?

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.

@wascott I was able to do this successfully with Paraview 5.6.0-975-g3fceb06(5.6 from download wesite), but it fails for the version Paraview 5.6.0-1074-gdcb1bac (nightly binaries given by @cory.quammen under this post) Running Paraview on SSH -X

As soon as I select contour filter after the slice,
Error: Cannot create decorator of type “NonPolyDataInputDecorator”

Screen shot:

image

Hy will you please help me how to give “%” sign there ? and in my case its showing the value all the counter line? how can i set only one time value for a contour line ?

To display the % character, in the Edit Label Properties in the Find Data tool, the Point Label Format may be described as follows

%3.0f %%

If you want to label one on the contour line, you may want to manually select one point with the selection tool.

Thanks a lot