Skip to content

Commit

Permalink
Standardize parameters addons for plotting (based on OSGeo#1071 )
Browse files Browse the repository at this point in the history
Implementing some of the suggestions in issue OSGeo#1071

Question is how to deal with backward compatibility.
  • Loading branch information
ecodiv committed May 9, 2024
1 parent 759668f commit 056429f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/temporal/t.rast.boxplot/t.rast.boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
# %end

# %option
# % key: font_size
# % key: fontsize
# % type: integer
# % label: Font size
# % description: Font size of labels
Expand Down Expand Up @@ -667,7 +667,7 @@ def main(options, flags):
lazy_import_py_modules()

# Plot format options
plt.rcParams["font.size"] = int(options["font_size"])
plt.rcParams["font.size"] = int(options["fontsize"])
grid = flags["g"]

# Get range (if defined)
Expand Down
3 changes: 1 addition & 2 deletions src/vector/v.boxplot/v.boxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
# %end

# %option G_OPT_F_OUTPUT
# % key: plot_output
# % required: no
# % guisection: General
# %end
Expand Down Expand Up @@ -106,7 +105,7 @@ def main():
vector = options["map"]
column = options["column"]
group_by = options["group_by"] if options["group_by"] else None
output = options["plot_output"] if options["plot_output"] else None
output = options["output"] if options["output"] else None
where = (
options["where"] + " AND " + column + " IS NOT NULL"
if options["where"]
Expand Down
3 changes: 1 addition & 2 deletions src/vector/v.histogram/v.histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
# %option G_OPT_DB_WHERE
# %end
# %option G_OPT_F_OUTPUT
# % key: plot_output
# % label: Name for graphic output file for plot (extension decides format, - for screen)
# % required: yes
# % answer: -
Expand Down Expand Up @@ -58,7 +57,7 @@ def main():
layer = options["layer"]
column = options["column"]
bins = int(options["bins"])
plot_output = options["plot_output"]
plot_output = options["output"]
where = options["where"] if options["where"] else None

if where:
Expand Down
4 changes: 1 addition & 3 deletions src/vector/v.scatterplot/v.scatterplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# %end

# %option G_OPT_V_MAP
# % key: map
# % label: Input map
# % description: input vector layer
# % required: yes
Expand Down Expand Up @@ -57,7 +56,6 @@
# %end

# %option G_OPT_F_OUTPUT
# % key: file_name
# % label: Name of the output file (extension decides format)
# % description: Name of the output file. The format is determined by the file extension.
# % required: no
Expand Down Expand Up @@ -603,7 +601,7 @@ def main(options, flags):
# Plot parameters & aesthetics
plot_dimensions = [float(x) for x in options["plot_dimensions"].split(",")]
plot_title = options["title"]
file_name = options["file_name"]
file_name = options["output"]
bins = [int(x) for x in options["bins"].split(",")]
if options["rgbcolumn"]:
dot_color = rgbcolumn
Expand Down

0 comments on commit 056429f

Please sign in to comment.