首页 \ 问答 \ 如何在图像上绘制散点图?(How to plot scatter plot on an image?)

如何在图像上绘制散点图?(How to plot scatter plot on an image?)

我正在尝试将我在Matlab中的GUI转换为JavaFX 8小程序。 我希望有一个散点图,其中的图形在图像上,如下所示。

所需散点图的示例

如上所示,CIE图的图片与散点图集成在一起。 我尝试使用堆叠窗格,但是图形在它上面时图形不可见。

编辑-

试图覆盖layoutplotchildren():

class SuperScatterChart extends ScatterChart{

        public SuperScatterChart(Axis arg0, Axis arg1) {
            super(arg0, arg1 );
            // TODO Auto-generated constructor stub
        }




        @Override
        protected void layoutPlotChildren(){

            ImageView iv1 = new ImageView(new Image("file:///C:/Desktop/cie.png",450,450,true,true));
           // How do I add iv1 to plot children?
            super.layoutPlotChildren();

        }



    }

I am trying to convert my GUI in Matlab to a JavaFX 8 applet. I would like a to have scatter plot where the plots are on the image as shown below.

Example of desired scatter plot

As seen above the picture of the CIE diagram is integrated with the scatter plot. I tried using a stackpane but the plots aren't visible as the image is over it.

edit-

trying to override layoutplotchildren():

class SuperScatterChart extends ScatterChart{

        public SuperScatterChart(Axis arg0, Axis arg1) {
            super(arg0, arg1 );
            // TODO Auto-generated constructor stub
        }




        @Override
        protected void layoutPlotChildren(){

            ImageView iv1 = new ImageView(new Image("file:///C:/Desktop/cie.png",450,450,true,true));
           // How do I add iv1 to plot children?
            super.layoutPlotChildren();

        }



    }

原文:https://stackoverflow.com/questions/38918953
更新时间:2023-12-23 14:12

最满意答案

使用loader api的主要优点是,在进行初始下载时,您将阻止浏览器阻止。 浏览器一次只能下载2到10个东西,所以如果有阻塞,它会给用户带来糟糕的体验

Steve Souders雅虎! 卓越绩效团队已经对此进行了大量研究,以获得更快的网站。 尼克扎卡斯(JavaScript大师)在博客上发表了关于在这里使用史蒂夫的想法


the main advantage for using the loader api is that you will prevent blocking by the browser when its doing the initial downloads. Browsers can only download between 2 & 10 things at a time so if there is blocking it will give bad user experience

Steve Souders and the Yahoo! Exceptional Performance team have done a lot of research into this to get faster websites. Nick Zakas (JavaScript guru) blogged about using Steve's ideas here

相关问答

更多
  • 尝试这个。 用此代码替换您的代码。 这将处理所有。 /************* ENQUEUE JS *************************/ /* pull jquery from google's CDN. If it's not available, grab the local copy. */ $url = 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'; // the URL to check ...
  • Google在其地理编码文档中阐述了这种情况: https : //developers.google.com/maps/articles/geocodestrat#client 。 这不是地图,但信息类似。 值得注意的是 由于地理编码限制是针对每个用户会话的,因此该限制将针对您的应用程序的使用者 。 强调我的。 谷歌并不关心服务器是否托管了嵌入地图的HTML文件。 就Google而言,根本没有来自您的服务器的请求。 请求仅来自访问您网站的客户。 实际上,请求限制是为了防止人们对Maps API进行地毯式轰 ...
  • 你的问题的答案实际上比你想象的要复杂一些。 处理许多相关细节的一个好问题和一组答案在: 破坏地图实例的正确方法是什么? 。 我不确定你的问题,但听起来你可能创建了一个多次加载Google Maps API的页面(或者可能,取决于用户选择),你应该完全避免这种情况。 Google承认存在与重新加载地图相关的内存泄漏错误,并强烈建议不要进行多次地图重新加载。 Google本质上不支持多个地图加载用例。 查看上面问题链接中提供的一些信息; 它包含了一些很好的讨论和信息。 编辑回复@工程师的评论: 查看谷歌地图AP ...
  • 删除脚本元素不会删除这些脚本创建的对象(基本上它不会有任何作用)。 检查maps-API是否已被加载: