Reputation: 839
I have created a toy example in Azure. I have the following dataset:
amounts city code user_id
1 2.95 Colleferro 100 999
2 2.95 Subiaco 100 111
3 14.95 Avellino 101 333
4 14.95 Colleferro 101 999
5 14.95 Benevento 101 444
6 -14.95 Subiaco 110 111
7 -14.95 Sgurgola 110 555
8 -14.95 Roma 110 666
9 -14.95 Colleferro 110 999
I create an AzureML experiment that simply plots the column of the amounts.
The code into the R script module is the following:
data.set <- maml.mapInputPort(1) # class: data.frame
#-------------------
plot(data.set$amounts);
title("This title is a very long title. That is not a problem for R, but it becomes a problem when Azure manages it in the visualization.")
#-------------------
maml.mapOutputPort("data.set");
Now, if you click on the right output port of the R script and then on "Visualize"
you will see the Azure page where the outputs are shown.
Now, the following happens:
It seems that this is not the best way to get the images produced by the AzureML experiment.
Possible solution: I would like
to send the picture produced in my experiment to a space like the blob storage.
This would be also a great solution when I have a web-app and I have to pick the image produced by Azure and put it on my Web App page. Do you know if there is a way to send the image somewhere?
Upvotes: 0
Views: 792
Reputation: 756
You can resize the image in following way:
graphics.off()
png("myplot.png",width=300,height=300) ## Create new plot with desired size
plot(data.set);
file.remove(Sys.glob("*rViz*png")) ## Get rid of default rViz file
Upvotes: 0
Reputation: 24138
To saving the images into Azure Blob Storage with R, you need to do two steps, which include getting the images from the R device output of Execute R Script
and uploading the images to Blob Storage.
There are two ways to implement the steps above.
You can publish the experiment as a webservice, then get the images with base64 encoding from the response of the webservice request and use Azure Blob Storage REST API with R to upload the images. Please refer to the article How to retrieve R data visualization from Azure Machine Learning.
You can directly add a module in C# to get & upload the images from the output of Execute R Script
. Please refer to the article Accessing a Visual Generated from R Code in AzureML.
Upvotes: 1