Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings
gempy-project

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Issue with Chinese Characters in CSV File Not Displaying in 3D Visualization in GemPy#980

Closed AnsweredbyNilsChudalla
fivetaibin asked this question inQ&A
Discussion options

Hello GemPy team,

I am encountering an issue when using Chinese characters in the formation field of my CSV file. When I set the value of formation to Chinese characters, the 3D model generated by GemPy does not display the corresponding structural elements correctly (i.e., the value of geo_model.structural_frame.structural_elements[0].name). It seems that GemPy only supports English characters for this field.

Could you please help me understand why this is happening? Is there a way to resolve this issue so that Chinese characters can be displayed properly in the 3D visualization?

For your reference, here are the details:
20250117164035

import pandas as pd

import gempy as gp
import gempy_viewer as gpv
import time

start_time = time.time()
print(gp.file)
print(gp.file)

data_path_points = 'D:/gitLab/underground/static/inputfiles/getstarted1/simple_fault_model_points.csv'
data_path_orientations = 'D:/gitLab/underground/static/inputfiles/getstarted1/simple_fault_model_orientations.csv'

data = pd.read_csv(data_path_points)
x = data['X']
y = data['Y']
z = data['Z']

xmin, ymin, zmin = x.min(), y.min(), z.min()
xmax, ymax, zmax = x.max(), y.max(), z.max()

geo_model: gp.data.GeoModel = gp.create_geomodel(
project_name='标题',
extent=[xmin, xmax, ymin, ymax, zmin, zmax],
refinement=6,
importer_helper=gp.data.ImporterHelper(
path_to_orientations=data_path_orientations,
path_to_surface_points=data_path_points,
)
)

print(geo_model.structural_frame.structural_elements[0].name)
sol = gp.compute_model(geo_model)

gpv.plot_3d(
model=geo_model,
plotter_type='basic',
show_data=False,
image=False
)

end_time = time.time()

execution_time = end_time - start_time

print(f"Total execution time: {execution_time:.4f} seconds")

You must be logged in to vote

Hi@fivetaibin,

can you verify, that this problem does not exist in 2d plots? Can you also show me, what the structural frame (geo_model.structural_frame) looks like? I am fairly certain, that this is a pyvista limitation, as they allow only one of three basic fonts in the legend (doc#1,docs#2). There was anothersimilar issue discussed on pyvista already.

My suggestion how to solve this, is to

  1. create an image of the legend in matplotlib (you can also add custom fonts to matplotlib,example)
  2. toggle legend in gpv.plot_3d()
  3. return the pvvista object from gpv.plot_3d, add figure as a chart (example)
plotter = gpv.plot_3d(geo_model, legend=False, show=False) # store the pyvista plotter but…

Replies: 2 comments 2 replies

Comment options

this is csv file.
simple_fault_model_orientations.csv
simple_fault_model_points.csv

You must be logged in to vote
0 replies
Comment options

Hi@fivetaibin,

can you verify, that this problem does not exist in 2d plots? Can you also show me, what the structural frame (geo_model.structural_frame) looks like? I am fairly certain, that this is a pyvista limitation, as they allow only one of three basic fonts in the legend (doc#1,docs#2). There was anothersimilar issue discussed on pyvista already.

My suggestion how to solve this, is to

  1. create an image of the legend in matplotlib (you can also add custom fonts to matplotlib,example)
  2. toggle legend in gpv.plot_3d()
  3. return the pvvista object from gpv.plot_3d, add figure as a chart (example)
plotter = gpv.plot_3d(geo_model, legend=False, show=False) # store the pyvista plotter but suppress display# plotter.p is the pyvista Plotter() class# code to add chart to plotter.p here# display plotterplotter.p.show()

If you are able to solve your problem using this or another method, it would be great, if you could share your solution here. I think there are other Chinese users, that would appreciate that a lot.

You must be logged in to vote
2 replies
@fivetaibin
Comment options

I just wanted to thank you for your helpful suggestion! I followed your solution and was able to resolve the issue with ease. It worked perfectly!

Thanks again for your support!

Best regards,

@NilsChudalla
Comment options

I am very happy to hear! I will close the topic for now, but feel free to reopen or start a new thread any time

Answer selected byNilsChudalla
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@fivetaibin@NilsChudalla

[8]ページ先頭

©2009-2025 Movatter.jp