Skip to content

Commit

Permalink
add some titles, labels for pyplot
Browse files Browse the repository at this point in the history
  • Loading branch information
j-fu committed Jul 14, 2021
1 parent e431365 commit 8b2a3fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridVisualize"
uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
authors = ["Juergen Fuhrmann <[email protected]>"]
version = "0.2.9"
version = "0.2.10"

[deps]
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
Expand Down
7 changes: 6 additions & 1 deletion src/pyplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ end


### 1D Function
function scalarplot!(ctx, TP::Type{PyPlotType}, ::Type{Val{1}},grid, func)
function scalarplot!(ctx, TP::Type{PyPlotType}, ::Type{Val{1}},grid, func::AbstractVector)
PyPlot=ctx[:Plotter]
if !haskey(ctx,:ax)
ctx[:ax]=ctx[:figure].add_subplot(ctx[:layout]...,ctx[:iplot])
Expand Down Expand Up @@ -446,6 +446,10 @@ function scalarplot!(ctx, TP::Type{PyPlotType}, ::Type{Val{2}},grid, func)
if ctx[:colorbar]==:vertical
ctx[:cbar]=fig.colorbar(cnt,ax=ax,ticks=isolines,boundaries=colorlevels, orientation="vertical")
end

ax.set_xlabel(ctx[:xlabel])

ax.set_ylabel(ctx[:ylabel])

reveal(ctx,TP)
end
Expand Down Expand Up @@ -512,6 +516,7 @@ function scalarplot!(ctx, TP::Type{PyPlotType}, ::Type{Val{3}},grid,func)
ax.set_zlim3d(xyzmin[3],xyzmax[3])
ax.view_init(ctx[:elev],ctx[:azim])

ax.set_title(ctx[:title])

if ctx[:legend]!=:none
ax.legend(loc=leglocs[ctx[:legend]])
Expand Down

2 comments on commit 8b2a3fa

@j-fu
Copy link
Member Author

@j-fu j-fu commented on 8b2a3fa Jul 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/40861

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.10 -m "<description of version>" 8b2a3fa87a160a781e911461d8156e719dd6aa4c
git push origin v0.2.10

Please sign in to comment.