vcs icon indicating copy to clipboard operation
vcs copied to clipboard

Degree Symbol does not plot

Open arulalant opened this issue 6 years ago • 7 comments

Hai,

In previous versions of cdat, we used to plot degree symbol by !Uo!D. But in cdat8.1 version, it is not plotting degree symbol instead it just displaying text as !Uo!D.

Is there any way to plot degree Celsius or degree symbol. ?

arulalant avatar May 17 '19 16:05 arulalant

you can plot using the following syntax in cdat8 unit_name = r"$\ ^oC$"

On Fri, 17 May 2019 at 22:05, Arulalan.T [email protected] wrote:

Hai,

In previous versions of cdat, we used to plot degree symbol by !Uo!D. But in cdat8.1 version, it is not plotting degree symbol instead it just displaying text as !Uo!D.

Is there any way to plot degree Celsius or degree symbol. ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CDAT/vcs/issues/407?email_source=notifications&email_token=ABSK4RXFIL52DVKWXXMK3XLPV3NFLA5CNFSM4HNWYIZKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GUOFVQQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSK4RX4WVPD6AN2BF6BNV3PV3NFLANCNFSM4HNWYIZA .

--


Sathiyaseelan R Research Scholar Center for Atmospheric Sciences Indian Institute of Technology - Delhi HauzKhas NewDelhi - 110016 [email protected] Ph: +91-11-26596052


indseelan avatar May 18 '19 07:05 indseelan

Hai,

Thanks. Using the command ($^{\circ}$C) I am able to plot degree Celsius symbol in cdat8.1. When I am storing the vcs canvas as png, it works perfectly. But when I am saving canvas as pdf, a red colored rectangular border seems to appear over the text (after inserted $^{\circ}$C).

See the attached screenshot taken on pdf file. vcs-degree-symbol

Is there any solution to save pdf without red colored border line ?

arulalant avatar May 18 '19 11:05 arulalant

@scottwittenburg can you investigate please?

@arulalant for more on text object please review:

https://cdat.llnl.gov/Jupyter-notebooks/vcs/Mathematical_Expressions_and_Symbols/Mathematical_Expressions_and_Symbols.html

and

https://cdat.llnl.gov/Jupyter-notebooks/vcs/VCS_Text_Objects/VCS_Text_Objects.html

doutriaux1 avatar May 20 '19 18:05 doutriaux1

ping @danlipsa

scottwittenburg avatar May 20 '19 18:05 scottwittenburg

@doutriaux1 Thanks. Meanwhile is that possible to increase png dpi resolution while saving x.png(filename)?. I couldn't control the dpi in the argument. If I am able to save high definition png image, then also my problem will solve as of now (for plotting degree symbol).

arulalant avatar May 21 '19 05:05 arulalant

@arulalant you can pass width= and heigth= to the png function. Or create big canvas at init time:

import vcs
x=vcs.init(geometry={"width":3000,"height":2000})
x.plot(...)
x.png("filename.png")

or

import vcs
x=vcs.init()
x.plot(...)
x.png("filename.png", width=8000, height=4000, units="pixels")

doutriaux1 avatar May 21 '19 14:05 doutriaux1

Hai,

When I try to change the default font and save plot as pdf, then I am getting error.

v = vcs.init() v.addfont(helvetica_font, 'helvetica') vcs.setdefaultfont('helvetica') ... v.pdf('out.pdf')

ERROR: In ../IO/ExportPDF/vtkPDFExporter.cxx, line 113 vtkPDFExporter (0x7fd3223c24c0): LibHaru failed during PDF export. Error=0x105d detail=0

I am getting the above error while saving as pdf only, not other formats. Any suggestions?

arulalant avatar Nov 08 '19 18:11 arulalant